X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fpppd.h;h=936cc606f318f959dc21c135f5cab30f2a45a537;hb=2b6310fd24dba8e0fca8999916a162f0a1842a84;hp=cf9840a416bbd9a57098fdeb9d4d0c10bd8882d4;hpb=7e54469ed4f3c2ecc1006475dcd10df1d1fe35d3;p=ppp.git diff --git a/pppd/pppd.h b/pppd/pppd.h index cf9840a..936cc60 100644 --- a/pppd/pppd.h +++ b/pppd/pppd.h @@ -139,7 +139,7 @@ typedef struct { #define OPT_INITONLY 0x4000000 /* option can only be set in init phase */ #define OPT_DEVEQUIV 0x8000000 /* equiv to device name */ #define OPT_DEVNAM (OPT_INITONLY | OPT_DEVEQUIV) -#define OPT_A2PRINTER 0x10000000 /* *addr2 is a fn for printing option */ +#define OPT_A2PRINTER 0x10000000 /* *addr2 printer_func to print option */ #define OPT_A2STRVAL 0x20000000 /* *addr2 points to current string value */ #define OPT_NOPRINT 0x40000000 /* don't print this option at all */ @@ -199,6 +199,7 @@ struct epdisc { #define EPD_PHONENUM 5 typedef void (*notify_func) __P((void *, int)); +typedef void (*printer_func) __P((void *, char *, ...)); struct notifier { struct notifier *next; @@ -406,8 +407,7 @@ struct protent { /* Close the protocol */ void (*close) __P((int unit, char *reason)); /* Print a packet in readable form */ - int (*printpkt) __P((u_char *pkt, int len, - void (*printer) __P((void *, char *, ...)), + int (*printpkt) __P((u_char *pkt, int len, printer_func printer, void *arg)); /* Process a received data packet */ void (*datainput) __P((int unit, u_char *pkt, int len)); @@ -460,6 +460,21 @@ struct channel { extern struct channel *the_channel; +/* + * This structure contains environment variables that are set or unset + * by the user. + */ +struct userenv { + struct userenv *ue_next; + char *ue_value; /* value (set only) */ + bool ue_isset; /* 1 for set, 0 for unset */ + bool ue_priv; /* from privileged source */ + const char *ue_source; /* source name */ + char ue_name[1]; /* variable name */ +}; + +extern struct userenv *userenv_list; + /* * Prototypes. */ @@ -504,8 +519,8 @@ void tty_init __P((void)); /* Procedures exported from utils.c. */ void log_packet __P((u_char *, int, char *, int)); /* Format a packet and log it with syslog */ -void print_string __P((char *, int, void (*) (void *, char *, ...), - void *)); /* Format a string for output */ +void print_string __P((char *, int, printer_func, void *)); + /* Format a string for output */ int slprintf __P((char *, int, char *, ...)); /* sprintf++ */ int vslprintf __P((char *, int, char *, va_list)); /* vsprintf++ */ size_t strlcpy __P((char *, const char *, size_t)); /* safe strcpy */ @@ -691,7 +706,7 @@ void add_options __P((option_t *)); /* Add extra options */ void check_options __P((void)); /* check values after all options parsed */ int override_value __P((const char *, int, const char *)); /* override value if permitted by priority */ -void print_options __P((void (*) __P((void *, char *, ...)), void *)); +void print_options __P((printer_func, void *)); /* print out values of all options */ int parse_dotted_ip __P((char *, u_int32_t *));