def _to_idl(self): addr_idl = None if self._address != None: addr_idl = NetworkInterface._convert_to_networkaddressidl( self._address) if self._network_interface == None: network_interface_name = None network_interface_handle = 0 network_interface_type = 0 else: network_interface_name = self._network_interface.name network_interface_handle = self._network_interface.xos_handle network_interface_type = self._network_interface.interface_type if self._metric is not None: nh_metric = self._metric else: nh_metric = 0 nh_idl = RouteNextHopIDL(network_interface_name, addr_idl, network_interface_handle, network_interface_type, 0, nh_metric, self._route_tag) self.log.info('Creating RouteNextHopIDL') scope_idl = None if self._scope != None and isinstance(self._scope, (L3UnicastScope, )): scope_idl = self._scope._to_idl() l3nh_idl = L3UcastRouteNextHopIDL(nh_idl, 0, scope_idl) self.log.info('Creating L3UcastRouteNextHopIDL') return l3nh_idl
def _to_idl(self): prefix_idl = None addr_idl = None if self._start_prefix is not None: addr_idl = NetworkInterface._convert_to_networkaddressidl( self._start_prefix.address) prefix_idl = NetworkPrefixIDL(self._start_prefix.prefix_length, addr_idl) return L3UcastRouteRangeIDL(self._range_type, self._count, prefix_idl)
def _to_idl(self): prefix_idl = None if self._prefix != None: addr_idl = NetworkInterface._convert_to_networkaddressidl( self._prefix.address) prefix_idl = NetworkPrefixIDL(self._prefix.prefix_length, addr_idl) self.log.info('Creating NetworkprefixIDL') r_idl = RouteIDL(0, 0, 0) r_idl.adminDistance = self._admin_distance r_idl.metric = self._metric hop_id_list = list() if self._next_hop_list != None: for hop in self._next_hop_list: if hop != None: hop_id_list.append(hop._to_idl()) self.log.info('Creating L3UcastRouteIDL') if self._route_type == None: self._route_type = 0 if self._owner_type == None: self._owner_type = 0 return L3UcastRouteIDL(r_idl, self._route_type, self._owner_type, self._owner_tag, prefix_idl, hop_id_list)