summaryrefslogtreecommitdiff
path: root/pppd/pppd.h
diff options
context:
space:
mode:
authorJames Carlson <carlsonj@workingcode.com>2010-08-23 09:59:56 -0400
committerJames Carlson <carlsonj@workingcode.com>2010-08-23 09:59:56 -0400
commit2b6310fd24dba8e0fca8999916a162f0a1842a84 (patch)
tree0b88bf430fd00be60f2c9b44c8d682157235b5b5 /pppd/pppd.h
parentcab58617fd9d328029fffabc788020264b4fa91f (diff)
downloadppp-2b6310fd24dba8e0fca8999916a162f0a1842a84.tar.gz
Add set and reset options to control environment variables for scripts.
Diffstat (limited to 'pppd/pppd.h')
-rw-r--r--pppd/pppd.h27
1 files changed, 21 insertions, 6 deletions
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));
@@ -461,6 +461,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 *));