parse_interface.h File Reference

General interface name parser APIs. More...


Data Structures

struct  intf_parm_
 Structure storing interface parameters. More...

Defines

#define ITEM_UNKNOWN   (-1)
 Not found in input string.
#define ITEM_ONEWILD   (-2)
 '?' wildcard
#define ITEM_ALLWILD   (-3)
 '*' wildcard
#define ITEM_RANGE   (-4)
#define VDCF_MAXCHASSISNAMELEN   128

Typedefs

typedef intf_parm_ intf_parm_t
 Structure storing interface parameters.

Functions

parse_retcode_t parse_interface (const char *str, unsigned ifflags, unsigned mask, intf_parm_t *intf_parms, char *errmsg, size_t errmsgsize)
 Deciphers the input string as an interface name and retrieves the various components of the name in the struct intf_parms, according to the flags/mask passed in.
parse_retcode_t parse_4_level_chassis (const char **str, char *chassis, size_t chassis_size, char *errmsg, size_t errmsgsize, size_t *len)


Detailed Description

General interface name parser APIs.


Typedef Documentation

typedef struct intf_parm_ intf_parm_t
 

Structure storing interface parameters.

Juniper's interface names are of the form: name_prefix - fpc / pic / port : channel . unit name_prefix port . unit controller abstraction added possibility of name_prefix - fpc / pic / port : channel : ... : channel . unit IFMAXCHANNELLEVEL of sub division is allowed


Function Documentation

parse_retcode_t parse_interface const char *  str,
unsigned  ifflags,
unsigned  mask,
intf_parm_t intf_parms,
char *  errmsg,
size_t  errmsgsize
 

Deciphers the input string as an interface name and retrieves the various components of the name in the struct intf_parms, according to the flags/mask passed in.

Note:
parse_interface() cannot be used to get slot/pic/port info for certain interfaces (eg rspX) that do not contain slot/pic/port as part of interface name.
Parameters:
[in] str Interface string to parse
[in] ifflags Interface flags
[in] mask Interface flags to mask
[out] intf_parms Interface parameters (FPC, PIC, port, channel, unit, etc.)
[out] errmsg When an error occurs, the error message is written here
[in] errmsgsize Size of the message buffer
Returns:
Status of parsing the string:
  • PARSE_OK on success
  • PARSE_ERR could not grok the string, likely invalid format
  • PARSE_ERR_RESTRICT string looks like an interface, but failed some restriction


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:23:40 2010 for libjuniper by Doxygen 1.4.5