jbuf.h File Reference

Definition of packet format and packet manipulation functions for the MultiServices PIC SDK. More...


Data Structures

struct  jbuf_svcs_hdr
 Jbuf svcs hdr to store metadata for MP-SDK Phase-2 services processing. More...
struct  jbuf
 Defines the packet format used for a zero-copy handoff between the kernel and user space. More...
struct  jbuf_svc_set_info_s
 Service set related information extracted from a jbuf. More...
struct  jbuf_per_cpu_usage_s
 Jbuf per cpu statistics. More...
struct  jbuf_per_pool_usage_s
 Jbuf per pool statistics. More...

Defines

#define JBUF_DATA_SIZE   2336
 The maximum amount of data, in bytes, that a large jbuf can hold.
#define MAX_JBUFS_PER_PACKET   5
 The maximum number of jbufs that are allowed in a packet.
#define JBUF_MAX_TOTAL_LEN   0xffff
 Maximum total length of a jbuf chain.
#define JBUF_MAX_SEND_LEN   9192
 Maximum total length of a jbuf chain that can be used for sending data.
#define JBUF_COPYALL   1000000000
 Copies the entire contents of a jbuf chain.
#define JBUF_FLAG_FREE   0x0001
#define JBUF_FLAG_XMIT_VRF   0x0002
#define JBUF_LOCAL_POOL   0x0004
 This flag is used to indicate jbuf from local pool.
#define JBUF_POOL   0x0004
#define JBUF_FLAG_FLOW_AFF   0x0008
#define JBUF_FLAG_OPQ_DATA   0x0010
#define JBUF_FLAG_INTF_MODE   0x0020
#define JBUF_FLAG_INVLD_SEQ_GRP   0x0040
#define JBUF_FLAG_REF_BUF   0x0080
#define JBUF_FLAG_CTRL_DESC   0x0100
#define JBUF_OBJ_CACHE   0x0200
#define JBUF_FLAG_XMIT_SUBUNIT   0x0400
#define JBUF_PAD_SIZE   1
#define JBUF_SVCS_HDR_SIZE   32
#define JBUF_SVCS_FLAG_DIR_FORWARD   0x0001
#define JBUF_SVCS_FLAG_DIR_REVERSE   0x0002
#define JBUF_SVCS_FLAG_FIRST_PKT   0x0004
#define JBUF_SVCS_FLAG_REXMIT_PKT   0x0008
#define JBUF_SVCS_FLAG_SKIP_PLUGINS_ON_REINJ   0x0010
#define jb_start_copyhdr   jb_flags
#define jb_end_copyhdr   jb_ctrl_prev
#define JBUF_SVC_TYPE_INTERFACE   0
#define JBUF_SVC_TYPE_NEXTHOP   1
#define jbuf_is_ctrl_desc(j)   ((j)->jb_flags & JBUF_FLAG_CTRL_DESC)
 Indicate whether a jbuf is a control jbuf or a normal data jbuf.
#define jbuf_to_d(j, t)
 Converts a jbuf pointer to a data pointer of the correct type.
#define jbuf_to_svcs_hdr(j, t)   ((t)((j)->jb_svcs_hdr))
 Converts the jbuf svcs header to a pointer of the correct type.
#define jbuf_total_len(j)
 Return total length of a jbuf chain.

Typedefs

typedef jbuf_svc_set_info_s jbuf_svc_set_info_t
 Service set related information extracted from a jbuf.
typedef jbuf_per_cpu_usage_s jbuf_per_cpu_usage_t
 Jbuf per cpu statistics.
typedef jbuf_per_pool_usage_s jbuf_per_pool_usage_t
 Jbuf per pool statistics.
typedef int(* jbuf_apply_func_t )(void *user_data, void *jbuf_data, u_int length)
 Function called from jbuf_apply to work on jbuf_data.

Functions

static uint16_t jbuf_particle_get_data_length (const struct jbuf *jb)
 This function returns the data length in the corresponding jbuf structure.
static uint16_t jbuf_get_flags (const struct jbuf *jb)
 This function returns the flags set in the corresponding jbuf structure.
static uint8_t jbuf_get_service_id (const struct jbuf *jb)
 This function returns the service type in the corresponding jbuf structure.
