getbootpent.3x (2010 09)

g
getbootpent(3X) getbootpent(3X)
NAME
getbootpent(), putbootpent(), setbootpent(), endbootpent(), parse_bp_htype(), parse_bp_haddr(),
parse_bp_iaddr() - get or put bootptab entry
SYNOPSIS
#include <bootpent.h>
int getbootpent (struct bootpent **bootpent);
int setbootpent (const char *path);
int endbootpent (void);
int putbootpent (
struct bootpent *bootpent,
int numfields,
FILE * bootpfile
);
int parse_bp_htype (const char *source);
int parse_bp_haddr (
char **source,
int htype,
unsigned char *result,
unsigned int *bytes
);
int parse_bp_iaddr (
char **source,
unsigned long *result
);
Remarks
These functions reside in libdc.a, and are linked using the -ldc option to the ld or cc
command.
DESCRIPTION
These functions help a program read or modify a bootptab (
bootpd control) file one entry at a time.
getbootpent() locates an entry in the
/etc/bootptab file, or an alternate file specified to set-
bootpent(), and returns a pointer to an array of objects of type struct bootpent that breaks the
entry into separate data fields with preceding, or embedded, comment (text) lines.
The
bootpent structure is defined in <bootpent.h> and includes the following members:
int bp_type; /* BP_DATA, BP_COMMENT, BP_BLANK */
char *bp_text; /* one field or one comment line */
The file also defines the following data type and constants:
typedef struct bootpent *bpp_t;
#define BP_NULLP ((bpp_t) 0)
#define BP_SIZE (sizeof (struct bootpent))
#define MAXHADDRLEN 6
#define HTYPE_UNKNOWN 0 /* 0 bytes */
#define HTYPE_ETHERNET 1 /* 6 bytes */
#define HTYPE_EXP_ETHERNET 2 /* 1 byte */
#define HTYPE_AX25 3 /* 0 bytes */
#define HTYPE_PRONET 4 /* 1 byte */
#define HTYPE_CHAOS 5 /* 0 bytes */
#define HTYPE_IEEE802 6 /* 6 bytes */
#define HTYPE_ARCNET 7 /* 0 bytes */
#define MAXHTYPES 7
The fields are described in the Field Definitions section below. The purpose of each function is as follows.
getbootpent() When first called, getbootpent() returns a pointer to, and the number of
elements in, an array of bootpent structures. The array holds the first
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1