Ejemplo n.º 1
0
        def link(self, value):
                if type(value) is str:
                        try:
                                value = Link.resolve(value)
                        except KeyError:
                                raise ValueError()

        	capi.rtnl_addr_set_link(self._rtnl_addr, value._rtnl_link)

                # ifindex is immutable but we assume that if _orig does not
                # have an ifindex specified, it was meant to be given here
                if capi.rtnl_addr_get_ifindex(self._orig) == 0:
                        capi.rtnl_addr_set_ifindex(self._orig, value.ifindex)
Ejemplo n.º 2
0
    def link(self, value):
        if type(value) is str:
            try:
                value = Link.resolve(value)
            except KeyError:
                raise ValueError()

        capi.rtnl_addr_set_link(self._rtnl_addr, value._rtnl_link)

        # ifindex is immutable but we assume that if _orig does not
        # have an ifindex specified, it was meant to be given here
        if capi.rtnl_addr_get_ifindex(self._orig) == 0:
            capi.rtnl_addr_set_ifindex(self._orig, value.ifindex)
Ejemplo n.º 3
0
 def ifindex(self):
         """interface index"""
         return capi.rtnl_addr_get_ifindex(self._rtnl_addr)
Ejemplo n.º 4
0
 def ifindex(self):
     """interface index"""
     return capi.rtnl_addr_get_ifindex(self._rtnl_addr)