Skip to content

Commit

Permalink
route: merge branch 'netconf'
Browse files Browse the repository at this point in the history
  • Loading branch information
thom311 committed May 12, 2017
2 parents b5513d4 + 37fda66 commit c8adb57
Show file tree
Hide file tree
Showing 8 changed files with 745 additions and 40 deletions.
2 changes: 2 additions & 0 deletions Makefile.am
Expand Up @@ -100,6 +100,7 @@ libnlinclude_netlink_route_HEADERS = \
include/netlink/route/link.h \
include/netlink/route/neighbour.h \
include/netlink/route/neightbl.h \
include/netlink/route/netconf.h \
include/netlink/route/nexthop.h \
include/netlink/route/pktloc.h \
include/netlink/route/qdisc.h \
Expand Down Expand Up @@ -380,6 +381,7 @@ lib_libnl_route_3_la_SOURCES = \
lib/route/link/vxlan.c \
lib/route/neigh.c \
lib/route/neightbl.c \
lib/route/netconf.c \
lib/route/nexthop.c \
lib/route/pktloc.c \
lib/route/qdisc/blackhole.c \
Expand Down
28 changes: 28 additions & 0 deletions include/linux-private/linux/netconf.h
@@ -0,0 +1,28 @@
#ifndef __LINUX_NETCONF_H_
#define __LINUX_NETCONF_H_

#include <linux/types.h>
#include <linux/netlink.h>

struct netconfmsg {
__u8 ncm_family;
};

enum {
NETCONFA_UNSPEC,
NETCONFA_IFINDEX,
NETCONFA_FORWARDING,
NETCONFA_RP_FILTER,
NETCONFA_MC_FORWARDING,
NETCONFA_PROXY_NEIGH,
NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN,
NETCONFA_INPUT,
__NETCONFA_MAX
};
#define NETCONFA_MAX (__NETCONFA_MAX - 1)
#define NETCONFA_ALL -1

#define NETCONFA_IFINDEX_ALL -1
#define NETCONFA_IFINDEX_DEFAULT -2

#endif /* __LINUX_NETCONF_H_ */
4 changes: 4 additions & 0 deletions include/linux-private/linux/rtnetlink.h
Expand Up @@ -122,6 +122,8 @@ enum {

RTM_NEWNETCONF = 80,
#define RTM_NEWNETCONF RTM_NEWNETCONF
RTM_DELNETCONF,
#define RTM_DELNETCONF RTM_DELNETCONF
RTM_GETNETCONF = 82,
#define RTM_GETNETCONF RTM_GETNETCONF

Expand Down Expand Up @@ -645,6 +647,8 @@ enum rtnetlink_groups {
#define RTNLGRP_MPLS_ROUTE RTNLGRP_MPLS_ROUTE
RTNLGRP_NSID,
#define RTNLGRP_NSID RTNLGRP_NSID
RTNLGRP_MPLS_NETCONF,
#define RTNLGRP_MPLS_NETCONF RTNLGRP_MPLS_NETCONF
__RTNLGRP_MAX
};
#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
Expand Down
4 changes: 4 additions & 0 deletions include/netlink/netlink-compat.h
Expand Up @@ -47,4 +47,8 @@ typedef unsigned short sa_family_t;
#define AF_LLC 26
#endif

#ifndef AF_MPLS
#define AF_MPLS 28
#endif

#endif
44 changes: 44 additions & 0 deletions include/netlink/route/netconf.h
@@ -0,0 +1,44 @@
/*
* netlink/route/netconf.h rtnetlink netconf layer
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* Copyright (c) 2017 David Ahern <dsa@cumulusnetworks.com>
*/

#ifndef NETCONF_H_
#define NETCONF_H_

#ifdef __cplusplus
extern "C" {
#endif

struct rtnl_netconf;

int rtnl_netconf_alloc_cache(struct nl_sock *sk, struct nl_cache **result);

struct rtnl_netconf *rtnl_netconf_get_by_idx(struct nl_cache *cache, int family,
int ifindex);
struct rtnl_netconf *rtnl_netconf_get_all(struct nl_cache *cache,
int family);
struct rtnl_netconf *rtnl_netconf_get_default(struct nl_cache *cache,
int family);
void rtnl_netconf_put(struct rtnl_netconf *nc);

int rtnl_netconf_get_family(struct rtnl_netconf *nc, int *val);
int rtnl_netconf_get_ifindex(struct rtnl_netconf *nc, int *val);
int rtnl_netconf_get_forwarding(struct rtnl_netconf *nc, int *val);
int rtnl_netconf_get_mc_forwarding(struct rtnl_netconf *nc, int *val);
int rtnl_netconf_get_rp_filter(struct rtnl_netconf *nc, int *val);
int rtnl_netconf_get_proxy_neigh(struct rtnl_netconf *nc, int *val);
int rtnl_netconf_get_ignore_routes_linkdown(struct rtnl_netconf *nc, int *val);
int rtnl_netconf_get_input(struct rtnl_netconf *nc, int *val);

#ifdef __cplusplus
}
#endif

#endif

0 comments on commit c8adb57

Please sign in to comment.