def get_conf(self, id):
return capi.inet_get_conf(self._link._rtnl_link, _resolve(id))
-
+
def set_conf(self, id, value):
return capi.rtnl_link_inet_set_conf(self._link._rtnl_link,
_resolve(id), int(value))
@property
def forwarding(self):
return bool(self.get_conf(DEVCONF_FORWARDING))
-
+
@forwarding.setter
def forwarding(self, value):
self.set_conf(DEVCONF_FORWARDING, int(value))
@property
def mc_forwarding(self):
return bool(self.get_conf(DEVCONF_MC_FORWARDING))
-
+
@mc_forwarding.setter
def mc_forwarding(self, value):
self.set_conf(DEVCONF_MC_FORWARDING, int(value))
@property
def proxy_arp(self):
return bool(self.get_conf(DEVCONF_PROXY_ARP))
-
+
@proxy_arp.setter
def proxy_arp(self, value):
self.set_conf(DEVCONF_PROXY_ARP, int(value))
@property
def accept_redirects(self):
return bool(self.get_conf(DEVCONF_ACCEPT_REDIRECTS))
-
+
@accept_redirects.setter
def accept_redirects(self, value):
self.set_conf(DEVCONF_ACCEPT_REDIRECTS, int(value))
@property
def secure_redirects(self):
return bool(self.get_conf(DEVCONF_SECURE_REDIRECTS))
-
+
@secure_redirects.setter
def secure_redirects(self, value):
self.set_conf(DEVCONF_SECURE_REDIRECTS, int(value))
@property
def send_redirects(self):
return bool(self.get_conf(DEVCONF_SEND_REDIRECTS))
-
+
@send_redirects.setter
def send_redirects(self, value):
self.set_conf(DEVCONF_SEND_REDIRECTS, int(value))
@property
def shared_media(self):
return bool(self.get_conf(DEVCONF_SHARED_MEDIA))
-
+
@shared_media.setter
def shared_media(self, value):
self.set_conf(DEVCONF_SHARED_MEDIA, int(value))
def stats(self, fmt):
return fmt.nl('{t|packets} {t|bytes} {t|qlen}')
-
+
###########################################################################
# Queueing discipline cache
class QdiscCache(netlink.Cache):
fmt = util.MyFormatter(self, indent)
buf = fmt.format(self.brief('qdisc', nodev, noparent))
-
+
if details:
buf += fmt.nl('\t' + self.details())
if stats:
buf += self.stats(fmt)
-
+
# if stats:
# l = [['Packets', RX_PACKETS, TX_PACKETS],
# ['Bytes', RX_BYTES, TX_BYTES],
if details:
buf += fmt.nl('\t' + self.details())
-
+
return buf
###########################################################################
if details:
buf += fmt.nl('\t' + self.details())
-
+
return buf
_qdisc_cache = QdiscCache()
(handle == None or qdisc.handle == handle) and \
(parent == None or qdisc.parent == parent):
l.append(qdisc)
-
+
return l
_class_cache = {}
except KeyError:
cache = TcClassCache(ifindex)
_class_cache[ifindex] = cache
-
+
cache.refill()
for cl in cache:
except KeyError:
cache = ClassifierCache(ifindex, parent)
_cls_cache[ifindex][parent] = cache
-
+
cache.refill()
for cls in cache: