dtypes.h File Reference

Typedefs and forward declarations. More...

#include <stdarg.h>
#include <sys/param.h>
#include <sys/types.h>
#include <string.h>
#include <jnx/aux_types.h>
#include <jnx/bits.h>
#include <jnx/daemon_info.h>
#include <ddl/defs.h>

Data Structures

struct  ddl_int_range_s
struct  ddl_uint_range_s
struct  ddl_string_range_s
struct  ddl_range_s

Defines

#define LINE_BUFSIZ   (4*1024)
#define UNUSED   __unused
#define LOG_CHANGE   LOG_LOCAL6
 From <syslog.h>.
#define LOG_INTERACTIVE   LOG_LOCAL7
 From <syslog.h>.
#define DDL_OID_COMMAND   ((ddl_oid_t) 0xFFFFFFFF)
 Constant oid for cmds.
#define INVALID_ATTRID   ((ddl_attrid_t) -1)
#define INVALID_NODEID   ((ddl_nodeid_t) -1)
#define REQ_BIT(bitnum)   BITT(ddl_require_t, bitnum)
 ddl_require_t: represents the permissions required to execute a command or modify a configuration variable.
#define REQ_NONE   0
 No privledges.
#define REQ_ADMIN   REQ_BIT(0)
 Can view user accounts.
#define REQ_ADMIN_CONTROL   REQ_BIT(1)
 Can modify user accounts.
#define REQ_CLEAR   REQ_BIT(2)
 Can clear learned network info.
#define REQ_CONFIGURE   REQ_BIT(3)
 Can enter configuration mode.
#define REQ_CONTROL   REQ_BIT(4)
 Can modify any config.
#define REQ_EDIT   REQ_BIT(5)
 Can edit full files.
#define REQ_FIELD   REQ_BIT(6)
 Special for field debug support.
#define REQ_FLOPPY   REQ_BIT(7)
 Can read and write the floppy.
#define REQ_INTERFACE   REQ_BIT(8)
 Can view interface config.
#define REQ_INTERFACE_CONTROL   REQ_BIT(9)
 Can modify interface config.
#define REQ_NETWORK   REQ_BIT(10)
 Can access the network.
#define REQ_RESET   REQ_BIT(11)
 Can reset/restart intf/daemons.
#define REQ_ROUTING   REQ_BIT(12)
 Can view routing config.
#define REQ_ROUTING_CONTROL   REQ_BIT(13)
 Can modify routing config.
#define REQ_SHELL   REQ_BIT(14)
 Can start a local shell.
#define REQ_SNMP   REQ_BIT(15)
 Can view SNMP config.
#define REQ_SNMP_CONTROL   REQ_BIT(16)
 Can modify SNMP config.
#define REQ_SYSTEM   REQ_BIT(17)
 Can view system config.
#define REQ_SYSTEM_CONTROL   REQ_BIT(18)
 Can modify system config.
#define REQ_TRACE   REQ_BIT(19)
 Can view trace file settings.
#define REQ_TRACE_CONTROL   REQ_BIT(20)
 Can modify trace file settings.
#define REQ_VIEW   REQ_BIT(21)
 Can view values and statistics.
#define REQ_WHEEL   REQ_BIT(22)
 Can become the super-user.
#define REQ_FIREWALL   REQ_BIT(23)
 Can view firewall settings.
#define REQ_FIREWALL_CONTROL   REQ_BIT(24)
 Can modify firewall settings.
#define REQ_SECRET   REQ_BIT(25)
 Can see secret statements.
#define REQ_SECRET_CONTROL   REQ_BIT(26)
 Can modify secret statements.
#define REQ_ROLLBACK   REQ_BIT(27)
 Can rollback n > 0.
#define REQ_SECURITY   REQ_BIT(28)
 Can mung [security].
#define REQ_SECURITY_CONTROL   REQ_BIT(29)
 Can mung [security].
#define REQ_ACCESS   REQ_BIT(30)
 Can mung [access].
#define REQ_ACCESS_CONTROL   REQ_BIT(31)
 Can mung [access].
#define REQ_VIEW_CONFIG   REQ_BIT(32)
 Can view all but secret config.
#define REQ_CONFIG   REQ_BIT(33)
 Can view some configuration.
#define REQ_CONFIG_CONTROL   REQ_BIT(34)
 Can modify some configuration.
#define REQ_FLOW_TAP   REQ_BIT(35)
 Can view flow-tap config.
