Lines Matching defs:struct
7 import struct
29 "ifr_addr": "HH12s", # struct sockaddr_in ifr_addr
30 "ifr_hwaddr": "H14s", # struct sockaddr ifru_hwaddr
38 """Packs a binary string representing a struct ifreq.
40 The struct ifreq is used to call ioctl() on network devices. The argument
42 union of different types. This function packs the struct according to the
47 @param argname: The name of the member used for the union in struct ifreq.
53 return struct.pack(IFNAMSIZ_FMT + STRUCT_IFREQ_FMT[argname], if_name, *args)
57 """Returns a tuple with the interpreted contents of the a struct ifreq.
60 than the passed struct ifreq request. This function decodes this result into
63 @param data: The packed representation of the struct ifreq.
64 @param argname: The name of the member used for the union in struct ifreq.
69 return struct.unpack(IFNAMSIZ_FMT + STRUCT_IFREQ_FMT[argname], data)
114 ifs_name, ifs_mode = struct.unpack(IFNAMSIZ_FMT + "H", ifs)
176 str_mask = struct.pack('!I', net_mask)