OpenBSD manual page server

Manual Page Search Parameters

RTALLOC(9) Kernel Developer's Manual RTALLOC(9)

rtalloc, rtalloc_mpath, rtfreerouting entry interface

#include <sys/types.h>
#include <sys/socket.h>
#include <net/route.h>

struct rtentry *
rtalloc(struct sockaddr *dst, int flags, unsigned int rtableid);

struct rtentry *
rtalloc_mpath(struct sockaddr *dst, uint32_t *src, unsigned int rtableid);

void
rtfree(struct rtentry *rt);

The () function looks in the routing table rtableid for an entry matching dst. The following flags can be specified:

Notify the routing sockets if the lookup fails.
Allocate and return a cloned entry for dst if it does not exist and the lookup returned a cloning entry.

The () function does the same as rtalloc() with the RT_REPORT and RT_RESOLVE flags, but selects a multipath routing entry corresponding to src when possible.

The () function releases a reference to the routing entry rt, freeing it if the reference count drops to 0.

rtalloc(), rtalloc_mpath(), and rtfree() can be called during autoconf, from process context, or from interrupt context.

route(4), rtrequest1(9)

December 5, 2014 OpenBSD-5.7