def Ipv6MreqOption(level, option, doc): format = "<16sI" size = struct.calcsize(format) @option_error_decorator def getter(self): mcast, iface = struct.unpack(format, self._sock.getsockopt(level, option, size)) return _socket.inet6_ntoa(mcast), iface @option_error_decorator def setter(self, (mcast, iface)): raw = struct.pack(format, _socket.inet6_aton(mcast), iface) self._sock.setsockopt(level, option, raw)
def SockaddrIn6Option(level, option, doc): format = "<BBHL16s" size = struct.calcsize(format) @option_error_decorator def getter(self): len, fam, port, flow, addr = struct.unpack(format, self._sock.getsockopt(level, option, size)) return port, flow, _socket.inet6_ntoa(addr) @option_error_decorator def setter(self, (port, flow, addr)): raw = struct.pack(format, size, consts.AddressFamily.IPv6, port, flow, _socket.inet6_aton(mcast)) self._sock.setsockopt(level, option, raw)
def Ipv6MreqOption(level, option, doc): format = "<16sI" size = struct.calcsize(format) @option_error_decorator def getter(self): mcast, iface = struct.unpack( format, self._sock.getsockopt(level, option, size)) return _socket.inet6_ntoa(mcast), iface @option_error_decorator def setter(self, (mcast, iface)): raw = struct.pack(format, _socket.inet6_aton(mcast), iface) self._sock.setsockopt(level, option, raw)
def SockaddrIn6Option(level, option, doc): format = "<BBHL16s" size = struct.calcsize(format) @option_error_decorator def getter(self): len, fam, port, flow, addr = struct.unpack( format, self._sock.getsockopt(level, option, size)) return port, flow, _socket.inet6_ntoa(addr) @option_error_decorator def setter(self, (port, flow, addr)): raw = struct.pack(format, size, consts.AddressFamily.IPv6, port, flow, _socket.inet6_aton(mcast)) self._sock.setsockopt(level, option, raw)