vrf_util_pub.h File Reference

Function protototypes and defines for virtual routing and forwarding APIs. More...


Functions

int vrf_getvrfnamebyindex (int instance, int af, char *vrf_name, size_t len)
 Gets the VRF routing instance name based upon the VRF index and protocol family.
int vrf_getindexbyifname (const char *ifname, int af)
 Gets the VRF routing instance index based upon the interface name and protocol family.
int vrf_getvrfnamebysocket (int s, char *name, size_t len)
 Gets the VRF routing instance name based upon the socket descriptor.
int vrf_getindexbyvrfname (const char *vrfname, const char *lrname, int af)
 Gets the VRF routing instance index based upon the VRF routing instance name.
int vrf_setsocketbyvrfname (int s, const char *vrfname, const char *lrname)
 Binds the socket with the VRF instance by the VRF name.
int vrf_setsocketbyifname (int s, const char *name)
 Binds the socket with the VRF instance by the interface name.
int vrf_setsocketbysocket (int dest_socket, int src_socket)
 Binds the destination socket with the VRF instance with which the source socket is bound.
int vrf_setsocketbylrname (int s, const char *lrname)
 Binds the socket with the logical router by the logical router name.
int vrf_getindexbylrname (const char *lrname)
 Gets the logical router ID by the logical router name.


Detailed Description

Function protototypes and defines for virtual routing and forwarding APIs.


Function Documentation

int vrf_getindexbyifname const char *  ifname,
int  af
 

Gets the VRF routing instance index based upon the interface name and protocol family.

Parameters:
[in] ifname A pointer to the interface name.
[in] af The address family.
Returns:
The VRF index.

int vrf_getindexbylrname const char *  lrname  ) 
 

Gets the logical router ID by the logical router name.

Parameters:
[in] lrname The logical router name.
Returns:
The logical router ID if the function is successful; if it fails, -1 is returned and the error code is saved in errno.

int vrf_getindexbyvrfname const char *  vrfname,
const char *  lrname,
int  af
 

Gets the VRF routing instance index based upon the VRF routing instance name.

Parameters:
[in] vrfname The VRF name.
[in] lrname The logical router name.
[in] af The address family.
Returns:
VRF index if the function is successful; if it fails, -1 is returned and the error code is saved in errno.

int vrf_getvrfnamebyindex int  instance,
int  af,
char *  vrf_name,
size_t  len
 

Gets the VRF routing instance name based upon the VRF index and protocol family.

Gets the size of the buffer for the routing instance name by passing NULL for the name and 0 for the length argument.

Parameters:
[in] instance The VRF routing instance index.
[in] af The address family.
[out] vrf_name A pointer to the buffer that contains the VRF name or NULL.
[in] len The length of the buffer pointed by vrf_name or 0.
Returns:
0 if the function is successful; if it fails, -1 is returned and the error code is saved in errno. If NULL is passed for vrf_name, the return value is the buffer length required for routing instance name.

int vrf_getvrfnamebysocket int  s,
char *  name,
size_t  len
 

Gets the VRF routing instance name based upon the socket descriptor.

Parameters:
[in] s The socket descriptor.
[out] name A pointer to the buffer that contains the VRF name.
[in] len The length of the buffer pointed to by name.
Returns:
0 if the function is successful; if it fails, -1 is returned and the error code is saved in errno.

int vrf_setsocketbyifname int  s,
const char *  name
 

Binds the socket with the VRF instance by the interface name.

Parameters:
[in] s The socket descriptor.
[in] name The interface name.
Returns:
0 if the function is successful; if it fails, -1 is returned and the error code is saved in errno.

int vrf_setsocketbylrname int  s,
const char *  lrname
 

Binds the socket with the logical router by the logical router name.

Parameters:
[in] s The socket descriptor.
[in] lrname The logical router name.
Returns:
0 if the function is successful; if it fails, -1 is returned and the error code is saved in errno.

int vrf_setsocketbysocket int  dest_socket,
int  src_socket
 

Binds the destination socket with the VRF instance with which the source socket is bound.

Parameters:
[in] dest_socket The destination socket descriptor.
[in] src_socket The source socket descriptor.
Returns:
0 if the function is successful; if it fails, -1 is returned and the error code is saved in errno.

int vrf_setsocketbyvrfname int  s,
const char *  vrfname,
const char *  lrname
 

Binds the socket with the VRF instance by the VRF name.

Parameters:
[in] s The socket descriptor.
[in] vrfname The VRF name.
[in] lrname The logical router name.
Returns:
0 if the function is successful; if it fails, -1 is returned and the error code is saved in errno.


2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:25:03 2010 for libvrfutil by Doxygen 1.4.5