static uint8_t jbuf_get_pkt_direction (const struct jbuf *jb)
 This function returns the packet direction in the corresponding jbuf structure.
static uint32_t jbuf_get_rcv_vrf (const struct jbuf *jb)
 This function returns the receive vrf index for the corresponding jbuf structure.
static ifl_idx_t jbuf_get_rcvidx (const struct jbuf *jb)
 This function returns the logical interface index of the incoming interface for the corresponding jbuf structur.
static uint32_t jbuf_get_l5_hash (const struct jbuf *jb)
 This function returns the 5-way hash value of the packet for the corresponding jbuf structure.
static uint32_t jbuf_get_l3_hash (const struct jbuf *jb)
 This function returns the 3-way hash value of the packet for the corresponding jbuf structure.
static if_subunit_t jbuf_get_xmit_subunit (const struct jbuf *jb)
 This function returns the trasmit ms interface subunit in the corresponding jbuf structure.
static void jbuf_set_xmit_subunit (struct jbuf *jb, if_subunit_t xmit_subunit)
 This function sets the trasmit ms interface subunit in the corresponding jbuf structure.
static if_subunit_t jbuf_get_rcv_subunit (const struct jbuf *jb)
 This function returns the receive ms interface subunit in the corresponding jbuf structure.
static uint32_t jbuf_get_opq_data (const struct jbuf *jb)
 This function returns the application specific private data set in the service nexthop via the corresponding jbuf structure.
static uint64_t jbuf_get_hw_timestamp (const struct jbuf *jb)
 This function returns the hardware timestamp value of the packet for the corresponding jbuf structure.
static int jbuf_is_referenced (const struct jbuf *jb)
 Indicates whether a jbuf has more than one references.
char * jbuf_buffer_start (struct jbuf *jb)
 Locates the start of a jbuf data buffer from a jbuf pointer.
char * jbuf_buffer_end (struct jbuf *jb)
 Locates the end of a jbuf data buffer from a jbuf pointer.
void jbuf_align (struct jbuf *jb, int len, int align_size)
 Aligns jbuf data to the boundary defined by the align_size argument.
int jbuf_get_max_jbufs (void)
 Returns the maximum available jbufs in the system.
jbuf_per_cpu_usage_tjbuf_get_per_cpu_usage (void)
 Updates jbuf_per_cpu_usage[MSP_MAX_CPUS] to hold current usage details for each cpu.
jbuf_per_pool_usage_tjbuf_get_per_pool_usage (void)
 Updates jbuf_per_pool_usage to hold current usage details for each pool.
jbufjbuf_get (void)
 Allocates a jbuf.
jbufjbuf_get_chain (unsigned int len)
 Allocates a jbuf chain with the capacity specified by the len argument.
void jbuf_free (struct jbuf *jb)
 Frees all the jbufs in the chain from the starting point jb.
u_int jbuf_length (struct jbuf *jb, struct jbuf **last)
 Retrieves the total length of a jbuf.
u_int jbuf_update_total_len (struct jbuf *jb)
 Re-calculates the total length of a jbuf.
int jbuf_apply (struct jbuf *jb, int offset, int len, jbuf_apply_func_t f, void *arg)
 Applies a function on jbuf data.
int jbuf_copy_from_buf (struct jbuf *jb, int offset, int len, c_caddr_t cp)
 Copies data from a user buffer to a jbuf data buffer.
int jbuf_copy_to_buf (const struct jbuf *jb, int offset, int len, caddr_t cp)
 Copies data from a jbuf data buffer to the indicated user buffer.
jbufjbuf_copychain (struct jbuf *jb, int offset, int len)
 Makes a partial or full copy of a jbuf chain.
jbufjbuf_dup (struct jbuf *jb)
 Makes a full copy of a jbuf chain.
jbufjbuf_getptr (struct jbuf *jb, int loc, int *offset)
 Seeks a data pointer at a location with an offset defined by the loc argument.
int jbuf_get_svc_set_info (struct jbuf *jb, jbuf_svc_set_info_t *svc_set_info)
 Returns the consolidated service set information from the jbuf.
static u_int32_t jbuf_getvrf (struct jbuf *jb)
 Gets the VRF on which jbuf was received.
