Skip to content

Commit

Permalink
lib: Show tunnel egress interface in ovsdb
Browse files Browse the repository at this point in the history
This commit parses rtnetlink address notifications from the
kernel in order to display the egress interface of tunnels in the
database.

Bug #4103.
  • Loading branch information
ejj committed Jan 4, 2011
1 parent 21d6e22 commit ea83a2f
Show file tree
Hide file tree
Showing 14 changed files with 566 additions and 13 deletions.
4 changes: 3 additions & 1 deletion lib/automake.mk
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ lib_libopenvswitch_a_SOURCES += \
lib/rtnetlink.c \
lib/rtnetlink.h \
lib/rtnetlink-link.c \
lib/rtnetlink-link.h
lib/rtnetlink-link.h \
lib/rtnetlink-route.c \
lib/rtnetlink-route.h
endif

if HAVE_OPENSSL
Expand Down
1 change: 1 addition & 0 deletions lib/netdev-dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ static const struct netdev_class dummy_class = {
NULL, /* get_in6 */
NULL, /* add_router */
NULL, /* get_next_hop */
NULL, /* get_tnl_iface */
NULL, /* arp_lookup */

netdev_dummy_update_flags,
Expand Down
1 change: 1 addition & 0 deletions lib/netdev-linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -2176,6 +2176,7 @@ netdev_linux_poll_remove(struct netdev_notifier *notifier_)
netdev_linux_get_in6, \
netdev_linux_add_router, \
netdev_linux_get_next_hop, \
NULL, /* get_tnl_iface */ \
netdev_linux_arp_lookup, \
\
netdev_linux_update_flags, \
Expand Down
11 changes: 11 additions & 0 deletions lib/netdev-provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,17 @@ struct netdev_class {
int (*get_next_hop)(const struct in_addr *host, struct in_addr *next_hop,
char **netdev_name);

/* Looks up the name of the interface out of which traffic will egress if
* 'netdev' is a tunnel. If unsuccessful, or 'netdev' is not a tunnel,
* will return null. This function does not necessarily return the
* physical interface out which traffic will egress. Instead it returns
* the interface which is assigned 'netdev's remote_ip. This may be an
* internal interface such as a bridge port.
*
* This function may be set to null if 'netdev' is not a tunnel or it is
* not supported. */
const char *(*get_tnl_iface)(const struct netdev *netdev);

/* Looks up the ARP table entry for 'ip' on 'netdev' and stores the
* corresponding MAC address in 'mac'. A return value of ENXIO, in
* particular, indicates that there is no ARP table entry for 'ip' on
Expand Down

0 comments on commit ea83a2f

Please sign in to comment.