Beispiel #1
0
 def decode(self):
     nlmsg.decode(self)
     if self[self.ffname] == AF_INET:
         self['idiag_dst'] = inet_ntop(AF_INET,
                                       pack('>I', self['idiag_dst'][0]))
         self['idiag_src'] = inet_ntop(AF_INET,
                                       pack('>I', self['idiag_src'][0]))
     elif self[self.ffname] == AF_INET6:
         self['idiag_dst'] = inet_ntop(AF_INET6,
                                       pack('>IIII', *self['idiag_dst']))
         self['idiag_src'] = inet_ntop(AF_INET6,
                                       pack('>IIII', *self['idiag_src']))
Beispiel #2
0
 def decode(self):
     nlmsg.decode(self)
     if self[self.ffname] == AF_INET:
         self['idiag_dst'] = inet_ntop(AF_INET,
                                       pack('>I', self['idiag_dst'][0]))
         self['idiag_src'] = inet_ntop(AF_INET,
                                       pack('>I', self['idiag_src'][0]))
     elif self[self.ffname] == AF_INET6:
         self['idiag_dst'] = inet_ntop(AF_INET6,
                                       pack('>IIII', *self['idiag_dst']))
         self['idiag_src'] = inet_ntop(AF_INET6,
                                       pack('>IIII', *self['idiag_src']))
Beispiel #3
0
 def decode(self):
     nlmsg.decode(self)
     if self['flags'] & 1:
         self['state'] = 'up'
     else:
         self['state'] = 'down'
Beispiel #4
0
 def decode(self):
     nlmsg.decode(self)
     self['payload'] = self.buf.read(self['data_len'])
Beispiel #5
0
 def decode(self):
     nlmsg.decode(self)
     self['payload'] = self.buf.read(self['data_len'])
Beispiel #6
0
 def decode(self):
     nlmsg.decode(self)
     if self['flags'] & 1:
         self['state'] = 'up'
     else:
         self['state'] = 'down'