|
|
The next-hop information can be one of the following: network interface, IP host address (local or peer address on point-to-point links), or IP subnet address (of the directly connected subnet for an interface).
Note that observers (NexthopPortMapperObserver) can be attached to monitor changes to the port mapping. The observers notification is triggered by an explicit call to NexthopPortMappernotify_observers.
NexthopPortMapper ()
| NexthopPortMapper |
~NexthopPortMapper ()
| ~NexthopPortMapper |
void clear ()
| clear |
int add_observer (NexthopPortMapperObserver* observer)
| add_observer |
Add an observer for observing changes to the mapper.
Parameters:
observer | the observer to add. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_observer (NexthopPortMapperObserver* observer)
| delete_observer |
Delete an observer for observing changes to the mapper.
Parameters:
observer | the observer to delete. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
void notify_observers ()
| notify_observers |
Notify observers about any port mapping changes.
int lookup_nexthop_interface (const string& ifname,
const string& vifname)
| lookup_nexthop_interface |
[const]
Lookup a next-hop interface/vif name to obtain the corresponding port number.
Parameters:
ifname | the next-hop interface name to lookup. |
vifname | the next-hop vif name to lookup. |
Returns: the port number on success, otherwise -1.
int lookup_nexthop_ipv4 (const IPv4& ipv4)
| lookup_nexthop_ipv4 |
[const]
Lookup a next-hop IPv4 address to obtain the corresponding port number.
Parameters:
ipv4 | the next-hop address to lookup. |
Returns: the port number on success, otherwise -1.
int lookup_nexthop_ipv6 (const IPv6& ipv6)
| lookup_nexthop_ipv6 |
[const]
Lookup a next-hop IPv6 address to obtain the corresponding port number.
Parameters:
ipv6 | the next-hop address to lookup. |
Returns: the port number on success, otherwise -1.
int add_interface (const string& ifname, const string& vifname, int port)
| add_interface |
Add an entry for an interface/vif name to port mapping.
If the entry already exists, then the port will be updated.
Parameters:
ifname | the interface name to add. |
vifname | the vif name to add. |
port | the port number to add. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_interface (const string& ifname, const string& vifname)
| delete_interface |
Delete an entry for an interface/vif name to port mapping.
Parameters:
ifname | the interface name to delete. |
vifname | the vif name to delete. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int add_ipv4 (const IPv4& ipv4, int port)
| add_ipv4 |
Add an entry for an IPv4 address to port mapping.
If the entry already exists, then the port will be updated.
Parameters:
ipv4 | the address to add. |
port | the port number to add. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_ipv4 (const IPv4& ipv4)
| delete_ipv4 |
Delete an entry for an IPv4 address to port mapping.
Parameters:
ipv4 | the address to delete. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int add_ipv6 (const IPv6& ipv6, int port)
| add_ipv6 |
Add an entry for an IPv6 address to port mapping.
If the entry already exists, then the port will be updated.
Parameters:
ipv6 | the address to add. |
port | the port number to add. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_ipv6 (const IPv6& ipv6)
| delete_ipv6 |
Delete an entry for an IPv6 address to port mapping.
Parameters:
ipv6 | the address to delete. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int add_ipv4net (const IPv4Net& ipv4net, int port)
| add_ipv4net |
Add an entry for an IPv4 subnet to port mapping.
If the entry already exists, then the port will be updated.
Parameters:
ipv4net | the subnet to add. |
port | the port number to add. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_ipv4net (const IPv4Net& ipv4net)
| delete_ipv4net |
Delete an entry for an IPv4 subnet to port mapping.
Parameters:
ipv4net | the subnet to delete. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int add_ipv6net (const IPv6Net& ipv6net, int port)
| add_ipv6net |
Add an entry for an IPv6 subnet to port mapping.
If the entry already exists, then the port will be updated.
Parameters:
ipv6net | the subnet to add. |
port | the port number to add. |
Returns: XORP_OK on success, otherwise XORP_ERROR.
int delete_ipv6net (const IPv6Net& ipv6net)
| delete_ipv6net |
Delete an entry for an IPv6 subnet to port mapping.
Parameters:
ipv6net | the subnet to delete. |
Returns: XORP_OK on success, otherwise XORP_ERROR.