| RT_IFA_ADD(9) | Kernel Developer's Manual | RT_IFA_ADD(9) |
rt_ifa_add,
rt_ifa_del, rt_ifa_addlocal,
rt_ifa_dellocal — add or
delete routing entries associated with an address
#include
<sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/route.h>
int
rt_ifa_add(struct ifaddr *ifa,
int flags, struct sockaddr *dst,
unsigned int rdomain);
int
rt_ifa_del(struct ifaddr *ifa,
int flags, struct sockaddr *dst,
unsigned int rdomain);
int
rt_ifa_addlocal(struct
ifaddr *ifa);
int
rt_ifa_dellocal(struct
ifaddr *ifa);
These functions create and delete routing entries required by the network stack and managed by the kernel.
rt_ifa_add()Connected routing entries represent routes to prefixes and
should be created with RTF_CLONING in
flags and the address of ifa
in dst. But for Point-to-Point interfaces,
connected routing entries represent routes to hosts and should be
created with RTF_HOST in
flags and the destination address in
dst. Connected routing entries have a priority of
RTP_CONNECTED.
rt_ifa_del()rt_ifa_addlocal()Local routing entries are used to not send packets destined to
a local address on the wire and instead redirect them to
lo(4). They have the lowest priority available,
RTP_LOCAL, and contain a special flag,
RTF_LOCAL, that can be checked to determine if
the address is configured on the system.
rt_ifa_dellocal()rt_ifa_add(),
rt_ifa_del(),
rt_ifa_addlocal(), and
rt_ifa_dellocal() can be called during autoconf,
from process context, or from interrupt context.
rt_ifa_add(),
rt_ifa_del(),
rt_ifa_addlocal(), and
rt_ifa_dellocal() will return
0 on success and the return value of
rtrequest(9) otherwise.
| February 13, 2019 | Debian |