babeld: remove some unused functions' arguments.

This commit is contained in:
Matthieu Boutier 2012-01-31 17:09:55 +01:00 committed by Paul Jakma
parent 73c74d4ee8
commit 53b21956f6

View File

@ -59,26 +59,20 @@ THE SOFTWARE.
static int static int
kernel_route_add_v4(const unsigned char *pref, unsigned short plen, kernel_route_add_v4(const unsigned char *pref, unsigned short plen,
const unsigned char *gate, int ifindex, unsigned int metric, const unsigned char *gate, int ifindex,
const unsigned char *newgate, int newifindex, unsigned int metric);
unsigned int newmetric);
static int static int
kernel_route_add_v6(const unsigned char *pref, unsigned short plen, kernel_route_add_v6(const unsigned char *pref, unsigned short plen,
const unsigned char *gate, int ifindex, unsigned int metric, const unsigned char *gate, int ifindex,
const unsigned char *newgate, int newifindex, unsigned int metric);
unsigned int newmetric);
static int static int
kernel_route_delete_v4(const unsigned char *pref, unsigned short plen, kernel_route_delete_v4(const unsigned char *pref, unsigned short plen,
const unsigned char *gate, int ifindex, const unsigned char *gate, int ifindex,
unsigned int metric, unsigned int metric);
const unsigned char *newgate, int newifindex,
unsigned int newmetric);
static int static int
kernel_route_delete_v6(const unsigned char *pref, unsigned short plen, kernel_route_delete_v6(const unsigned char *pref, unsigned short plen,
const unsigned char *gate, int ifindex, const unsigned char *gate, int ifindex,
unsigned int metric, unsigned int metric);
const unsigned char *newgate, int newifindex,
unsigned int newmetric);
int int
kernel_interface_operational(struct interface *interface) kernel_interface_operational(struct interface *interface)
@ -125,47 +119,29 @@ kernel_route(int operation, const unsigned char *pref, unsigned short plen,
switch (operation) { switch (operation) {
case ROUTE_ADD: case ROUTE_ADD:
return ipv4 ? return ipv4 ?
kernel_route_add_v4(pref, plen, gate, ifindex, metric, kernel_route_add_v4(pref, plen, gate, ifindex, metric):
newgate, newifindex, newmetric): kernel_route_add_v6(pref, plen, gate, ifindex, metric);
kernel_route_add_v6(pref, plen, gate, ifindex, metric,
newgate, newifindex, newmetric);
break; break;
case ROUTE_FLUSH: case ROUTE_FLUSH:
return ipv4 ? return ipv4 ?
kernel_route_delete_v4(pref, plen, gate, ifindex, metric, kernel_route_delete_v4(pref, plen, gate, ifindex, metric):
newgate, newifindex, newmetric): kernel_route_delete_v6(pref, plen, gate, ifindex, metric);
kernel_route_delete_v6(pref, plen, gate, ifindex, metric,
newgate, newifindex, newmetric);
break; break;
case ROUTE_MODIFY: case ROUTE_MODIFY:
if(newmetric == metric && memcmp(newgate, gate, 16) == 0 && if(newmetric == metric && memcmp(newgate, gate, 16) == 0 &&
newifindex == ifindex) newifindex == ifindex)
return 0; return 0;
debugf(BABEL_DEBUG_ROUTE, "Modify route: delete old; add new."); debugf(BABEL_DEBUG_ROUTE, "Modify route: delete old; add new.");
if (ipv4) { rc = ipv4 ?
kernel_route_delete_v4(pref, plen, kernel_route_delete_v4(pref, plen, gate, ifindex, metric):
gate, ifindex, metric, kernel_route_delete_v6(pref, plen, gate, ifindex, metric);
NULL, 0, 0);
} else { if (rc < 0)
kernel_route_delete_v6(pref, plen, return -1;
gate, ifindex, metric,
NULL, 0, 0);
}
rc = ipv4 ? rc = ipv4 ?
kernel_route_add_v4(pref, plen, kernel_route_add_v4(pref, plen, newgate, newifindex, newmetric):
newgate, newifindex, newmetric, kernel_route_add_v6(pref, plen, newgate, newifindex, newmetric);
NULL, 0, 0):
kernel_route_add_v6(pref, plen,
newgate, newifindex, newmetric,
NULL, 0, 0);
if(rc < 0) {
if(errno == EEXIST)
rc = 1;
/* In principle, we should try to re-install the flushed
route on failure to preserve. However, this should
hopefully not matter much in practice. */
}
return rc; return rc;
break; break;
@ -179,9 +155,7 @@ kernel_route(int operation, const unsigned char *pref, unsigned short plen,
static int static int
kernel_route_add_v4(const unsigned char *pref, unsigned short plen, kernel_route_add_v4(const unsigned char *pref, unsigned short plen,
const unsigned char *gate, int ifindex, unsigned int metric, const unsigned char *gate, int ifindex, unsigned int metric)
const unsigned char *newgate, int newifindex,
unsigned int newmetric)
{ {
unsigned int tmp_ifindex = ifindex; /* (for typing) */ unsigned int tmp_ifindex = ifindex; /* (for typing) */
struct zapi_ipv4 api; /* quagga's communication system */ struct zapi_ipv4 api; /* quagga's communication system */
@ -190,7 +164,7 @@ kernel_route_add_v4(const unsigned char *pref, unsigned short plen,
struct in_addr nexthop; /* next router to go */ struct in_addr nexthop; /* next router to go */
struct in_addr *nexthop_pointer = &nexthop; /* it's an array! */ struct in_addr *nexthop_pointer = &nexthop; /* it's an array! */
/* convert to be comprehensive by quagga */ /* convert to be understandable by quagga */
/* convert given addresses */ /* convert given addresses */
uchar_to_inaddr(&babel_prefix_addr, pref); uchar_to_inaddr(&babel_prefix_addr, pref);
uchar_to_inaddr(&nexthop, gate); uchar_to_inaddr(&nexthop, gate);
@ -222,9 +196,7 @@ kernel_route_add_v4(const unsigned char *pref, unsigned short plen,
static int static int
kernel_route_add_v6(const unsigned char *pref, unsigned short plen, kernel_route_add_v6(const unsigned char *pref, unsigned short plen,
const unsigned char *gate, int ifindex, unsigned int metric, const unsigned char *gate, int ifindex, unsigned int metric)
const unsigned char *newgate, int newifindex,
unsigned int newmetric)
{ {
unsigned int tmp_ifindex = ifindex; /* (for typing) */ unsigned int tmp_ifindex = ifindex; /* (for typing) */
struct zapi_ipv6 api; /* quagga's communication system */ struct zapi_ipv6 api; /* quagga's communication system */
@ -233,7 +205,7 @@ kernel_route_add_v6(const unsigned char *pref, unsigned short plen,
struct in6_addr nexthop; /* next router to go */ struct in6_addr nexthop; /* next router to go */
struct in6_addr *nexthop_pointer = &nexthop; struct in6_addr *nexthop_pointer = &nexthop;
/* convert to be comprehensive by quagga */ /* convert to be understandable by quagga */
/* convert given addresses */ /* convert given addresses */
uchar_to_in6addr(&babel_prefix_addr, pref); uchar_to_in6addr(&babel_prefix_addr, pref);
uchar_to_in6addr(&nexthop, gate); uchar_to_in6addr(&nexthop, gate);
@ -266,9 +238,7 @@ kernel_route_add_v6(const unsigned char *pref, unsigned short plen,
static int static int
kernel_route_delete_v4(const unsigned char *pref, unsigned short plen, kernel_route_delete_v4(const unsigned char *pref, unsigned short plen,
const unsigned char *gate, int ifindex, const unsigned char *gate, int ifindex,
unsigned int metric, unsigned int metric)
const unsigned char *newgate, int newifindex,
unsigned int newmetric)
{ {
unsigned int tmp_ifindex = ifindex; /* (for typing) */ unsigned int tmp_ifindex = ifindex; /* (for typing) */
struct zapi_ipv4 api; /* quagga's communication system */ struct zapi_ipv4 api; /* quagga's communication system */
@ -277,7 +247,7 @@ kernel_route_delete_v4(const unsigned char *pref, unsigned short plen,
struct in_addr nexthop; /* next router to go */ struct in_addr nexthop; /* next router to go */
struct in_addr *nexthop_pointer = &nexthop; /* it's an array! */ struct in_addr *nexthop_pointer = &nexthop; /* it's an array! */
/* convert to be comprehensive by quagga */ /* convert to be understandable by quagga */
/* convert given addresses */ /* convert given addresses */
uchar_to_inaddr(&babel_prefix_addr, pref); uchar_to_inaddr(&babel_prefix_addr, pref);
uchar_to_inaddr(&nexthop, gate); uchar_to_inaddr(&nexthop, gate);
@ -310,9 +280,7 @@ kernel_route_delete_v4(const unsigned char *pref, unsigned short plen,
static int static int
kernel_route_delete_v6(const unsigned char *pref, unsigned short plen, kernel_route_delete_v6(const unsigned char *pref, unsigned short plen,
const unsigned char *gate, int ifindex, const unsigned char *gate, int ifindex,
unsigned int metric, unsigned int metric)
const unsigned char *newgate, int newifindex,
unsigned int newmetric)
{ {
unsigned int tmp_ifindex = ifindex; /* (for typing) */ unsigned int tmp_ifindex = ifindex; /* (for typing) */
struct zapi_ipv6 api; /* quagga's communication system */ struct zapi_ipv6 api; /* quagga's communication system */
@ -321,7 +289,7 @@ kernel_route_delete_v6(const unsigned char *pref, unsigned short plen,
struct in6_addr nexthop; /* next router to go */ struct in6_addr nexthop; /* next router to go */
struct in6_addr *nexthop_pointer = &nexthop; struct in6_addr *nexthop_pointer = &nexthop;
/* convert to be comprehensive by quagga */ /* convert to be understandable by quagga */
/* convert given addresses */ /* convert given addresses */
uchar_to_in6addr(&babel_prefix_addr, pref); uchar_to_in6addr(&babel_prefix_addr, pref);
uchar_to_in6addr(&nexthop, gate); uchar_to_in6addr(&nexthop, gate);