X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fnetdev.h;h=7c841715ab04edc6d8c4f6c3d116292d3def8570;hb=3bcc21747fd1c8b11a92624d97ce593ee3db1bd1;hp=0111e528f88c44f60474112eed3af3f9af3aea53;hpb=f1c6daebf32ffabeb2d2e7c35f2cb00057dff47b;p=sliver-openvswitch.git diff --git a/include/netdev.h b/include/netdev.h index 0111e528f..7c841715a 100644 --- a/include/netdev.h +++ b/include/netdev.h @@ -43,10 +43,17 @@ #include #include -struct buffer; +struct ofpbuf; struct in_addr; struct in6_addr; +enum netdev_feature_type { + NETDEV_FEAT_CURRENT, + NETDEV_FEAT_ADVERTISED, + NETDEV_FEAT_SUPPORTED, + NETDEV_FEAT_PEER +}; + enum netdev_flags { NETDEV_UP = 0x0001, /* Device enabled? */ NETDEV_PROMISC = 0x0002 /* Promiscuous mode? */ @@ -59,18 +66,20 @@ enum netdev_pseudo_ethertype { }; struct netdev; + int netdev_open(const char *name, int ethertype, struct netdev **); +int netdev_open_tap(const char *name, struct netdev **); void netdev_close(struct netdev *); -int netdev_recv(struct netdev *, struct buffer *); + +int netdev_recv(struct netdev *, struct ofpbuf *); void netdev_recv_wait(struct netdev *); -void netdev_drain(struct netdev *); -int netdev_send(struct netdev *, const struct buffer *); +int netdev_drain(struct netdev *); +int netdev_send(struct netdev *, const struct ofpbuf *); const uint8_t *netdev_get_etheraddr(const struct netdev *); const char *netdev_get_name(const struct netdev *); int netdev_get_mtu(const struct netdev *); -int netdev_get_speed(const struct netdev *); int netdev_get_link_status(const struct netdev *); -uint32_t netdev_get_features(const struct netdev *); +uint32_t netdev_get_features(struct netdev *, int); bool netdev_get_in4(const struct netdev *, struct in_addr *); int netdev_set_in4(struct netdev *, struct in_addr addr, struct in_addr mask); int netdev_add_router(struct netdev *, struct in_addr router);