X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=lib%2Fnetdev-vport.c;h=b006a677b4224f3c719e8338d15996929b9a2635;hb=e05924baf0c757b579eef2b3743130ade4b1a93c;hp=f3985e9d23184b78ae97f62d33459257dbf529e0;hpb=ea83a2fcd0d31246ece7bdea4c54e162f432e81c;p=openvswitch diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index f3985e9d..b006a677 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -100,6 +100,7 @@ static void netdev_vport_route_change(const struct rtnetlink_route_change *, void *); static void netdev_vport_link_change(const struct rtnetlink_link_change *, void *); +static const char *netdev_vport_get_tnl_iface(const struct netdev *netdev); static bool is_vport_class(const struct netdev_class *class) @@ -364,6 +365,18 @@ netdev_vport_set_stats(struct netdev *netdev, const struct netdev_stats *stats) return err; } +static int +netdev_vport_get_status(const struct netdev *netdev, struct shash *sh) +{ + const char *iface = netdev_vport_get_tnl_iface(netdev); + + if (iface) { + shash_add(sh, "tunnel_egress_iface", xstrdup(iface)); + } + + return 0; +} + static int netdev_vport_update_flags(struct netdev *netdev OVS_UNUSED, enum netdev_flags off, enum netdev_flags on OVS_UNUSED, @@ -924,7 +937,7 @@ parse_patch_config(const struct netdev_dev *dev, const struct shash *args, return 0; } -#define VPORT_FUNCTIONS(TNL_IFACE) \ +#define VPORT_FUNCTIONS(GET_STATUS) \ netdev_vport_init, \ netdev_vport_run, \ netdev_vport_wait, \ @@ -950,6 +963,7 @@ parse_patch_config(const struct netdev_dev *dev, const struct shash *args, netdev_vport_get_mtu, \ NULL, /* get_ifindex */ \ NULL, /* get_carrier */ \ + NULL, /* get_miimon */ \ netdev_vport_get_stats, \ netdev_vport_set_stats, \ \ @@ -974,7 +988,7 @@ parse_patch_config(const struct netdev_dev *dev, const struct shash *args, NULL, /* get_in6 */ \ NULL, /* add_router */ \ NULL, /* get_next_hop */ \ - TNL_IFACE, \ + GET_STATUS, \ NULL, /* arp_lookup */ \ \ netdev_vport_update_flags, \ @@ -986,11 +1000,11 @@ void netdev_vport_register(void) { static const struct vport_class vport_classes[] = { - { { "gre", VPORT_FUNCTIONS(netdev_vport_get_tnl_iface) }, + { { "gre", VPORT_FUNCTIONS(netdev_vport_get_status) }, parse_tunnel_config }, - { { "ipsec_gre", VPORT_FUNCTIONS(netdev_vport_get_tnl_iface) }, + { { "ipsec_gre", VPORT_FUNCTIONS(netdev_vport_get_status) }, parse_tunnel_config }, - { { "capwap", VPORT_FUNCTIONS(netdev_vport_get_tnl_iface) }, + { { "capwap", VPORT_FUNCTIONS(netdev_vport_get_status) }, parse_tunnel_config }, { { "patch", VPORT_FUNCTIONS(NULL) }, parse_patch_config } };