#define REQ_FLOW_TAP_CONTROL   REQ_BIT(36)
 Can configure (but not run) flow-tap service.
#define REQ_FLOW_TAP_OP   REQ_BIT(37)
 Can tap flows, but cannot view or edit flow-tap config.
#define REQ_IDP_PROFILE_OP   REQ_BIT(38)
 Can collect idp profiler data.
#define REQ_PGCP_SESSION_MIRRORING   REQ_BIT(39)
 Can view pgcp LI.
#define REQ_PGCP_SESSION_MIRRORING_CONTROL   REQ_BIT(40)
 Can config pgcp LI.
#define NUM_REQUIRES   41
 Number of require bits.
#define REQ_ALL   (((ddl_require_t) -1) & ~REQ_FLOW_TAP_OP)
#define dnr_uint   dnr_u.dnr_uint
#define dnr_int   dnr_u.dnr_int
#define dnr_string   dnr_u.dnr_string
#define DDL_TOG_NO   "no-"
#define DDL_TOG_NO_LEN   3

Typedefs

typedef int ddl_boolean_t
 Our own type, to avoid collisions.
typedef ssize_t offset_t
 Offset inside structures.
typedef u_int32_t ddl_oid_t
 Object identifier.
typedef u_int32_t ddl_nodeid_t
 Node identifier.
typedef u_int16_t ddl_dbuid_t
 User identifier.
typedef u_int32_t ddl_refcnt_t
 Reference count.
typedef u_int8_t ddl_attrid_t
 Attribute identifier in general sense.
typedef ddl_attrid_t ddl_aid_t
 Attribute identifier in config database.
typedef u_int8_t * ddl_key_t
 Type of key.
typedef flag64_t ddl_require_t
 Physical storage for REQ_*.
typedef unsigned short ddl_type_t
 Physical storage for TYPE_*.
typedef unsigned long ddl_type_info_flag_t
 DTFAF_* flags.
typedef signed long long ddl_int_range_base_t
typedef unsigned long long ddl_uint_range_base_t
typedef unsigned int ddl_string_range_base_t
typedef ddl_int_range_s ddl_int_range_t
typedef ddl_uint_range_s ddl_uint_range_t
typedef ddl_string_range_s ddl_string_range_t
typedef ddl_range_s ddl_range_t
typedef unsigned long ddl_bitfield_t
typedef unsigned long ddl_dynamic_field_id_t

Enumerations

enum  ddl_type_enum {
  TYPE_NONE = 0, TYPE_SBYTE = 1, TYPE_SHORT = 2, TYPE_SINT = 3,
  TYPE_MAX_SIGNED = 3, TYPE_UBYTE = 4, TYPE_USHORT = 5, TYPE_UINT = 6,
  TYPE_MAX_INTEGRAL = 6, TYPE_STRING = 7, TYPE_OBJECT = 8, TYPE_COMMAND = 9,
  TYPE_ATTRIBUTE = 10, TYPE_SWITCH = 11, TYPE_CHOICE = 12, TYPE_ARGUMENT = 13,
  TYPE_DAEMON = 14, TYPE_FILENAME = 15, TYPE_CLIENT_FILENAME = 16, TYPE_HOSTNAME = 17,
  TYPE_IPADDR = 18, TYPE_SYSID = 19, TYPE_OBJREF = 20, TYPE_TOGGLE = 21,
  TYPE_INTERFACE_DEVICE = 22, TYPE_BITS = 23, TYPE_NEXT = 24, TYPE_ISOADDR = 25,
  TYPE_IPPREFIX = 26, TYPE_IPPREFIX_MANDATORY = 27, TYPE_INTERFACE_UNIT = 28, TYPE_IPADDR_OR_INTERFACE = 29,
  TYPE_AREAID = 30, TYPE_INTERFACE_NAME = 31, TYPE_COMMUNITY = 32, TYPE_INTERFACE_WILDCARD = 33,
  TYPE_UNREADABLE = 34, TYPE_IPPREFIX_OPTIONAL = 35, TYPE_POLICY_ALGEBRA = 36, TYPE_UINT64 = 37,
  TYPE_SINT64 = 38, TYPE_REGULAR_EXPRESSION = 39, TYPE_GROUP_GLOB = 40, TYPE_ATM_VCI = 41,
  TYPE_IPPREFIX_ONLY = 42, TYPE_IPV4ADDR = 43, TYPE_IPV4PREFIX = 44, TYPE_IPV4PREFIX_MANDATORY = 45,
  TYPE_IPV4ADDR_OR_INTERFACE = 46, TYPE_IPV4PREFIX_OPTIONAL = 47, TYPE_IPV4PREFIX_ONLY = 48, TYPE_IPV6ADDR = 49,
  TYPE_IPV6PREFIX = 50, TYPE_IPV6PREFIX_MANDATORY = 51, TYPE_IPV6ADDR_OR_INTERFACE = 52, TYPE_IPV6PREFIX_OPTIONAL = 53,
  TYPE_IPV6PREFIX_ONLY = 54, TYPE_INTERFACE_DEVICE_WILDCARD = 55, TYPE_INTERFACE_UNIT_WILDCARD = 56, TYPE_TIME = 57,
  TYPE_MAC_ADDR = 58, TYPE_MAC_ADDR_PREFIX = 59, TYPE_MAC_MULTICAST = 60, TYPE_MAC_MULTICAST_PREFIX = 61,
  TYPE_MAC_UNICAST = 62, TYPE_MAC_UNICAST_PREFIX = 63, TYPE_MPLS_LABEL = 64, TYPE_SFLOAT = 65,
  TYPE_UFLOAT = 66, TYPE_ISOPREFIX = 67, TYPE_ISOSYSID = 68, TYPE_STRING_HUGE = 69,
  TYPE_VARIABLE = 70, TYPE_GLOB_VARIABLE = 71, TYPE_VLAN_RANGE = 72, TYPE_INTERFACE_RANGE_WILD = 73,
  TYPE_FC_ADDR = 74, TYPE_WWN = 75, TYPE_LOGFILENAME = 76, NUM_TYPES = 77
}
 ddl_type_t: types we are capable of building. More...

