Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: Introducing interface type to struct interface #14799

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/if.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ extern "C" {

DECLARE_MTYPE(CONNECTED_LABEL);

/* Interface type - ones of interest. */
enum intf_type {
IF_OTHER = 0, /* Anything else */
IF_VXLAN, /* VxLAN interface */
IF_VRF, /* VRF device */
IF_BRIDGE, /* bridge device */
IF_VLAN, /* VLAN sub-interface */
IF_MACVLAN, /* MAC VLAN interface*/
IF_VETH, /* VETH interface*/
IF_BOND, /* Bond */
IF_GRE, /* GRE interface */
};

/* Interface link-layer type, if known. Derived from:
*
* net/if_arp.h on various platforms - Linux especially.
Expand Down Expand Up @@ -308,6 +321,7 @@ struct interface {
* fashion?
*/
bool configured;
enum intf_type if_type;

QOBJ_FIELDS;
};
Expand Down
1 change: 1 addition & 0 deletions lib/zclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -2782,6 +2782,7 @@ static void zebra_interface_if_set_value(struct stream *s,
STREAM_GETL(s, ifp->link_ifindex);
STREAM_GETL(s, ifp->ll_type);
STREAM_GETL(s, ifp->hw_addr_len);
STREAM_GETL(s, ifp->if_type);
if (ifp->hw_addr_len)
STREAM_GET(ifp->hw_addr, s,
MIN(ifp->hw_addr_len, INTERFACE_HWADDR_MAX));
Expand Down
1 change: 1 addition & 0 deletions zebra/zapi_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ static void zserv_encode_interface(struct stream *s, struct interface *ifp)
stream_putl(s, zif->link_ifindex);
stream_putl(s, ifp->ll_type);
stream_putl(s, ifp->hw_addr_len);
stream_putl(s, zif->zif_type);
if (ifp->hw_addr_len)
stream_put(s, ifp->hw_addr, ifp->hw_addr_len);

Expand Down
Loading