static void jbuf_setvrf (struct jbuf *jb, if_subunit_t vrf_id)
 Sets the VRF on a jbuf.
static uint16_t jbuf_particle_get_buf_size (struct jbuf *jb)
 Gets the buffer size of the jbuf particle.


Detailed Description

Definition of packet format and packet manipulation functions for the MultiServices PIC SDK.

This is the header file to be included by the users of the MultiServices PIC SDK library for the MP SDK packet format and packet manipulation definitions.

MultiServices PIC packets are composed of one or more basic data structures. The basic data structure is referred to as a jbuf. Data loops and FIFO queues use jbufs for transmission and reception of the packets, hence applications should use jbufs to transmit and receive packets. There is also a limit on the number of jbufs that can end up in a chain while being transmitted. A library assert guards this limit. The API users are therefore encouraged to use jbuf_defrag() before attempting to transmit the jbuf chains.


Define Documentation

#define JBUF_COPYALL   1000000000
 

Copies the entire contents of a jbuf chain.

Used by the jbuf copy functions.

#define JBUF_FLAG_FREE   0x0001
 

Warning:
The following macro is deprecated and will be removed in 10.2 release. It is recommended to use "jbuf_free" API instead of this macro.

#define jbuf_is_ctrl_desc  )     ((j)->jb_flags & JBUF_FLAG_CTRL_DESC)
 

Indicate whether a jbuf is a control jbuf or a normal data jbuf.

Control jbuf has no valid data.

#define jbuf_to_d j,
 ) 
 

Value:

(jbuf_is_ctrl_desc(j) ? (t)(((j)->jb_next)->jb_data): \
                            (t)((j)->jb_data))
Converts a jbuf pointer to a data pointer of the correct type.

Control jbuf do not

#define jbuf_total_len  ) 
 

Value:

(jbuf_is_ctrl_desc(j) ? (j)->jb_next->jb_total_len : \
                             (j)->jb_total_len)
Return total length of a jbuf chain.


Typedef Documentation

typedef int(* jbuf_apply_func_t)(void *user_data, void *jbuf_data, u_int length)
 

Function called from jbuf_apply to work on jbuf_data.

Parameters:
[in] user_data Pointer to application data passed from jbuf_apply
[in] jbuf_data Pointer to data in jbuf
[in] length Length of data in the jbuf
Returns:
JBUF_OK on success; otherwise relevant error code on failure

typedef struct jbuf_per_cpu_usage_s jbuf_per_cpu_usage_t
 

Jbuf per cpu statistics.

Warning:
The following typedef will be deprecated as per the SDK guidelines. jbuf_per_pool_usage_t may be used instead.

typedef struct jbuf_svc_set_info_s jbuf_svc_set_info_t
 

Service set related information extracted from a jbuf.

This structure represents the service set information which can be used by the applications to do their specific processing (typical use case will be policy/rule lookups).

For a given packet, applications should call the function jbuf_get_svc_set_info() to populate this structure.

The svc_id classifies the packet based on the service filter applied on the packet. The mon_svc field will indicate whether the packet is applied with monitoring service filter.


Function Documentation

void jbuf_align struct jbuf jb,
int  len,
int  align_size
 

Aligns jbuf data to the boundary defined by the align_size argument.

Sets the jb_data pointer of a newly allocated jbuf to place an object of the size specified by the len argument at the end of the jbuf. The pointer is aligned according to the boundary defined by the align_size argument.

Parameters:
[in] jb Pointer to a jbuf structure.
[in] len Size of the jbuf data in bytes.
[in] align_size Size of the alignment boundary in bytes.

int jbuf_apply struct jbuf jb,
int  offset,
int  len,
jbuf_apply_func_t  f,
void *  arg
 

Applies a function on jbuf data.

Function f is called with application data, jbuf data and the length of data in the jbuf as arguments. This function starts with offset inside the jbuf and continues calling function f until len bytes are passed.

This operation is not allowed on referenced jbuf.

Parameters:
[in] jb Pointer to jbuf structure.
[in] offset Offset, in bytes, inside the jbuf to start applying the function f
[in] len Number of bytes.
[in] f Function to apply on the jbuf data.
[in] arg Any application data to be passed to function f as the first argument.
Returns:
JBUF_OK on success; otherwise either the error returned by f, or the relevant jbuf error code:
  • JBUF_OFFSET_OUT_OF_BOUND - Offset not within jbuf's length.
  • JBUF_ERROR - Illegal offset(< 0) or len(< 0) passed.