Functions

 TYPEDEF (ddl_object_s, ddl_object_t)
 TYPEDEF (ddl_node_s, ddl_node_t)
 TYPEDEF (dbm_memory_s, dbm_memory_t)
 TYPEDEF (ddl_object_comment_s, ddl_object_comment_t)
 TYPEDEF (ddl_object_graft_path_s, ddl_object_graft_path_t)
 TYPEDEF (ddl_user_info_s, ddl_user_info_t)
 TYPEDEF (ddl_object_info_s, ddl_object_info_t)
 TYPEDEF (db_lr_info_s, db_lr_info_t)
 TYPEDEF (db_header_s, db_header_t)
 TYPEDEF (ddl_groups_s, ddl_groups_t)
 TYPEDEF (ddl_object_intf_range_path_s, ddl_object_intf_range_path_t)
 TYPEDEF (ddl_constraint_check_s, ddl_constraint_check_t)
 TYPEDEF (mgmt_peer_s, mgmt_peer_t)
 TYPEDEF (ddl_action_functions_s, ddl_action_functions_t)
 TYPEDEF (gram_data_s, gram_data_t)


Detailed Description

Typedefs and forward declarations.


Define Documentation

#define REQ_BIT bitnum   )     BITT(ddl_require_t, bitnum)
 

ddl_require_t: represents the permissions required to execute a command or modify a configuration variable.

This is a required set; a user with any of the required bits enabled will be enabled; req = REQ_OPER | REQ_RESET allows any user with either operator or reset privledges to perform the designated action. These low-level permissions will be collected into user classes, and defined in recorded in /etc/login.conf, and referenced by the user's login_class field. Of course, this all becomes configuration data and will have to be written based on the box's configuration data.

#define REQ_FLOW_TAP_OP   REQ_BIT(37)
 

Can tap flows, but cannot view or edit flow-tap config.

This is a special bit - REQ_ALL doesn't include this bit


Enumeration Type Documentation

enum ddl_type_enum
 

ddl_type_t: types we are capable of building.

