Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route.c
Show All 33 Lines | |||||
/************************************************************************ | /************************************************************************ | ||||
* Note: In this file a 'fib' is a "forwarding information base" * | * Note: In this file a 'fib' is a "forwarding information base" * | ||||
* Which is the new name for an in kernel routing (next hop) table. * | * Which is the new name for an in kernel routing (next hop) table. * | ||||
***********************************************************************/ | ***********************************************************************/ | ||||
#include "opt_inet.h" | #include "opt_inet.h" | ||||
#include "opt_inet6.h" | #include "opt_inet6.h" | ||||
#include "opt_mrouting.h" | #include "opt_mrouting.h" | ||||
#include "opt_mpath.h" | |||||
#include "opt_route.h" | #include "opt_route.h" | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mbuf.h> | #include <sys/mbuf.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
▲ Show 20 Lines • Show All 791 Lines • ▼ Show 20 Lines | rt_mpath_unlink(struct rib_head *rnh, struct rt_addrinfo *info, | ||||
*/ | */ | ||||
if (rt_mpath_deldup(rto, rt) == 0) | if (rt_mpath_deldup(rto, rt) == 0) | ||||
panic ("rtrequest1: rt_mpath_deldup"); | panic ("rtrequest1: rt_mpath_deldup"); | ||||
*perror = 0; | *perror = 0; | ||||
rn = (struct radix_node *)rt; | rn = (struct radix_node *)rt; | ||||
return (rn); | return (rn); | ||||
} | } | ||||
#endif | #endif | ||||
void | |||||
rt_setmetrics(const struct rt_addrinfo *info, struct rtentry *rt) | |||||
{ | |||||
if (info->rti_mflags & RTV_WEIGHT) | |||||
rt->rt_weight = info->rti_rmx->rmx_weight; | |||||
/* Kernel -> userland timebase conversion. */ | |||||
if (info->rti_mflags & RTV_EXPIRE) | |||||
rt->rt_expire = info->rti_rmx->rmx_expire ? | |||||
info->rti_rmx->rmx_expire - time_second + time_uptime : 0; | |||||
} | |||||
void | void | ||||
rt_maskedcopy(struct sockaddr *src, struct sockaddr *dst, struct sockaddr *netmask) | rt_maskedcopy(struct sockaddr *src, struct sockaddr *dst, struct sockaddr *netmask) | ||||
{ | { | ||||
u_char *cp1 = (u_char *)src; | u_char *cp1 = (u_char *)src; | ||||
u_char *cp2 = (u_char *)dst; | u_char *cp2 = (u_char *)dst; | ||||
u_char *cp3 = (u_char *)netmask; | u_char *cp3 = (u_char *)netmask; | ||||
u_char *cplim = cp2 + *cp3; | u_char *cplim = cp2 + *cp3; | ||||
▲ Show 20 Lines • Show All 290 Lines • Show Last 20 Lines |