Ejemplo n.º 1
0
    def _gen_br_entry(self, local, ifid, remote, remote_type, attrs, local_br,
                      remote_br):
        public_addr, remote_addr = self._reg_link_addrs(local_br, remote_br)

        self.topo_dicts[local]["BorderRouters"][local_br] = {
            'InternalAddr': {
                'Public': [{
                    'Addr': self._reg_addr(local, local_br),
                    'L4Port': random.randint(30050, 30100),
                }]
            },
            'Interfaces': {
                ifid: {  # Interface ID.
                    'Overlay': self.overlay,
                    'Public': {
                        'Addr': public_addr,
                        'L4Port': SCION_ROUTER_PORT
                    },
                    'Remote': {
                        'Addr': remote_addr,
                        'L4Port': SCION_ROUTER_PORT
                    },
                    'Bandwidth': attrs.get('bw', DEFAULT_LINK_BW),
                    'ISD_AS': str(remote),
                    'LinkTo': LinkType.to_str(remote_type.lower()),
                    'MTU': attrs.get('mtu', DEFAULT_MTU)
                }
            }
        }
Ejemplo n.º 2
0
 def _gen_br_intf(self, remote, public_addr, remote_addr, attrs,
                  remote_type):
     return {
         'underlay': {
             'public': join_host_port(public_addr.ip, SCION_ROUTER_PORT),
             'remote': join_host_port(remote_addr.ip, SCION_ROUTER_PORT),
         },
         'bandwidth': attrs.get('bw', DEFAULT_LINK_BW),
         'isd_as': str(remote),
         'link_to': LinkType.to_str(remote_type.lower()),
         'mtu': attrs.get('mtu', DEFAULT_MTU)
     }
Ejemplo n.º 3
0
 def _gen_br_intf(self, remote, public_addr, remote_addr, attrs, remote_type):
     return {
         'Overlay': self.overlay,
         'PublicOverlay': {
             'Addr': public_addr,
             'OverlayPort': SCION_ROUTER_PORT
             },
         'RemoteOverlay': {
             'Addr': remote_addr,
             'OverlayPort': SCION_ROUTER_PORT
             },
         'Bandwidth': attrs.get('bw', DEFAULT_LINK_BW),
         'ISD_AS': str(remote),
         'LinkTo': LinkType.to_str(remote_type.lower()),
         'MTU': attrs.get('mtu', DEFAULT_MTU)
         }
Ejemplo n.º 4
0
 def short_desc(self):
     return "RevInfo: %s IF: %s Link type: %s Timestamp: %s TTL: %ss" % (
         self.isd_as(), self.p.ifID, LinkType.to_str(self.p.linkType),
         iso_timestamp(self.p.timestamp), self.p.ttl)