Enumerator:
TYPE_NONE  No type.
TYPE_SBYTE  Signed integral values.
TYPE_MAX_SIGNED  Max signed value.
TYPE_UBYTE  Unsigned integral values.
TYPE_MAX_INTEGRAL  Max integral value.
TYPE_STRING  String values.
TYPE_OBJECT  Building a structure.
TYPE_COMMAND  Building a command.
TYPE_ATTRIBUTE  Generic attribute.
TYPE_SWITCH  Switch node.
TYPE_CHOICE  Child of switch and list.
TYPE_ARGUMENT  Argument to command.
TYPE_DAEMON  Choose from list of daemons.
TYPE_FILENAME  Local filename.
TYPE_CLIENT_FILENAME  Client filename.
TYPE_HOSTNAME  Hostname or network address.
TYPE_IPADDR  IP address *OR* hostname *OR* interface.
TYPE_SYSID  ISO sysid.
TYPE_OBJREF  Reference to another (user) object type.
TYPE_TOGGLE  Simple toggle boolean.
TYPE_INTERFACE_DEVICE  Physical interface device (no unit).
TYPE_BITS  Bit field.
TYPE_NEXT  A pointer to the next in a linked list.
TYPE_ISOADDR  ISO address.
TYPE_IPPREFIX  IP address[/prefix].
TYPE_IPPREFIX_MANDATORY  IP-address/prefix.
TYPE_INTERFACE_UNIT  Interface with optional unit number.
TYPE_IPADDR_OR_INTERFACE  IP address or interface.
TYPE_AREAID  OSPF area id.
TYPE_INTERFACE_NAME  interface name with optional everything
TYPE_COMMUNITY  BGP community name.
TYPE_INTERFACE_WILDCARD  Glob-style interface wildcarding.
TYPE_UNREADABLE  Unreadable (to humans).
TYPE_IPPREFIX_OPTIONAL  IP-address[/prefix] (not filled in).
TYPE_POLICY_ALGEBRA  Complex policy expressions.
TYPE_UINT64  Unsigned 64-bit integer.
TYPE_SINT64  Signed 64-bit integer.
TYPE_REGULAR_EXPRESSION  Extended regular expression.
TYPE_GROUP_GLOB  Configuration group glob-style pattern.
TYPE_ATM_VCI  ATM VCI value, cannot be 0.0.
TYPE_IPPREFIX_ONLY  IP prefix, mask host bits.
TYPE_IPV4ADDR  IP address *OR* hostname *OR* interface.
TYPE_IPV4PREFIX  IP address[/prefix].
TYPE_IPV4PREFIX_MANDATORY  IP-address/prefix.
TYPE_IPV4ADDR_OR_INTERFACE  IP address or interface.
TYPE_IPV4PREFIX_OPTIONAL  IP-address[/prefix] (not filled in).
TYPE_IPV4PREFIX_ONLY  IP prefix, mask host bits.
TYPE_IPV6ADDR  IP address *OR* hostname *OR* interface.
TYPE_IPV6PREFIX  IP address[/prefix].
TYPE_IPV6PREFIX_MANDATORY  IP-address/prefix.
TYPE_IPV6ADDR_OR_INTERFACE  IP address or interface.
TYPE_IPV6PREFIX_OPTIONAL  IP-address[/prefix] (not filled in).
TYPE_IPV6PREFIX_ONLY  IP prefix, mask host bits.
TYPE_INTERFACE_DEVICE_WILDCARD  Glob-style wildcarding on physical interface device (no unit).
TYPE_INTERFACE_UNIT_WILDCARD  Unit number or glob-style wildcard.
TYPE_TIME  Date/Time in form YYYYMMHH[.SS].
TYPE_MAC_ADDR  MAC Address XX.XX.XX.XX.XX.XX.
TYPE_MAC_ADDR_PREFIX  MAC Prefix XX.XX.XX.XX.XX.XX/PP.
TYPE_MAC_MULTICAST  MAC Multicast XX.XX.XX.XX.XX.XX.
TYPE_MAC_MULTICAST_PREFIX  MAC Multicast Prefix.
TYPE_MAC_UNICAST  MAC Unicast XX.XX.XX.XX.XX.XX.
TYPE_MAC_UNICAST_PREFIX  MAC Unicast Prefix.
TYPE_MPLS_LABEL  MPLS label.
TYPE_SFLOAT  signed floating point value
TYPE_UFLOAT  unsigned floating point value
TYPE_ISOPREFIX  iso prefix, iso address was a while back
TYPE_ISOSYSID  iso prefix, iso address was a while back
TYPE_STRING_HUGE  huge string data
TYPE_VARIABLE  dynamic variables
TYPE_GLOB_VARIABLE  glob or dynamic variables
TYPE_VLAN_RANGE  vlan range
TYPE_INTERFACE_RANGE_WILD  interface-ranges format
TYPE_FC_ADDR  Fibre-channel address XXX.XXX.XXX.
TYPE_WWN  World wide name XX:XX:XX:XX:XX:XX:XX:XX.
NUM_TYPES  Number of types.


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:19 2010 for libddl-access by Doxygen 1.4.5