mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-04-18 05:42:22 +00:00
more and more ppp options removal
This commit is contained in:
parent
b88dad4034
commit
42827cdea2
@ -140,9 +140,11 @@ int auth_done[NUM_PPP];
|
|||||||
/* List of addresses which the peer may use. */
|
/* List of addresses which the peer may use. */
|
||||||
static struct permitted_ip *addresses[NUM_PPP];
|
static struct permitted_ip *addresses[NUM_PPP];
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
/* Wordlist giving addresses which the peer may use
|
/* Wordlist giving addresses which the peer may use
|
||||||
without authenticating itself. */
|
without authenticating itself. */
|
||||||
static struct wordlist *noauth_addrs;
|
static struct wordlist *noauth_addrs;
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
/* Remote telephone number, if available */
|
/* Remote telephone number, if available */
|
||||||
char remote_number[MAXNAMELEN];
|
char remote_number[MAXNAMELEN];
|
||||||
@ -150,8 +152,10 @@ char remote_number[MAXNAMELEN];
|
|||||||
/* Wordlist giving remote telephone numbers which may connect. */
|
/* Wordlist giving remote telephone numbers which may connect. */
|
||||||
static struct wordlist *permitted_numbers;
|
static struct wordlist *permitted_numbers;
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
/* Extra options to apply, from the secrets file entry for the peer. */
|
/* Extra options to apply, from the secrets file entry for the peer. */
|
||||||
static struct wordlist *extra_options;
|
static struct wordlist *extra_options;
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
/* Number of network protocols which we have opened. */
|
/* Number of network protocols which we have opened. */
|
||||||
static int num_np_open;
|
static int num_np_open;
|
||||||
@ -159,8 +163,10 @@ static int num_np_open;
|
|||||||
/* Number of network protocols which have come up. */
|
/* Number of network protocols which have come up. */
|
||||||
static int num_np_up;
|
static int num_np_up;
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
/* Set if we require authentication only because we have a default route. */
|
/* Set if we require authentication only because we have a default route. */
|
||||||
static bool default_auth;
|
static bool default_auth;
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
/* Hook to enable a plugin to control the idle time limit */
|
/* Hook to enable a plugin to control the idle time limit */
|
||||||
int (*idle_time_hook) __P((struct ppp_idle *)) = NULL;
|
int (*idle_time_hook) __P((struct ppp_idle *)) = NULL;
|
||||||
@ -254,12 +260,12 @@ static void free_wordlist __P((struct wordlist *));
|
|||||||
static void set_allowed_addrs __P((int, struct wordlist *, struct wordlist *));
|
static void set_allowed_addrs __P((int, struct wordlist *, struct wordlist *));
|
||||||
#endif /* UNUSED */
|
#endif /* UNUSED */
|
||||||
static int some_ip_ok __P((struct wordlist *));
|
static int some_ip_ok __P((struct wordlist *));
|
||||||
|
#if 0 /* UNUSE */
|
||||||
static int setupapfile __P((char **));
|
static int setupapfile __P((char **));
|
||||||
static int privgroup __P((char **));
|
static int privgroup __P((char **));
|
||||||
static int set_noauth_addr __P((char **));
|
static int set_noauth_addr __P((char **));
|
||||||
static int set_permitted_number __P((char **));
|
static int set_permitted_number __P((char **));
|
||||||
static void check_access __P((FILE *, char *));
|
static void check_access __P((FILE *, char *));
|
||||||
#if 0 /* UNUSED */
|
|
||||||
static int wordlist_count __P((struct wordlist *));
|
static int wordlist_count __P((struct wordlist *));
|
||||||
#endif /* UNUSED */
|
#endif /* UNUSED */
|
||||||
|
|
||||||
@ -406,6 +412,7 @@ option_t auth_options[] = {
|
|||||||
};
|
};
|
||||||
#endif /* PPP_OPTIONS */
|
#endif /* PPP_OPTIONS */
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
/*
|
/*
|
||||||
* setupapfile - specifies UPAP info for authenticating with peer.
|
* setupapfile - specifies UPAP info for authenticating with peer.
|
||||||
*/
|
*/
|
||||||
@ -469,7 +476,6 @@ setupapfile(argv)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* privgroup - allow members of the group to have privileged access.
|
* privgroup - allow members of the group to have privileged access.
|
||||||
*/
|
*/
|
||||||
@ -538,7 +544,7 @@ set_permitted_number(argv)
|
|||||||
permitted_numbers = wp;
|
permitted_numbers = wp;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* An Open on LCP has requested a change from Dead to Establish phase.
|
* An Open on LCP has requested a change from Dead to Establish phase.
|
||||||
@ -2105,7 +2111,6 @@ set_allowed_addrs(unit, addrs, opts)
|
|||||||
wo->accept_remote = 1;
|
wo->accept_remote = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* UNUSED */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* auth_ip_addr - check whether the peer is authorized to use
|
* auth_ip_addr - check whether the peer is authorized to use
|
||||||
@ -2225,7 +2230,6 @@ check_access(f, filename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* UNUSED */
|
|
||||||
/*
|
/*
|
||||||
* scan_authfile - Scan an authorization file for a secret suitable
|
* scan_authfile - Scan an authorization file for a secret suitable
|
||||||
* for authenticating `client' on `server'. The return value is -1
|
* for authenticating `client' on `server'. The return value is -1
|
||||||
|
@ -196,8 +196,8 @@ struct protent ccp_protent = {
|
|||||||
"Compressed",
|
"Compressed",
|
||||||
#if PPP_OPTIONS
|
#if PPP_OPTIONS
|
||||||
ccp_option_list,
|
ccp_option_list,
|
||||||
#endif /* PPP_OPTIONS */
|
|
||||||
NULL,
|
NULL,
|
||||||
|
#endif /* PPP_OPTIONS */
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -350,7 +350,10 @@ chap_handle_response(struct chap_server_state *ss, int id,
|
|||||||
ok = (*verifier)(name, ss->name, id, ss->digest,
|
ok = (*verifier)(name, ss->name, id, ss->digest,
|
||||||
ss->challenge + PPP_HDRLEN + CHAP_HDRLEN,
|
ss->challenge + PPP_HDRLEN + CHAP_HDRLEN,
|
||||||
response, ss->message, sizeof(ss->message));
|
response, ss->message, sizeof(ss->message));
|
||||||
|
#if 0 /* UNUSED */
|
||||||
if (!ok || !auth_number()) {
|
if (!ok || !auth_number()) {
|
||||||
|
#endif /* UNUSED */
|
||||||
|
if (!ok) {
|
||||||
ss->flags |= AUTH_FAILED;
|
ss->flags |= AUTH_FAILED;
|
||||||
warn("Peer %q failed CHAP authentication", name);
|
warn("Peer %q failed CHAP authentication", name);
|
||||||
}
|
}
|
||||||
@ -658,6 +661,8 @@ struct protent chap_protent = {
|
|||||||
NULL, /* data_name */
|
NULL, /* data_name */
|
||||||
#if PPP_OPTIONS
|
#if PPP_OPTIONS
|
||||||
chap_option_list,
|
chap_option_list,
|
||||||
#endif /* PPP_OPTIONS */
|
|
||||||
NULL, /* check_options */
|
NULL, /* check_options */
|
||||||
|
#endif /* PPP_OPTIONS */
|
||||||
|
NULL,
|
||||||
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -121,8 +121,8 @@ struct protent eap_protent = {
|
|||||||
NULL, /* text name of corresponding data protocol */
|
NULL, /* text name of corresponding data protocol */
|
||||||
#if PPP_OPTIONS
|
#if PPP_OPTIONS
|
||||||
eap_option_list, /* list of command-line options */
|
eap_option_list, /* list of command-line options */
|
||||||
#endif /* PPP_OPTIONS */
|
|
||||||
NULL, /* check requested options; assign defaults */
|
NULL, /* check requested options; assign defaults */
|
||||||
|
#endif /* PPP_OPTIONS */
|
||||||
NULL, /* configure interface for demand-dial */
|
NULL, /* configure interface for demand-dial */
|
||||||
NULL /* say whether to bring up link for this pkt */
|
NULL /* say whether to bring up link for this pkt */
|
||||||
};
|
};
|
||||||
|
@ -115,8 +115,8 @@ struct protent ecp_protent = {
|
|||||||
"Encrypted",
|
"Encrypted",
|
||||||
#if PPP_OPTIONS
|
#if PPP_OPTIONS
|
||||||
ecp_option_list,
|
ecp_option_list,
|
||||||
#endif /* PPP_OPTIONS */
|
|
||||||
NULL,
|
NULL,
|
||||||
|
#endif /* PPP_OPTIONS */
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -141,9 +141,10 @@ static int setdnsaddr __P((char **));
|
|||||||
static int setwinsaddr __P((char **));
|
static int setwinsaddr __P((char **));
|
||||||
static int setnetmask __P((char **));
|
static int setnetmask __P((char **));
|
||||||
int setipaddr __P((char *, char **, int));
|
int setipaddr __P((char *, char **, int));
|
||||||
static void printipaddr __P((option_t *, void (*)(void *, char *,...),void *));
|
|
||||||
|
|
||||||
#if PPP_OPTIONS
|
#if PPP_OPTIONS
|
||||||
|
static void printipaddr __P((option_t *, void (*)(void *, char *,...),void *));
|
||||||
|
|
||||||
static option_t ipcp_option_list[] = {
|
static option_t ipcp_option_list[] = {
|
||||||
{ "noip", o_bool, &ipcp_protent.enabled_flag,
|
{ "noip", o_bool, &ipcp_protent.enabled_flag,
|
||||||
"Disable IP and IPCP" },
|
"Disable IP and IPCP" },
|
||||||
@ -279,8 +280,8 @@ struct protent ipcp_protent = {
|
|||||||
"IP",
|
"IP",
|
||||||
#if PPP_OPTIONS
|
#if PPP_OPTIONS
|
||||||
ipcp_option_list,
|
ipcp_option_list,
|
||||||
#endif /* PPP_OPTIONS */
|
|
||||||
ip_check_options,
|
ip_check_options,
|
||||||
|
#endif /* PPP_OPTIONS */
|
||||||
ip_demand_conf,
|
ip_demand_conf,
|
||||||
ip_active_pkt
|
ip_active_pkt
|
||||||
};
|
};
|
||||||
@ -412,6 +413,7 @@ setwinsaddr(argv)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
/*
|
/*
|
||||||
* setipaddr - Set the IP address
|
* setipaddr - Set the IP address
|
||||||
* If doit is 0, the call is to check whether this option is
|
* If doit is 0, the call is to check whether this option is
|
||||||
@ -484,7 +486,9 @@ setipaddr(arg, argv, doit)
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
|
#if PPP_OPTIONS
|
||||||
static void
|
static void
|
||||||
printipaddr(opt, printer, arg)
|
printipaddr(opt, printer, arg)
|
||||||
option_t *opt;
|
option_t *opt;
|
||||||
@ -499,6 +503,7 @@ printipaddr(opt, printer, arg)
|
|||||||
if (wo->hisaddr != 0)
|
if (wo->hisaddr != 0)
|
||||||
printer(arg, "%I", wo->hisaddr);
|
printer(arg, "%I", wo->hisaddr);
|
||||||
}
|
}
|
||||||
|
#endif /* PPP_OPTIONS */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* setnetmask - set the netmask to be used on the interface.
|
* setnetmask - set the netmask to be used on the interface.
|
||||||
@ -1687,6 +1692,7 @@ endswitch:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
/*
|
/*
|
||||||
* ip_check_options - check that any IP-related options are OK,
|
* ip_check_options - check that any IP-related options are OK,
|
||||||
* and assign appropriate defaults.
|
* and assign appropriate defaults.
|
||||||
@ -1717,7 +1723,7 @@ ip_check_options()
|
|||||||
}
|
}
|
||||||
ask_for_local = wo->ouraddr != 0 || !disable_defaultip;
|
ask_for_local = wo->ouraddr != 0 || !disable_defaultip;
|
||||||
}
|
}
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ip_demand_conf - configure the interface as though
|
* ip_demand_conf - configure the interface as though
|
||||||
|
@ -285,8 +285,8 @@ struct protent lcp_protent = {
|
|||||||
NULL,
|
NULL,
|
||||||
#if PPP_OPTIONS
|
#if PPP_OPTIONS
|
||||||
lcp_option_list,
|
lcp_option_list,
|
||||||
#endif /* PPP_OPTIONS */
|
|
||||||
NULL,
|
NULL,
|
||||||
|
#endif /* PPP_OPTIONS */
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -128,9 +128,10 @@ int maxoctets_dir = 0; /* default - sum of traffic */
|
|||||||
int maxoctets_timeout = 1; /* default 1 second */
|
int maxoctets_timeout = 1; /* default 1 second */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
extern option_t auth_options[];
|
extern option_t auth_options[];
|
||||||
extern struct stat devstat;
|
extern struct stat devstat;
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
#ifdef PPP_FILTER
|
#ifdef PPP_FILTER
|
||||||
struct bpf_program pass_filter;/* Filter program for packets to pass */
|
struct bpf_program pass_filter;/* Filter program for packets to pass */
|
||||||
@ -140,15 +141,20 @@ struct bpf_program active_filter; /* Filter program for link-active pkts */
|
|||||||
char *current_option; /* the name of the option being parsed */
|
char *current_option; /* the name of the option being parsed */
|
||||||
int privileged_option; /* set iff the current option came from root */
|
int privileged_option; /* set iff the current option came from root */
|
||||||
char *option_source; /* string saying where the option came from */
|
char *option_source; /* string saying where the option came from */
|
||||||
|
#if 0 /* UNUSED */
|
||||||
int option_priority = OPRIO_CFGFILE; /* priority of the current options */
|
int option_priority = OPRIO_CFGFILE; /* priority of the current options */
|
||||||
|
#endif /* UNUSED */
|
||||||
bool devnam_fixed; /* can no longer change device name */
|
bool devnam_fixed; /* can no longer change device name */
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
static int logfile_fd = -1; /* fd opened for log file */
|
static int logfile_fd = -1; /* fd opened for log file */
|
||||||
static char logfile_name[MAXPATHLEN]; /* name of log file */
|
static char logfile_name[MAXPATHLEN]; /* name of log file */
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prototypes
|
* Prototypes
|
||||||
*/
|
*/
|
||||||
|
#if 0 /* UNUSED */
|
||||||
static int setdomain __P((char **));
|
static int setdomain __P((char **));
|
||||||
static int readfile __P((char **));
|
static int readfile __P((char **));
|
||||||
static int callfile __P((char **));
|
static int callfile __P((char **));
|
||||||
@ -156,6 +162,7 @@ static int showversion __P((char **));
|
|||||||
static int showhelp __P((char **));
|
static int showhelp __P((char **));
|
||||||
static void usage __P((void));
|
static void usage __P((void));
|
||||||
static int setlogfile __P((char **));
|
static int setlogfile __P((char **));
|
||||||
|
#endif /* UNUSED */
|
||||||
#ifdef PLUGIN
|
#ifdef PLUGIN
|
||||||
static int loadplugin __P((char **));
|
static int loadplugin __P((char **));
|
||||||
#endif
|
#endif
|
||||||
@ -169,6 +176,7 @@ static int setactivefilter __P((char **));
|
|||||||
static int setmodir __P((char **));
|
static int setmodir __P((char **));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
static option_t *find_option __P((const char *name));
|
static option_t *find_option __P((const char *name));
|
||||||
static int process_option __P((option_t *, char *, char **));
|
static int process_option __P((option_t *, char *, char **));
|
||||||
static int n_arguments __P((option_t *));
|
static int n_arguments __P((option_t *));
|
||||||
@ -184,7 +192,6 @@ struct option_list {
|
|||||||
|
|
||||||
static struct option_list *extra_options = NULL;
|
static struct option_list *extra_options = NULL;
|
||||||
|
|
||||||
#if PPP_OPTIONS
|
|
||||||
/*
|
/*
|
||||||
* Valid arguments.
|
* Valid arguments.
|
||||||
*/
|
*/
|
||||||
|
@ -190,8 +190,10 @@ int privopen; /* don't lock, open device as root */
|
|||||||
|
|
||||||
char *no_ppp_msg = "Sorry - this system lacks PPP kernel support\n";
|
char *no_ppp_msg = "Sorry - this system lacks PPP kernel support\n";
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
GIDSET_TYPE groups[NGROUPS_MAX];/* groups the user is in */
|
GIDSET_TYPE groups[NGROUPS_MAX];/* groups the user is in */
|
||||||
int ngroups; /* How many groups valid in groups */
|
int ngroups; /* How many groups valid in groups */
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
static struct timeval start_time; /* Time when link was started. */
|
static struct timeval start_time; /* Time when link was started. */
|
||||||
|
|
||||||
@ -322,7 +324,9 @@ int ppp_oldmain() {
|
|||||||
slprintf(numbuf, sizeof(numbuf), "%d", uid);
|
slprintf(numbuf, sizeof(numbuf), "%d", uid);
|
||||||
script_setenv("ORIG_UID", numbuf, 0);
|
script_setenv("ORIG_UID", numbuf, 0);
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
ngroups = getgroups(NGROUPS_MAX, groups);
|
ngroups = getgroups(NGROUPS_MAX, groups);
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize magic number generator now so that protocols may
|
* Initialize magic number generator now so that protocols may
|
||||||
@ -356,12 +360,14 @@ int ppp_oldmain() {
|
|||||||
|
|
||||||
devnam_fixed = 1; /* can no longer change device name */
|
devnam_fixed = 1; /* can no longer change device name */
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
/*
|
/*
|
||||||
* Work out the device name, if it hasn't already been specified,
|
* Work out the device name, if it hasn't already been specified,
|
||||||
* and parse the tty's options file.
|
* and parse the tty's options file.
|
||||||
*/
|
*/
|
||||||
if (the_channel->process_extra_options)
|
if (the_channel->process_extra_options)
|
||||||
(*the_channel->process_extra_options)();
|
(*the_channel->process_extra_options)();
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
setlogmask(LOG_UPTO(LOG_DEBUG));
|
setlogmask(LOG_UPTO(LOG_DEBUG));
|
||||||
|
@ -87,6 +87,7 @@
|
|||||||
|
|
||||||
typedef unsigned char bool;
|
typedef unsigned char bool;
|
||||||
|
|
||||||
|
#if 0
|
||||||
enum opt_type {
|
enum opt_type {
|
||||||
o_special_noarg = 0,
|
o_special_noarg = 0,
|
||||||
o_special = 1,
|
o_special = 1,
|
||||||
@ -162,6 +163,7 @@ struct permitted_ip {
|
|||||||
u_int32_t base; /* match if (addr & mask) == base */
|
u_int32_t base; /* match if (addr & mask) == base */
|
||||||
u_int32_t mask; /* base and mask are in network byte order */
|
u_int32_t mask; /* base and mask are in network byte order */
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unfortunately, the linux kernel driver uses a different structure
|
* Unfortunately, the linux kernel driver uses a different structure
|
||||||
@ -227,7 +229,9 @@ extern int privileged; /* We were run by real-uid root */
|
|||||||
extern int need_holdoff; /* Need holdoff period after link terminates */
|
extern int need_holdoff; /* Need holdoff period after link terminates */
|
||||||
extern char **script_env; /* Environment variables for scripts */
|
extern char **script_env; /* Environment variables for scripts */
|
||||||
extern int detached; /* Have detached from controlling tty */
|
extern int detached; /* Have detached from controlling tty */
|
||||||
|
#if 0
|
||||||
extern GIDSET_TYPE groups[NGROUPS_MAX]; /* groups the user is in */
|
extern GIDSET_TYPE groups[NGROUPS_MAX]; /* groups the user is in */
|
||||||
|
#endif
|
||||||
extern int ngroups; /* How many groups valid in groups */
|
extern int ngroups; /* How many groups valid in groups */
|
||||||
extern struct pppd_stats link_stats; /* byte/packet counts etc. for link */
|
extern struct pppd_stats link_stats; /* byte/packet counts etc. for link */
|
||||||
extern int link_stats_valid; /* set if link_stats is valid */
|
extern int link_stats_valid; /* set if link_stats is valid */
|
||||||
@ -414,8 +418,8 @@ struct protent {
|
|||||||
bool enabled_flag; /* 0 iff protocol is disabled */
|
bool enabled_flag; /* 0 iff protocol is disabled */
|
||||||
char *name; /* Text name of protocol */
|
char *name; /* Text name of protocol */
|
||||||
char *data_name; /* Text name of corresponding data protocol */
|
char *data_name; /* Text name of corresponding data protocol */
|
||||||
option_t *options; /* List of command-line options */
|
|
||||||
#if PPP_OPTIONS
|
#if PPP_OPTIONS
|
||||||
|
option_t *options; /* List of command-line options */
|
||||||
/* Check requested options, assign defaults */
|
/* Check requested options, assign defaults */
|
||||||
void (*check_options) __P((void));
|
void (*check_options) __P((void));
|
||||||
#endif /* PPP_OPTIONS */
|
#endif /* PPP_OPTIONS */
|
||||||
@ -436,6 +440,7 @@ extern struct protent *protocols[];
|
|||||||
* with PPP STREAMS modules pushed onto it).
|
* with PPP STREAMS modules pushed onto it).
|
||||||
*/
|
*/
|
||||||
struct channel {
|
struct channel {
|
||||||
|
#if PPP_OPTIONS
|
||||||
/* set of options for this channel */
|
/* set of options for this channel */
|
||||||
option_t *options;
|
option_t *options;
|
||||||
/* find and process a per-channel options file */
|
/* find and process a per-channel options file */
|
||||||
@ -444,6 +449,7 @@ struct channel {
|
|||||||
void (*check_options) __P((void));
|
void (*check_options) __P((void));
|
||||||
/* get the channel ready to do PPP, return a file descriptor */
|
/* get the channel ready to do PPP, return a file descriptor */
|
||||||
int (*connect) __P((void));
|
int (*connect) __P((void));
|
||||||
|
#endif /* PPP_OPTIONS */
|
||||||
/* we're finished with the channel */
|
/* we're finished with the channel */
|
||||||
void (*disconnect) __P((void));
|
void (*disconnect) __P((void));
|
||||||
/* put the channel into PPP `mode' */
|
/* put the channel into PPP `mode' */
|
||||||
@ -670,7 +676,9 @@ int get_if_hwaddr __P((u_char *addr, char *name));
|
|||||||
char *get_first_ethernet __P((void));
|
char *get_first_ethernet __P((void));
|
||||||
|
|
||||||
/* Procedures exported from options.c */
|
/* Procedures exported from options.c */
|
||||||
|
#if 0 /* UNUSED */
|
||||||
int setipaddr __P((char *, char **, int)); /* Set local/remote ip addresses */
|
int setipaddr __P((char *, char **, int)); /* Set local/remote ip addresses */
|
||||||
|
#endif /* UNUSED */
|
||||||
int parse_args __P((int argc, char **argv));
|
int parse_args __P((int argc, char **argv));
|
||||||
/* Parse options from arguments given */
|
/* Parse options from arguments given */
|
||||||
int options_from_file __P((char *filename, int must_exist, int check_prot,
|
int options_from_file __P((char *filename, int must_exist, int check_prot,
|
||||||
@ -688,6 +696,7 @@ void option_error __P((char *fmt, ...));
|
|||||||
#else
|
#else
|
||||||
#define option_error(x, ...)
|
#define option_error(x, ...)
|
||||||
#endif /* PPP_OPTIONS */
|
#endif /* PPP_OPTIONS */
|
||||||
|
#if PPP_OPTIONS
|
||||||
int int_option __P((char *, int *));
|
int int_option __P((char *, int *));
|
||||||
/* Simplified number_option for decimal ints */
|
/* Simplified number_option for decimal ints */
|
||||||
void add_options __P((option_t *)); /* Add extra options */
|
void add_options __P((option_t *)); /* Add extra options */
|
||||||
@ -696,6 +705,7 @@ int override_value __P((const char *, int, const char *));
|
|||||||
/* override value if permitted by priority */
|
/* override value if permitted by priority */
|
||||||
void print_options __P((void (*) __P((void *, char *, ...)), void *));
|
void print_options __P((void (*) __P((void *, char *, ...)), void *));
|
||||||
/* print out values of all options */
|
/* print out values of all options */
|
||||||
|
#endif /* PPP_OPTIONS */
|
||||||
|
|
||||||
int parse_dotted_ip __P((char *, u_int32_t *));
|
int parse_dotted_ip __P((char *, u_int32_t *));
|
||||||
|
|
||||||
|
@ -112,7 +112,9 @@ static int setdevname __P((char *, char **, int));
|
|||||||
static int setspeed __P((char *, char **, int));
|
static int setspeed __P((char *, char **, int));
|
||||||
static int setxonxoff __P((char **));
|
static int setxonxoff __P((char **));
|
||||||
static int setescape __P((char **));
|
static int setescape __P((char **));
|
||||||
|
#if 0 /* UNUSED */
|
||||||
static void printescape __P((option_t *, void (*)(void *, char *,...),void *));
|
static void printescape __P((option_t *, void (*)(void *, char *,...),void *));
|
||||||
|
#endif /* UNUSED */
|
||||||
static void finish_tty __P((void));
|
static void finish_tty __P((void));
|
||||||
static int start_charshunt __P((int, int));
|
static int start_charshunt __P((int, int));
|
||||||
static void stop_charshunt __P((void *, int));
|
static void stop_charshunt __P((void *, int));
|
||||||
@ -154,7 +156,9 @@ char *pty_socket = NULL; /* Socket to connect to pty */
|
|||||||
int using_pty = 0; /* we're allocating a pty as the device */
|
int using_pty = 0; /* we're allocating a pty as the device */
|
||||||
|
|
||||||
extern uid_t uid;
|
extern uid_t uid;
|
||||||
|
#if 0 /* UNUSED */
|
||||||
extern int kill_link;
|
extern int kill_link;
|
||||||
|
#endif /* UNUSED */
|
||||||
extern int asked_to_quit;
|
extern int asked_to_quit;
|
||||||
extern int got_sigterm;
|
extern int got_sigterm;
|
||||||
|
|
||||||
@ -163,6 +167,7 @@ extern int privopen; /* don't lock, open device as root */
|
|||||||
|
|
||||||
u_int32_t xmit_accm[8]; /* extended transmit ACCM */
|
u_int32_t xmit_accm[8]; /* extended transmit ACCM */
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
/* option descriptors */
|
/* option descriptors */
|
||||||
option_t tty_options[] = {
|
option_t tty_options[] = {
|
||||||
/* device name must be first, or change connect_tty() below! */
|
/* device name must be first, or change connect_tty() below! */
|
||||||
@ -243,12 +248,15 @@ option_t tty_options[] = {
|
|||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
struct channel tty_channel = {
|
struct channel tty_channel = {
|
||||||
|
#if PPP_OPTIONS
|
||||||
tty_options,
|
tty_options,
|
||||||
&tty_process_extra_options,
|
&tty_process_extra_options,
|
||||||
&tty_check_options,
|
&tty_check_options,
|
||||||
&connect_tty,
|
&connect_tty,
|
||||||
|
#endif /* UNUSED */
|
||||||
&disconnect_tty,
|
&disconnect_tty,
|
||||||
&tty_establish_ppp,
|
&tty_establish_ppp,
|
||||||
&tty_disestablish_ppp,
|
&tty_disestablish_ppp,
|
||||||
@ -373,6 +381,7 @@ setescape(argv)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
static void
|
static void
|
||||||
printescape(opt, printer, arg)
|
printescape(opt, printer, arg)
|
||||||
option_t *opt;
|
option_t *opt;
|
||||||
@ -396,6 +405,7 @@ printescape(opt, printer, arg)
|
|||||||
if (first)
|
if (first)
|
||||||
printer(arg, "oops # nothing escaped");
|
printer(arg, "oops # nothing escaped");
|
||||||
}
|
}
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* tty_init - do various tty-related initializations.
|
* tty_init - do various tty-related initializations.
|
||||||
@ -440,6 +450,7 @@ void tty_process_extra_options()
|
|||||||
#endif /* PPP_OPTIONS */
|
#endif /* PPP_OPTIONS */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
/*
|
/*
|
||||||
* tty_check_options - do consistency checks on the options we were given.
|
* tty_check_options - do consistency checks on the options we were given.
|
||||||
*/
|
*/
|
||||||
@ -508,7 +519,9 @@ tty_check_options()
|
|||||||
&& S_ISCHR(statbuf.st_mode) && statbuf.st_rdev == devstat.st_rdev)
|
&& S_ISCHR(statbuf.st_mode) && statbuf.st_rdev == devstat.st_rdev)
|
||||||
log_to_fd = -1;
|
log_to_fd = -1;
|
||||||
}
|
}
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
/*
|
/*
|
||||||
* connect_tty - get the serial port ready to start doing PPP.
|
* connect_tty - get the serial port ready to start doing PPP.
|
||||||
* That is, open the serial port, set its speed and mode, and run
|
* That is, open the serial port, set its speed and mode, and run
|
||||||
@ -770,7 +783,7 @@ int connect_tty()
|
|||||||
asked_to_quit = 1;
|
asked_to_quit = 1;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
void disconnect_tty()
|
void disconnect_tty()
|
||||||
{
|
{
|
||||||
|
@ -106,8 +106,8 @@ struct protent pap_protent = {
|
|||||||
NULL,
|
NULL,
|
||||||
#if PPP_OPTIONS
|
#if PPP_OPTIONS
|
||||||
pap_option_list,
|
pap_option_list,
|
||||||
#endif /* PPP_OPTIONS */
|
|
||||||
NULL,
|
NULL,
|
||||||
|
#endif /* PPP_OPTIONS */
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
@ -432,6 +432,7 @@ upap_rauthreq(u, inp, id, len)
|
|||||||
rpasswdlen, &msg);
|
rpasswdlen, &msg);
|
||||||
BZERO(rpasswd, rpasswdlen);
|
BZERO(rpasswd, rpasswdlen);
|
||||||
|
|
||||||
|
#if 0 /* UNUSED */
|
||||||
/*
|
/*
|
||||||
* Check remote number authorization. A plugin may have filled in
|
* Check remote number authorization. A plugin may have filled in
|
||||||
* the remote number or added an allowed number, and rather than
|
* the remote number or added an allowed number, and rather than
|
||||||
@ -444,6 +445,7 @@ upap_rauthreq(u, inp, id, len)
|
|||||||
warn("calling number %q is not authorized", remote_number);
|
warn("calling number %q is not authorized", remote_number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* UNUSED */
|
||||||
|
|
||||||
msglen = strlen(msg);
|
msglen = strlen(msg);
|
||||||
if (msglen > 255)
|
if (msglen > 255)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user