char* jbuf_buffer_end struct jbuf jb  ) 
 

Locates the end of a jbuf data buffer from a jbuf pointer.

Parameters:
[in] jb Pointer to a jbuf structure.
Returns:
Pointer to the end of the jbuf data buffer.

char* jbuf_buffer_start struct jbuf jb  ) 
 

Locates the start of a jbuf data buffer from a jbuf pointer.

The start of the jbuf data buffer may be different the jb_data field, as jb_data may have been moved around inside the jbuf data buffer.

Parameters:
[in] jb Pointer to a jbuf structure.
Returns:
Pointer to the start of the jbuf data buffer.

int jbuf_copy_from_buf struct jbuf jb,
int  offset,
int  len,
c_caddr_t  cp
 

Copies data from a user buffer to a jbuf data buffer.

Copies data from a buffer into the indicated jbuf chain. The data is copied to a location from the beginning of the buffer specified by the offset argument. This function can extend the jbuf chain if necessary. This operation is not allowed on referenced jbuf.

Parameters:
[in] jb Pointer to jbuf structure.
[in] offset Starting point for the copy, offset in bytes from the start of the jbuf.
[in] len Number of bytes to copy.
[in] cp Pointer to user buffer from which to copy.
Returns:
JBUF_OK on success; otherwise the relevant jbuf error code:
  • JBUF_ARGUMENT_NULL - A NULL argument was passed.
  • JBUF_ERROR - Illegal offset(< 0) or len(< 0) passed or jbuf allocation failed while extending the chain or a referenced jbuf has been passed.

int jbuf_copy_to_buf const struct jbuf jb,
int  offset,
int  len,
caddr_t  cp
 

Copies data from a jbuf data buffer to the indicated user buffer.

The data is copied to a location from the beginning of the buffer specified by the offset argument.

Parameters:
[in] jb Pointer to a jbuf structure.
[in] offset Starting point for the copy, offset in bytes from the start of the jbuf.
[in] len Number of bytes to copy.
[in] cp Pointer to the user buffer to which to copy.
Returns:
JBUF_OK on success; otherwise a relevant jbuf error code:
  • JBUF_OFFSET_OUT_OF_BOUND - Offset not within jbuf's length.
  • JBUF_ARGUMENT_NULL - A NULL argument was passed.
  • JBUF_ERROR - Illegal offset(< 0) or len(< 0) passed.

struct jbuf* jbuf_copychain struct jbuf jb,
int  offset,
int  len
 

Makes a partial or full copy of a jbuf chain.

Copies data to a location from the beginning of the buffer specified by the offset argument. This function can extend the jbuf chain if necessary.

If the argument len is JBUF_COPYALL, the contents are copied until the end of the jbuf is reached.

Note:
Always use a variable different than the one passed as an argument, as these functions return a new jbuf(or a jbuf chain). As a result, overwriting the variable can result in a memory leak.
This operation is not allowed on referenced jbuf.

Parameters:
[in] jb Pointer to a jbuf structure.
[in] offset Starting point for the copy, offset in bytes from the start of the jbuf.
[in] len Number of bytes to copy.
Returns:
Pointer to a new jbuf chain on success; otherwise NULL.

struct jbuf* jbuf_dup struct jbuf jb  ) 
 

Makes a full copy of a jbuf chain.

An optimization of the common case jbuf_copychain(jb, 0, JBUF_COPYALL). This function preserves alignment of the first jbuf, so if the creator has left some room at the beginning (e.g. for inserting protocol headers), the copies will still have the space available.

Note:
Always use a variable different than the one passed as an argument, as these functions return a new jbuf(or a jbuf chain). As a result, overwriting the variable can result in a memory leak.
Parameters:
[in] jb Pointer to a jbuf structure.
Returns:
Pointer to a new jbuf chain on success; otherwise NULL.

void jbuf_free struct jbuf jb  ) 
 

Frees all the jbufs in the chain from the starting point jb.

Parameters:
[in] jb Pointer to the jbuf structure to free.

