[Olsr-cvs] olsrd-current/src/linux kernel_routes.c,1.30,1.31
Bernd Petrovitsch
(spam-protected)
Mon Nov 12 00:10:26 CET 2007
Update of /cvsroot/olsrd/olsrd-current/src/linux
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10534/src/linux
Modified Files:
kernel_routes.c
Log Message:
* const'ified olsr_ioctl_{add,del}_route{,6}()
There are probably a few "const" missing for win32 and BSD.
* const'ified moer parameters in many more functions in the .h and
.c files
* init-functions with constant or ignored return values are "void"
* created a typedef fro the callback in "struct export_route_entry"
and using it!
* moved the initilaization of the {add,chg,del}_kernel_list variables
into process_routes.c. So they are now "static" there.
* olsr_export_{add,del}_route{,6} are now static in process_routes.c
since they are not used elsewhere.
* olsr_addroute_add_function() and olsr_deldroute_add_function() were
almost identical - made one function out of it.
Same for olsr_addroute_del_function() and olsr_deldroute_del_function().
* factored out common code
* fixed the sort order in avl_comp_ipv4_prefix(): We compare now the IPv4
values in host byte order (and not network byte order). So the route
list in the e.g. httpinfo plugin is now nicely sorted.
Index: kernel_routes.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/linux/kernel_routes.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** kernel_routes.c 8 Nov 2007 22:47:42 -0000 1.30
--- kernel_routes.c 11 Nov 2007 23:10:23 -0000 1.31
***************
*** 62,66 ****
};
! static void olsr_netlink_addreq(struct olsr_rtreq *req, int type, void *data, int len)
{
struct rtattr *rta = (struct rtattr*)(((char*)req) + NLMSG_ALIGN(req->n.nlmsg_len));
--- 62,66 ----
};
! static void olsr_netlink_addreq(struct olsr_rtreq *req, int type, const void *data, int len)
{
struct rtattr *rta = (struct rtattr*)(((char*)req) + NLMSG_ALIGN(req->n.nlmsg_len));
***************
*** 72,76 ****
}
! static int olsr_netlink_route(struct rt_entry *rt, olsr_u8_t family, olsr_u8_t rttable, __u16 cmd)
{
int ret = 0;
--- 72,76 ----
}
! static int olsr_netlink_route(const struct rt_entry *rt, olsr_u8_t family, olsr_u8_t rttable, __u16 cmd)
{
int ret = 0;
***************
*** 89,93 ****
};
olsr_u32_t metric = 1;
! struct rt_nexthop* nexthop = (RTM_NEWROUTE == cmd) ?
&rt->rt_best->rtp_nexthop : &rt->rt_nexthop;
--- 89,93 ----
};
olsr_u32_t metric = 1;
! const struct rt_nexthop* nexthop = (RTM_NEWROUTE == cmd) ?
&rt->rt_best->rtp_nexthop : &rt->rt_nexthop;
***************
*** 174,178 ****
*/
int
! olsr_ioctl_add_route(struct rt_entry *rt)
{
#if !LINUX_POLICY_ROUTING
--- 174,178 ----
*/
int
! olsr_ioctl_add_route(const struct rt_entry *rt)
{
#if !LINUX_POLICY_ROUTING
***************
*** 253,257 ****
*/
int
! olsr_ioctl_add_route6(struct rt_entry *rt)
{
#if !LINUX_POLICY_ROUTING
--- 253,257 ----
*/
int
! olsr_ioctl_add_route6(const struct rt_entry *rt)
{
#if !LINUX_POLICY_ROUTING
***************
*** 305,309 ****
*/
int
! olsr_ioctl_del_route(struct rt_entry *rt)
{
#if !LINUX_POLICY_ROUTING
--- 305,309 ----
*/
int
! olsr_ioctl_del_route(const struct rt_entry *rt)
{
#if !LINUX_POLICY_ROUTING
***************
*** 372,376 ****
*/
int
! olsr_ioctl_del_route6(struct rt_entry *rt)
{
#if !LINUX_POLICY_ROUTING
--- 372,376 ----
*/
int
! olsr_ioctl_del_route6(const struct rt_entry *rt)
{
#if !LINUX_POLICY_ROUTING
More information about the Olsr-cvs
mailing list