Lines Matching refs:s
445 def SetSocketMark(self, s, netid): argument
448 s.setsockopt(SOL_SOCKET, net_test.SO_MARK, netid)
450 def GetSocketMark(self, s): argument
451 return s.getsockopt(SOL_SOCKET, net_test.SO_MARK)
453 def ClearSocketMark(self, s): argument
454 self.SetSocketMark(s, 0)
456 def BindToDevice(self, s, iface): argument
459 s.setsockopt(SOL_SOCKET, SO_BINDTODEVICE, iface)
461 def SetUnicastInterface(self, s, ifindex): argument
467 s.setsockopt(net_test.SOL_IP, IP_UNICAST_IF, ifindex)
468 if s.family == AF_INET6:
469 s.setsockopt(net_test.SOL_IPV6, IPV6_UNICAST_IF, ifindex)
485 def SelectInterface(self, s, netid, mode): argument
487 os.fchown(s.fileno(), self.UidForNetid(netid), -1)
489 self.SetSocketMark(s, netid)
492 self.BindToDevice(s, iface)
494 self.SetUnicastInterface(s, self.ifindices.get(netid, 0))
500 s = constructor(self.GetProtocolFamily(version))
503 self.SelectInterface(s, netid, routing_mode)
505 os.fchown(s.fileno(), self.UidForNetid(netid), -1)
507 return s
522 def SendOnNetid(self, version, s, dstaddr, dstport, netid, payload, cmsgs): argument
529 csocket.Sendmsg(s, (dstaddr, dstport), payload, cmsgs, csocket.MSG_CONFIRM)