struct jbuf* jbuf_get void   ) 
 

Allocates a jbuf.

Returns:
Pointer to a jbuf on success; otherwise NULL.

struct jbuf* jbuf_get_chain unsigned int  len  ) 
 

Allocates a jbuf chain with the capacity specified by the len argument.

Allocates enough jbufs to hold at least len bytes, rounded up to JBUF_DATA_SIZE.

The following items apply to the jbuf_get_chain function:

  • The maximum length of a jbuf chain can never exceed 65535 bytes.
  • When given a length argument greater than or equal to 65535 bytes, the function will return NULL.
Parameters:
[in] len The length of the jbuf chain.
Returns:
Pointer to a jbuf on success; otherwise NULL.

static uint16_t jbuf_get_flags const struct jbuf jb  )  [inline, static]
 

This function returns the flags set in the corresponding jbuf structure.

The jbuf passed in jb must not be NULL.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
flags set in the jbuf

static uint64_t jbuf_get_hw_timestamp const struct jbuf jb  )  [inline, static]
 

This function returns the hardware timestamp value of the packet for the corresponding jbuf structure.

The jbuf passed in jb must not be NULL.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
hardware timestamp of the packet in the jbuf

static uint32_t jbuf_get_l3_hash const struct jbuf jb  )  [inline, static]
 

This function returns the 3-way hash value of the packet for the corresponding jbuf structure.

The jbuf passed in jb must not be NULL. More information about the hash can be found in msp_hash.h.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
3-way hash of the packet in the jbuf

static uint32_t jbuf_get_l5_hash const struct jbuf jb  )  [inline, static]
 

This function returns the 5-way hash value of the packet for the corresponding jbuf structure.

The jbuf passed in jb must not be NULL. More information about the hash can be found in msp_hash.h.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
5-way hash of the packet in the jbuf

int jbuf_get_max_jbufs void   ) 
 

Returns the maximum available jbufs in the system.

Returns:
Maximum available jbufs in the system.

static uint32_t jbuf_get_opq_data const struct jbuf jb  )  [inline, static]
 

This function returns the application specific private data set in the service nexthop via the corresponding jbuf structure.

The jbuf passed in jb must not be NULL.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
application specific opaque data in the jbuf

jbuf_per_cpu_usage_t* jbuf_get_per_cpu_usage void   ) 
 

Updates jbuf_per_cpu_usage[MSP_MAX_CPUS] to hold current usage details for each cpu.

Warning:
The following API will be deprecated as per the SDK guidelines. jbuf_get_per_pool_usage() may be used instead. This API attempts to distribute the jbufs amoung the datacpus evenly.
Returns:
Pointer to jbuf_per_cpu_usage[MSP_MAX_CPUS], which holds the usage details for each cpu.

jbuf_per_pool_usage_t* jbuf_get_per_pool_usage void   ) 
 

Updates jbuf_per_pool_usage to hold current usage details for each pool.

Returns:
Pointer to jbuf_per_pool_usage, which holds the usage details for each pool.

static uint8_t jbuf_get_pkt_direction const struct jbuf jb  )  [inline, static]
 

This function returns the packet direction in the corresponding jbuf structure.

The jbuf passed in jb must not be NULL.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
packet direction set in the jbuf

static if_subunit_t jbuf_get_rcv_subunit const struct jbuf jb  )  [inline, static]
 

This function returns the receive ms interface subunit in the corresponding jbuf structure.

The jbuf passed in jb must not be NULL.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
receive ms interface subunit in the jbuf

static uint32_t jbuf_get_rcv_vrf const struct jbuf jb  )  [inline, static]
 

This function returns the receive vrf index for the corresponding jbuf structure.

The jbuf passed in jb must not be NULL.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
received vrf index in the jbuf

static ifl_idx_t jbuf_get_rcvidx const struct jbuf jb  )  [inline, static]
 

This function returns the logical interface index of the incoming interface for the corresponding jbuf structur.

The jbuf passed in jb must not be NULL.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
subunit of the incoming interface in the jbuf

static uint8_t jbuf_get_service_id const struct jbuf jb  )  [inline, static]
 

This function returns the service type in the corresponding jbuf structure.

The jbuf passed in jb must not be NULL.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
service id set in the jbuf

