Try this patch. Also, your parameter for OFPAT_SET_NW_TOS ("44") should probably be an integer (44).
-- Murphy On Mon, 2010-11-15 at 15:30 -0500, Aaron Rosen wrote: > Thanks Niky, > > > Does anyone know how I would modify those ToS bits then? Or what all I > would have to add to make, make_action_array be able to modify the ToS > in the manor that I'm attempting? > > > Thanks, > > Aaron > > On Mon, Nov 15, 2010 at 3:20 PM, Niky Riga <nr...@bbn.com> wrote: > I am not 100% but I think the problem is that the > OFPAT_SET_NW_TOS action is not currently handled by the > function that creates the actions > for the python modules. > > If you look at the core.py (src/nox/lib/core.py) there is a > function > make_action_array() that creates the actions string that is > sent. > > This function covers all the cases but the OFPAT_SET_NW_TOS > action. > > Hope this is helpful. > > --niky > > Aaron Rosen wrote: > > Hello, > > I'm trying to change the ToS bits in IP packets but > nox is telling me invalid action type 8. > > Here is the blurb of code that I'm trying: > > attrs = extract_flow(packet) > outport = self.data[dpid, mac_to_str(packet.dst)] > actions = [[openflow.OFPAT_SET_NW_TOS, "44"], > [ openflow.OFPAT_OUTPUT, [0, outport]]] > self.install_datapath_flow( dpid , attrs, 5, 0, > actions, bufid, openflow.OFP_DEFAULT_PRIORITY, inport, > packet) > > Could anyone point out where I'm going wrong? > > Thanks, > > Aaron > > > > -- > Aaron O. Rosen > Masters Student - Network Communication > 306B Fluor Daniel > 843.425.9777 > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > nox-dev mailing list > nox-dev@noxrepo.org > http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org > > > > -- > Aaron O. Rosen > Masters Student - Network Communication > 306B Fluor Daniel > 843.425.9777 > > > _______________________________________________ > nox-dev mailing list > nox-dev@noxrepo.org > http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org
diff --git a/src/nox/lib/core.py b/src/nox/lib/core.py index 67823d1..3b994c6 100644 --- a/src/nox/lib/core.py +++ b/src/nox/lib/core.py @@ -171,6 +171,8 @@ class Component: elif action[0] == openflow.OFPAT_SET_TP_SRC \ or action[0] == openflow.OFPAT_SET_TP_DST: a = struct.pack("!HHHH", action[0], 8, action[1], 0) + elif action[0] == openflow.OFPAT_SET_NW_TOS: + a = struct.pack("!HHBBBB", action[0], 8, action[1], 0, 0, 0) else: print 'invalid action type', action[0] return None
_______________________________________________ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org