Routing Netlink


Modules

 Addresses
 
1) Address Addition

 Links (Interfaces)
 
Link Identification
A link can be identified by either its interface index or by its name.

 Neighbours
 The neighbour table establishes bindings between protocol addresses and link layer addresses for hosts sharing the same physical link.
 Neighbour Tables
 Routing
 Routing Rules
 Traffic Control

Routing Type Translations

char * nl_rtntype2str (int type, char *buf, size_t size)
 Convert routing type to character string.
int nl_str2rtntype (const char *name)
 Convert character string to routing type.

Scope Translations

char * rtnl_scope2str (int scope, char *buf, size_t size)
 Convert scope identifier to character string.
int rtnl_str2scope (const char *name)
 Convert character string to scope identifier.

Sending

int nl_rtgen_request (struct nl_handle *handle, int type, int family, int flags)
 Send routing netlink request message.

Realms Translations

char * rtnl_realms2str (uint32_t realms, char *buf, size_t len)

Realms

#define RTNL_REALM_MASK   (0xFFFF)
 Mask specying the size of each realm part.
#define RTNL_REALM_FROM(realm)   ((realm) >> 16)
 Extract FROM realm from a realms field.
#define RTNL_REALM_TO(realm)   ((realm) & RTNL_REALM_MASK)
 Extract TO realm from a realms field.
#define RTNL_MAKE_REALM(from, to)   ((RTNL_REALM_TO(from) << 16) & RTNL_REALM_TO(to))
 Build a realms field.
typedef uint32_t realm_t
 Mask specying the size of each realm part.


Define Documentation

#define RTNL_REALM_MASK   (0xFFFF)

Mask specying the size of each realm part.

Definition at line 28 of file rtnl.h.

#define RTNL_REALM_FROM ( realm   )     ((realm) >> 16)

Extract FROM realm from a realms field.

Definition at line 33 of file rtnl.h.

Referenced by rtnl_realms2str().

#define RTNL_REALM_TO ( realm   )     ((realm) & RTNL_REALM_MASK)

Extract TO realm from a realms field.

Definition at line 38 of file rtnl.h.

Referenced by rtnl_realms2str().

#define RTNL_MAKE_REALM ( from,
to   )     ((RTNL_REALM_TO(from) << 16) & RTNL_REALM_TO(to))

Build a realms field.

Definition at line 43 of file rtnl.h.


Typedef Documentation

typedef uint32_t realm_t

Mask specying the size of each realm part.

Definition at line 22 of file rtnl.h.


Function Documentation

int nl_rtgen_request ( struct nl_handle *  handle,
int  type,
int  family,
int  flags 
)

Send routing netlink request message.

Parameters:
handle Netlink handle.
type Netlink message type.
family Address family.
flags Additional netlink message flags.
Fills out a routing netlink request message and sends it out using nl_send_simple().

Returns:
0 on success or a negative error code.

Definition at line 39 of file rtnl.c.

References nl_send_simple(), and rtgenmsg::rtgen_family.

char* nl_rtntype2str ( int  type,
char *  buf,
size_t  size 
)

Convert routing type to character string.

Parameters:
type Routing type.
buf Destination buffer.
size Size of destination buffer.
Converts a routing type to a character string and stores it in the specified destination buffer.

Returns:
The destination buffer or the type encoded in hexidecimal form if the routing type is unknown.

Definition at line 82 of file rtnl.c.

int nl_str2rtntype ( const char *  name  ) 

Convert character string to routing type.

Parameters:
name Name of routing type.
Converts the provided character string specifying a routing type to the corresponding numeric value.

Returns:
Routing type or a negative value if no match was found.

Definition at line 96 of file rtnl.c.

char* rtnl_scope2str ( int  scope,
char *  buf,
size_t  size 
)

Convert scope identifier to character string.

Parameters:
scope Scope identifier.
buf Destination buffer
size Size of destination buffer.
Converts a scope identifier to a character string and stores it in the specified destination buffer.

Returns:
The destination buffer or the type encoded in hexidecimal form if the scope identifier is unknown.

Definition at line 128 of file rtnl.c.

int rtnl_str2scope ( const char *  name  ) 

Convert character string to scope identifier.

Parameters:
name Name of scope.
Converts the provided character string specifying a scope identifier to the corresponding numeric value.

Returns:
Scope identifier or a negative value if no match was found.

Definition at line 142 of file rtnl.c.


Generated on Fri Apr 27 14:14:08 2007 for libnl by  doxygen 1.5.1