summaryrefslogtreecommitdiffstats
path: root/babeld/kernel.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-06-18 19:42:21 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2018-08-11 19:58:23 +0200
commite8c8f2e064c674d1c0935aaf04091c97e117c62f (patch)
treee33a7d2bcb9fea438ec351e70fdceb8ba78079e3 /babeld/kernel.h
parenttests: Cleanup assumption that ALLOC could fail. (diff)
downloadfrr-e8c8f2e064c674d1c0935aaf04091c97e117c62f.tar.xz
frr-e8c8f2e064c674d1c0935aaf04091c97e117c62f.zip
babeld: Use enum instead of #defines for kernel route type information
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'babeld/kernel.h')
-rw-r--r--babeld/kernel.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/babeld/kernel.h b/babeld/kernel.h
index eb1e79327..5b1437ef3 100644
--- a/babeld/kernel.h
+++ b/babeld/kernel.h
@@ -29,17 +29,19 @@ THE SOFTWARE.
#define KERNEL_INFINITY 0xFFFF
-#define ROUTE_FLUSH 0
-#define ROUTE_ADD 1
-#define ROUTE_MODIFY 2
+enum babel_kernel_routes {
+ ROUTE_FLUSH,
+ ROUTE_ADD,
+ ROUTE_MODIFY,
+};
int kernel_interface_operational(struct interface *interface);
int kernel_interface_mtu(struct interface *interface);
int kernel_interface_wireless(struct interface *interface);
-int kernel_route(int operation, const unsigned char *dest, unsigned short plen,
- const unsigned char *gate, int ifindex, unsigned int metric,
- const unsigned char *newgate, int newifindex,
- unsigned int newmetric);
+int kernel_route(enum babel_kernel_routes operation, const unsigned char *dest,
+ unsigned short plen, const unsigned char *gate, int ifindex,
+ unsigned int metric, const unsigned char *newgate,
+ int newifindex, unsigned int newmetric);
int if_eui64(int ifindex, unsigned char *eui);
int gettime(struct timeval *tv);
int read_random_bytes(void *buf, size_t len);