int jbuf_get_svc_set_info struct jbuf jb,
jbuf_svc_set_info_t svc_set_info
 

Returns the consolidated service set information from the jbuf.

This function reads the various fields from the jbuf header and returns all the necessary information for the service set related processing.

Parameters:
[in] jb Pointer to a jbuf structure.
[out] svc_set_info The structure which defines the service set related information.
Returns:
JBUF_OK on success; otherwise the relevant jbuf error code:
  • JBUF_ARGUMENT_NULL - NULL arguments being passed to the function.

static if_subunit_t jbuf_get_xmit_subunit const struct jbuf jb  )  [inline, static]
 

This function returns the trasmit ms interface subunit in the corresponding jbuf structure.

The jbuf passed in jb must not be NULL.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
trasmit ms interface subunit in the jbuf

struct jbuf* jbuf_getptr struct jbuf jb,
int  loc,
int *  offset
 

Seeks a data pointer at a location with an offset defined by the loc argument.

Returns a pointer to a jbuf if loc is found inside any jbuf data in the chain. The offset argument defines the offset inside the returned jbuf where loc is present.

The returned jbuf pointer is part of the jbuf chain passed as the argument. As a result, it is important that you do not free the return pointer or operate on it in a way that can break the original chain. If you are done with the chain, free it entirely.

Parameters:
[in] jb Pointer to a jbuf structure.
[in] loc The location, in bytes, to seek inside a jbuf.
[out] offset Offset inside the returned jbuf if loc is found; otherwise undefined.
Returns:
Pointer to a jbuf if loc is found inside a jbuf; otherwise NULL.

static u_int32_t jbuf_getvrf struct jbuf jb  )  [inline, static]
 

Gets the VRF on which jbuf was received.

Returns the VRF on which the jbuf was received. VRF information is maintained only in the first jbuf of the packet. This routine should be called only on the first jbuf of the packet.

Parameters:
[in] jb Pointer to a jbuf structure.
Returns:
The VRF on which the jbuf was received.

static int jbuf_is_referenced const struct jbuf jb  )  [inline, static]
 

Indicates whether a jbuf has more than one references.

Parameters:
[in] jb Pointer to a jbuf structure.
Returns:
TRUE If jbuf has more than one references; otherwise returns FALSE.

u_int jbuf_length struct jbuf jb,
struct jbuf **  last
 

Retrieves the total length of a jbuf.

Parameters:
[in] jb Pointer to a jbuf structure.
[out] last The last jbuf pointer on success; otherwise NULL.
Returns:
Number of bytes contained in the jbuf chain.

static uint16_t jbuf_particle_get_buf_size struct jbuf jb  )  [inline, static]
 

Gets the buffer size of the jbuf particle.

Returns the buffer size of the jbuf particle. Each jbuf has its buffer size stored in jb_buf_size

Parameters:
[in] jb Pointer to a jbuf structure.
Returns:
The buffer size for the jbuf.

static uint16_t jbuf_particle_get_data_length const struct jbuf jb  )  [inline, static]
 

This function returns the data length in the corresponding jbuf structure.

The jbuf passed in jb must not be NULL.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
data length of the jbuf particle

static void jbuf_set_xmit_subunit struct jbuf jb,
if_subunit_t  xmit_subunit
[inline, static]
 

This function sets the trasmit ms interface subunit in the corresponding jbuf structure.

The jbuf passed in jb must not be NULL.

Parameters:
[in] jb Pointer to a jbuf structure
Returns:
trasmit ms interface subunit in the jbuf

static void jbuf_setvrf struct jbuf jb,
if_subunit_t  vrf_id
[inline, static]
 

Sets the VRF on a jbuf.

Note:
VRF information should be set only in the first jbuf of the packet.
Parameters:
[in] jb Pointer to a jbuf structure.
[in] vrf_id VRF to be set.

u_int jbuf_update_total_len struct jbuf jb  ) 
 

Re-calculates the total length of a jbuf.

This function travels the jbuf chain and updates the jb_total_len of the first jbuf.

Parameters:
[in] jb Pointer to a jbuf structure.
Returns:
Number of bytes contained in the jbuf chain.


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:24:47 2010 for libmp-sdk by Doxygen 1.4.5