OpenBSD manual page server

Manual Page Search Parameters

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

routekernel routing interface

#include <net/route.h>

struct rtentry *
rt_lookup(struct sockaddr *dst, struct sockaddr *mask, u_int tableid);

int
rt_setgate(struct rtentry *rt0, struct sockaddr *dst, struct sockaddr *gate, u_int tableid);

void
rtredirect(struct sockaddr *dst, struct sockaddr *gateway, struct sockaddr *netmask, int flags, struct sockaddr *src, struct rtentry **rtp, u_int rdomain);

int
rtdeletemsg(struct rtentry *rt, u_int tableid);

Routing entries describe the routes to be taken by packets in a router.

(struct sockaddr *dst, struct sockaddr *mask, u_int tableid)
Return pointer to routing entry corresponding to address dst with a mask of mask from table tableid.
(struct rtentry *rt0, struct sockaddr *dst, struct sockaddr *gate, u_int tableid)
Set the address of the gateway for routes described by rt0 to gateway. If memory must be allocated to hold the gateway address, the address for which rt0 describes routes will be copied from dst.
(struct sockaddr *dst, struct sockaddr *gateway, struct sockaddr *netmask, int flags, struct sockaddr *src, struct rtentry **rtp, u_int rdomain)
Redirect routes to dst through gateway, such as in response to an ICMP redirect message. src should be the address from which the redirect message was received. If rtp is not NULL, it will be populated by the routing entry corresponding to dst.
(struct rtentry *rt, u_int tableid)
Delete routing table entry rt from table tableid and forward a notification message to all AF_ROUTE sockets.

rt_setgate() may fail with:

[ENOBUFS]
Memory could not be allocated for the gateway.

rtdeletemsg() may fail with:

[EAFNOSUPPORT]
The protocol used by rt is not supported by table with ID tableid.
[ESRCH]
No routing entry for rt could be found.
[ESRCH]
rt is a multipath routing entry that conflicts with an existing one.

route(4), route(8), rt_timer_add(9), rtable_add(9), rtlabel_id2name(9), rtrequest1(9)

December 19, 2014 OpenBSD-5.7