class NexthopPortMapper

A class for to keep the mapping between next-hop information and a port number. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Methods


Detailed Description

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

Clear all mapping.

int  add_observer (NexthopPortMapperObserver* observer)

add_observer

Add an observer for observing changes to the mapper.

Parameters:

observerthe 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:

observerthe 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:

ifnamethe next-hop interface name to lookup.
vifnamethe 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:

ipv4the 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:

ipv6the 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:

ifnamethe interface name to add.
vifnamethe vif name to add.
portthe 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:

ifnamethe interface name to delete.
vifnamethe 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:

ipv4the address to add.
portthe 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:

ipv4the 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:

ipv6the address to add.
portthe 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:

ipv6the 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:

ipv4netthe subnet to add.
portthe 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:

ipv4netthe 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:

ipv6netthe subnet to add.
portthe 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:

ipv6netthe subnet to delete.

Returns: XORP_OK on success, otherwise XORP_ERROR.


Generated by: pavlin on possum.icir.org on Wed Apr 13 21:53:05 2005, using kdoc $.