summaryrefslogtreecommitdiffstats
path: root/if.h
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2015-02-26 13:22:41 +0000
committerRoy Marples <roy@marples.name>2015-02-26 13:22:41 +0000
commita19fe492027a50f1bb15f1754a74fcad242c8876 (patch)
treeda5547bed593c0f415dff3799a50a3844daab76f /if.h
parenta3fb51a3dd7a7809327e5d4c8c27a45a1a89197f (diff)
downloaddhcpcd-a19fe492027a50f1bb15f1754a74fcad242c8876.tar.xz
After adding an address load the kernel routing table for the interface.
When routes are rebuilt try not to remove any existing routes if they don't need changing.
Diffstat (limited to 'if.h')
-rw-r--r--if.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/if.h b/if.h
index b15f77b4..9f2aac09 100644
--- a/if.h
+++ b/if.h
@@ -31,23 +31,21 @@
#include <sys/socket.h>
#include <net/if.h>
+//#include <net/route.h>
#include <netinet/in.h>
-#include "config.h"
-#include "dhcpcd.h"
-#include "ipv4.h"
-#include "ipv6.h"
-
/* Some systems have route metrics */
#ifndef HAVE_ROUTE_METRIC
# if defined(__linux__) || defined(SIOCGIFPRIORITY)
# define HAVE_ROUTE_METRIC 1
# endif
-# ifndef HAVE_ROUTE_METRIC
-# define HAVE_ROUTE_METRIC 0
-# endif
#endif
+#include "config.h"
+#include "dhcpcd.h"
+#include "ipv4.h"
+#include "ipv6.h"
+
#define EUI64_ADDR_LEN 8
#define INFINIBAND_ADDR_LEN 20
@@ -102,6 +100,13 @@ int if_vimaster(const char *);
int if_openlinksocket(void);
int if_managelink(struct dhcpcd_ctx *);
+#ifndef RTM_ADD
+#define RTM_ADD 0x1 /* Add Route */
+#define RTM_DELETE 0x2 /* Delete Route */
+#define RTM_CHANGE 0x3 /* Change Metrics or flags */
+#define RTM_GET 0x4 /* Report Metrics */
+#endif
+
#ifdef INET
extern const char *if_pfname;
int if_openrawsocket(struct interface *, int);
@@ -117,10 +122,8 @@ int if_address(const struct interface *,
#define if_deladdress(ifp, addr, net) \
if_address(ifp, addr, net, NULL, -1)
-int if_route(const struct rt *rt, int);
-#define if_addroute(rt) if_route(rt, 1)
-#define if_chgroute(rt) if_route(rt, 0)
-#define if_delroute(rt) if_route(rt, -1)
+int if_route(unsigned char, const struct rt *rt, struct rt *);
+int if_initrt(struct interface *);
#endif
#ifdef INET6
@@ -140,10 +143,8 @@ int if_address6(const struct ipv6_addr *, int);
int if_addrflags6(const struct in6_addr *, const struct interface *);
int if_getlifetime6(struct ipv6_addr *);
-int if_route6(const struct rt6 *rt, int);
-#define if_addroute6(rt) if_route6(rt, 1)
-#define if_chgroute6(rt) if_route6(rt, 0)
-#define if_delroute6(rt) if_route6(rt, -1)
+int if_route6(unsigned char, const struct rt6 *rt, struct rt6 *);
+int if_initrt6(struct interface *);
#else
#define if_checkipv6(a, b, c) (-1)
#endif