On Jan 22, 2013, at 1:45 AM, Julius Bachnick wrote:

> I want to modify some ports under certain conditions so I tried the following:
> 
>         msg = of.ofp_port_mod( port_no=p,
>                                  config = of.OFPPC_NO_RECV,
>                                  mask = of.OFPPC_NO_RECV )
>         self.connection.send(msg)
> 
> 
> which unfortunately does not seem to work (is the hw_addr mandatory? - If so, 
> where do I get it from?).

Yes, the hardware address is mandatory (as the spec says, "This is used to 
sanity-check the request, so it must be the same as returned in an ofp_phy_port 
struct").

The connection object's .ports attribute stores ofp_phy_port info for each 
port.  Off the top of my head, it should be something like:

        msg = of.ofp_port_mod( port_no=p,
                                 hw_addr = self.connection.ports[p].hw_addr,
                                 config = of.OFPPC_NO_RECV,
                                 mask = of.OFPPC_NO_RECV )
        self.connection.send(msg)

This probably requires that you're using the betta branch.

Hope that helps.

-- Murphy

Reply via email to