Example #1
0
def scion_server_socket(server_address, api_addr, isd_as):
    logging.info("Starting SCION test server application.")
    soc = ScionServerSocket(L4Proto.SSP, bytes(api_addr, 'ascii'))
    host = HostAddrIPv4(server_address[0])
    saddr = SCIONAddr.from_values(isd_as, host)
    soc.bind(server_address[1], saddr)
    soc.listen()
    return soc
Example #2
0
def scion_server_socket(server_address, isd_as):
    logging.info("Starting SCION test server application.")
    sockdir = "/run/shm/sciond/%s.sock" % isd_as
    soc = ScionServerSocket(L4Proto.SSP, bytes(sockdir, 'ascii'))
    host = HostAddrIPv4(server_address[0])
    saddr = SCIONAddr.from_values(ISD_AS(isd_as), host)
    soc.bind(server_address[1], saddr)
    soc.listen()
    return soc
Example #3
0
 def _create_socket(self, addr):
     sock = ScionServerSocket(L4Proto.SSP, bytes(self.api_addr, 'ascii'))
     sock.settimeout(5.0)
     sock.bind(0, self.addr)
     sock.listen()
     return sock
Example #4
0
 def _create_socket(self, addr):
     sock = ScionServerSocket(L4Proto.UDP, bytes(self.sd.api_addr, 'ascii'))
     sock.settimeout(5.0)
     if sock.bind(0, self.addr) < 0:
         return None
     return sock
Example #5
0
 def _create_socket(self, addr):
     sock = ScionServerSocket(L4Proto.SSP, bytes(self.sd.api_addr, 'ascii'))
     sock.settimeout(5.0)
     sock.bind(random.randint(1025, 65535), self.addr)
     sock.listen()
     return sock