-/* $OpenBSD: if_spppsubr.c,v 1.115 2014/01/07 16:34:05 stsp Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.116 2014/01/12 15:38:06 stsp Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
* Keepalive protocol implemented in both Cisco and PPP modes.
#include <sys/param.h>
-#define HIDE
-
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/sockio.h>
struct ifnet *ifp = &sp->pp_if; \
int debug = ifp->if_flags & IFF_DEBUG
-HIDE int sppp_output(struct ifnet *ifp, struct mbuf *m,
+int sppp_output(struct ifnet *ifp, struct mbuf *m,
struct sockaddr *dst, struct rtentry *rt);
-HIDE void sppp_cisco_send(struct sppp *sp, u_int32_t type, u_int32_t par1, u_int32_t par2);
-HIDE void sppp_cisco_input(struct sppp *sp, struct mbuf *m);
+void sppp_cisco_send(struct sppp *sp, u_int32_t type, u_int32_t par1, u_int32_t par2);
+void sppp_cisco_input(struct sppp *sp, struct mbuf *m);
-HIDE void sppp_cp_input(const struct cp *cp, struct sppp *sp,
+void sppp_cp_input(const struct cp *cp, struct sppp *sp,
struct mbuf *m);
-HIDE void sppp_cp_send(struct sppp *sp, u_short proto, u_char type,
+void sppp_cp_send(struct sppp *sp, u_short proto, u_char type,
u_char ident, u_short len, void *data);
#ifdef notyet
-HIDE void sppp_cp_timeout(void *arg);
+void sppp_cp_timeout(void *arg);
#endif
-HIDE void sppp_cp_change_state(const struct cp *cp, struct sppp *sp,
+void sppp_cp_change_state(const struct cp *cp, struct sppp *sp,
int newstate);
-HIDE void sppp_auth_send(const struct cp *cp,
+void sppp_auth_send(const struct cp *cp,
struct sppp *sp, unsigned int type, u_int id,
...);
-HIDE void sppp_up_event(const struct cp *cp, struct sppp *sp);
-HIDE void sppp_down_event(const struct cp *cp, struct sppp *sp);
-HIDE void sppp_open_event(const struct cp *cp, struct sppp *sp);
-HIDE void sppp_close_event(const struct cp *cp, struct sppp *sp);
-HIDE void sppp_increasing_timeout(const struct cp *cp, struct sppp *sp);
-HIDE void sppp_to_event(const struct cp *cp, struct sppp *sp);
-
-HIDE void sppp_null(struct sppp *sp);
-
-HIDE void sppp_lcp_init(struct sppp *sp);
-HIDE void sppp_lcp_up(struct sppp *sp);
-HIDE void sppp_lcp_down(struct sppp *sp);
-HIDE void sppp_lcp_open(struct sppp *sp);
-HIDE void sppp_lcp_close(struct sppp *sp);
-HIDE void sppp_lcp_TO(void *sp);
-HIDE int sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len);
-HIDE void sppp_lcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len);
-HIDE void sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len);
-HIDE void sppp_lcp_tlu(struct sppp *sp);
-HIDE void sppp_lcp_tld(struct sppp *sp);
-HIDE void sppp_lcp_tls(struct sppp *sp);
-HIDE void sppp_lcp_tlf(struct sppp *sp);
-HIDE void sppp_lcp_scr(struct sppp *sp);
-HIDE void sppp_lcp_check_and_close(struct sppp *sp);
-HIDE int sppp_ncp_check(struct sppp *sp);
-
-HIDE void sppp_ipcp_init(struct sppp *sp);
-HIDE void sppp_ipcp_destroy(struct sppp *sp);
-HIDE void sppp_ipcp_up(struct sppp *sp);
-HIDE void sppp_ipcp_down(struct sppp *sp);
-HIDE void sppp_ipcp_open(struct sppp *sp);
-HIDE void sppp_ipcp_close(struct sppp *sp);
-HIDE void sppp_ipcp_TO(void *sp);
-HIDE int sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len);
-HIDE void sppp_ipcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len);
-HIDE void sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len);
-HIDE void sppp_ipcp_tlu(struct sppp *sp);
-HIDE void sppp_ipcp_tld(struct sppp *sp);
-HIDE void sppp_ipcp_tls(struct sppp *sp);
-HIDE void sppp_ipcp_tlf(struct sppp *sp);
-HIDE void sppp_ipcp_scr(struct sppp *sp);
-
-HIDE void sppp_ipv6cp_init(struct sppp *sp);
-HIDE void sppp_ipv6cp_destroy(struct sppp *sp);
-HIDE void sppp_ipv6cp_up(struct sppp *sp);
-HIDE void sppp_ipv6cp_down(struct sppp *sp);
-HIDE void sppp_ipv6cp_open(struct sppp *sp);
-HIDE void sppp_ipv6cp_close(struct sppp *sp);
-HIDE void sppp_ipv6cp_TO(void *sp);
-HIDE int sppp_ipv6cp_RCR(struct sppp *sp, struct lcp_header *h, int len);
-HIDE void sppp_ipv6cp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len);
-HIDE void sppp_ipv6cp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len);
-HIDE void sppp_ipv6cp_tlu(struct sppp *sp);
-HIDE void sppp_ipv6cp_tld(struct sppp *sp);
-HIDE void sppp_ipv6cp_tls(struct sppp *sp);
-HIDE void sppp_ipv6cp_tlf(struct sppp *sp);
-HIDE void sppp_ipv6cp_scr(struct sppp *sp);
-HIDE const char *sppp_ipv6cp_opt_name(u_char opt);
-HIDE void sppp_get_ip6_addrs(struct sppp *sp, struct in6_addr *src,
+void sppp_up_event(const struct cp *cp, struct sppp *sp);
+void sppp_down_event(const struct cp *cp, struct sppp *sp);
+void sppp_open_event(const struct cp *cp, struct sppp *sp);
+void sppp_close_event(const struct cp *cp, struct sppp *sp);
+void sppp_increasing_timeout(const struct cp *cp, struct sppp *sp);
+void sppp_to_event(const struct cp *cp, struct sppp *sp);
+
+void sppp_null(struct sppp *sp);
+
+void sppp_lcp_init(struct sppp *sp);
+void sppp_lcp_up(struct sppp *sp);
+void sppp_lcp_down(struct sppp *sp);
+void sppp_lcp_open(struct sppp *sp);
+void sppp_lcp_close(struct sppp *sp);
+void sppp_lcp_TO(void *sp);
+int sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len);
+void sppp_lcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len);
+void sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len);
+void sppp_lcp_tlu(struct sppp *sp);
+void sppp_lcp_tld(struct sppp *sp);
+void sppp_lcp_tls(struct sppp *sp);
+void sppp_lcp_tlf(struct sppp *sp);
+void sppp_lcp_scr(struct sppp *sp);
+void sppp_lcp_check_and_close(struct sppp *sp);
+int sppp_ncp_check(struct sppp *sp);
+
+void sppp_ipcp_init(struct sppp *sp);
+void sppp_ipcp_destroy(struct sppp *sp);
+void sppp_ipcp_up(struct sppp *sp);
+void sppp_ipcp_down(struct sppp *sp);
+void sppp_ipcp_open(struct sppp *sp);
+void sppp_ipcp_close(struct sppp *sp);
+void sppp_ipcp_TO(void *sp);
+int sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len);
+void sppp_ipcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len);
+void sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len);
+void sppp_ipcp_tlu(struct sppp *sp);
+void sppp_ipcp_tld(struct sppp *sp);
+void sppp_ipcp_tls(struct sppp *sp);
+void sppp_ipcp_tlf(struct sppp *sp);
+void sppp_ipcp_scr(struct sppp *sp);
+
+void sppp_ipv6cp_init(struct sppp *sp);
+void sppp_ipv6cp_destroy(struct sppp *sp);
+void sppp_ipv6cp_up(struct sppp *sp);
+void sppp_ipv6cp_down(struct sppp *sp);
+void sppp_ipv6cp_open(struct sppp *sp);
+void sppp_ipv6cp_close(struct sppp *sp);
+void sppp_ipv6cp_TO(void *sp);
+int sppp_ipv6cp_RCR(struct sppp *sp, struct lcp_header *h, int len);
+void sppp_ipv6cp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len);
+void sppp_ipv6cp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len);
+void sppp_ipv6cp_tlu(struct sppp *sp);
+void sppp_ipv6cp_tld(struct sppp *sp);
+void sppp_ipv6cp_tls(struct sppp *sp);
+void sppp_ipv6cp_tlf(struct sppp *sp);
+void sppp_ipv6cp_scr(struct sppp *sp);
+const char *sppp_ipv6cp_opt_name(u_char opt);
+void sppp_get_ip6_addrs(struct sppp *sp, struct in6_addr *src,
struct in6_addr *dst, struct in6_addr *srcmask);
-HIDE void sppp_set_ip6_addr(struct sppp *sp, const struct in6_addr *src, const struct in6_addr *dst);
-HIDE void sppp_update_ip6_addr(void *arg1, void *arg2);
-HIDE void sppp_suggest_ip6_addr(struct sppp *sp, struct in6_addr *suggest);
-
-HIDE void sppp_pap_input(struct sppp *sp, struct mbuf *m);
-HIDE void sppp_pap_init(struct sppp *sp);
-HIDE void sppp_pap_open(struct sppp *sp);
-HIDE void sppp_pap_close(struct sppp *sp);
-HIDE void sppp_pap_TO(void *sp);
-HIDE void sppp_pap_my_TO(void *sp);
-HIDE void sppp_pap_tlu(struct sppp *sp);
-HIDE void sppp_pap_tld(struct sppp *sp);
-HIDE void sppp_pap_scr(struct sppp *sp);
-
-HIDE void sppp_chap_input(struct sppp *sp, struct mbuf *m);
-HIDE void sppp_chap_init(struct sppp *sp);
-HIDE void sppp_chap_open(struct sppp *sp);
-HIDE void sppp_chap_close(struct sppp *sp);
-HIDE void sppp_chap_TO(void *sp);
-HIDE void sppp_chap_tlu(struct sppp *sp);
-HIDE void sppp_chap_tld(struct sppp *sp);
-HIDE void sppp_chap_scr(struct sppp *sp);
-
-HIDE const char *sppp_auth_type_name(u_short proto, u_char type);
-HIDE const char *sppp_cp_type_name(u_char type);
-HIDE const char *sppp_dotted_quad(u_int32_t addr);
-HIDE const char *sppp_ipcp_opt_name(u_char opt);
-HIDE const char *sppp_lcp_opt_name(u_char opt);
-HIDE const char *sppp_phase_name(enum ppp_phase phase);
-HIDE const char *sppp_proto_name(u_short proto);
-HIDE const char *sppp_state_name(int state);
-HIDE int sppp_get_params(struct sppp *sp, struct ifreq *data);
-HIDE int sppp_set_params(struct sppp *sp, struct ifreq *data);
-HIDE void sppp_get_ip_addrs(struct sppp *sp, u_int32_t *src, u_int32_t *dst,
+void sppp_set_ip6_addr(struct sppp *sp, const struct in6_addr *src, const struct in6_addr *dst);
+void sppp_update_ip6_addr(void *arg1, void *arg2);
+void sppp_suggest_ip6_addr(struct sppp *sp, struct in6_addr *suggest);
+
+void sppp_pap_input(struct sppp *sp, struct mbuf *m);
+void sppp_pap_init(struct sppp *sp);
+void sppp_pap_open(struct sppp *sp);
+void sppp_pap_close(struct sppp *sp);
+void sppp_pap_TO(void *sp);
+void sppp_pap_my_TO(void *sp);
+void sppp_pap_tlu(struct sppp *sp);
+void sppp_pap_tld(struct sppp *sp);
+void sppp_pap_scr(struct sppp *sp);
+
+void sppp_chap_input(struct sppp *sp, struct mbuf *m);
+void sppp_chap_init(struct sppp *sp);
+void sppp_chap_open(struct sppp *sp);
+void sppp_chap_close(struct sppp *sp);
+void sppp_chap_TO(void *sp);
+void sppp_chap_tlu(struct sppp *sp);
+void sppp_chap_tld(struct sppp *sp);
+void sppp_chap_scr(struct sppp *sp);
+
+const char *sppp_auth_type_name(u_short proto, u_char type);
+const char *sppp_cp_type_name(u_char type);
+const char *sppp_dotted_quad(u_int32_t addr);
+const char *sppp_ipcp_opt_name(u_char opt);
+const char *sppp_lcp_opt_name(u_char opt);
+const char *sppp_phase_name(enum ppp_phase phase);
+const char *sppp_proto_name(u_short proto);
+const char *sppp_state_name(int state);
+int sppp_get_params(struct sppp *sp, struct ifreq *data);
+int sppp_set_params(struct sppp *sp, struct ifreq *data);
+void sppp_get_ip_addrs(struct sppp *sp, u_int32_t *src, u_int32_t *dst,
u_int32_t *srcmask);
-HIDE void sppp_keepalive(void *dummy);
-HIDE void sppp_phase_network(struct sppp *sp);
-HIDE void sppp_print_bytes(const u_char *p, u_short len);
-HIDE void sppp_print_string(const char *p, u_short len);
-HIDE void sppp_qflush(struct ifqueue *ifq);
+void sppp_keepalive(void *dummy);
+void sppp_phase_network(struct sppp *sp);
+void sppp_print_bytes(const u_char *p, u_short len);
+void sppp_print_string(const char *p, u_short len);
+void sppp_qflush(struct ifqueue *ifq);
int sppp_update_gw_walker(struct radix_node *rn, void *arg, u_int);
void sppp_update_gw(struct ifnet *ifp);
-HIDE void sppp_set_ip_addrs(void *, void *);
-HIDE void sppp_clear_ip_addrs(void *, void *);
-HIDE void sppp_set_phase(struct sppp *sp);
+void sppp_set_ip_addrs(void *, void *);
+void sppp_clear_ip_addrs(void *, void *);
+void sppp_set_phase(struct sppp *sp);
/* our control protocol descriptors */
static const struct cp lcp = {
/*
* Enqueue transmit packet.
*/
-HIDE int
+int
sppp_output(struct ifnet *ifp, struct mbuf *m,
struct sockaddr *dst, struct rtentry *rt)
{
/*
* Handle incoming Cisco keepalive protocol packets.
*/
-HIDE void
+void
sppp_cisco_input(struct sppp *sp, struct mbuf *m)
{
STDDCL;
/*
* Send Cisco keepalive packet.
*/
-HIDE void
+void
sppp_cisco_send(struct sppp *sp, u_int32_t type, u_int32_t par1, u_int32_t par2)
{
STDDCL;
/*
* Send PPP control protocol packet.
*/
-HIDE void
+void
sppp_cp_send(struct sppp *sp, u_short proto, u_char type,
u_char ident, u_short len, void *data)
{
/*
* Handle incoming PPP control protocol packets.
*/
-HIDE void
+void
sppp_cp_input(const struct cp *cp, struct sppp *sp, struct mbuf *m)
{
STDDCL;
* The generic part of all Up/Down/Open/Close/TO event handlers.
* Basically, the state transition handling in the automaton.
*/
-HIDE void
+void
sppp_up_event(const struct cp *cp, struct sppp *sp)
{
STDDCL;
}
}
-HIDE void
+void
sppp_down_event(const struct cp *cp, struct sppp *sp)
{
STDDCL;
}
-HIDE void
+void
sppp_open_event(const struct cp *cp, struct sppp *sp)
{
STDDCL;
}
-HIDE void
+void
sppp_close_event(const struct cp *cp, struct sppp *sp)
{
STDDCL;
}
}
-HIDE void
+void
sppp_increasing_timeout (const struct cp *cp, struct sppp *sp)
{
int timo;
timeout_add(&sp->ch[cp->protoidx], timo * sp->lcp.timeout);
}
-HIDE void
+void
sppp_to_event(const struct cp *cp, struct sppp *sp)
{
STDDCL;
* *
*--------------------------------------------------------------------------*
*/
-HIDE void
+void
sppp_lcp_init(struct sppp *sp)
{
sp->lcp.opts = (1 << LCP_OPT_MAGIC);
sp->lcp.max_failure = 10;
}
-HIDE void
+void
sppp_lcp_up(struct sppp *sp)
{
STDDCL;
sppp_up_event(&lcp, sp);
}
-HIDE void
+void
sppp_lcp_down(struct sppp *sp)
{
STDDCL;
sppp_flush(ifp);
}
-HIDE void
+void
sppp_lcp_open(struct sppp *sp)
{
/*
sppp_open_event(&lcp, sp);
}
-HIDE void
+void
sppp_lcp_close(struct sppp *sp)
{
sppp_close_event(&lcp, sp);
}
-HIDE void
+void
sppp_lcp_TO(void *cookie)
{
sppp_to_event(&lcp, (struct sppp *)cookie);
* caused action scn. (The return value is used to make the state
* transition decision in the state automaton.)
*/
-HIDE int
+int
sppp_lcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
{
STDDCL;
* Analyze the LCP Configure-Reject option list, and adjust our
* negotiation.
*/
-HIDE void
+void
sppp_lcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len)
{
STDDCL;
* Analyze the LCP Configure-NAK option list, and adjust our
* negotiation.
*/
-HIDE void
+void
sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
{
STDDCL;
addlog("\n");
}
-HIDE void
+void
sppp_lcp_tlu(struct sppp *sp)
{
struct ifnet *ifp = &sp->pp_if;
sppp_lcp_check_and_close(sp);
}
-HIDE void
+void
sppp_lcp_tld(struct sppp *sp)
{
int i;
}
}
-HIDE void
+void
sppp_lcp_tls(struct sppp *sp)
{
sp->pp_phase = PHASE_ESTABLISH;
(sp->pp_tls)(sp);
}
-HIDE void
+void
sppp_lcp_tlf(struct sppp *sp)
{
sp->pp_phase = PHASE_DEAD;
(sp->pp_tlf)(sp);
}
-HIDE void
+void
sppp_lcp_scr(struct sppp *sp)
{
char opt[6 /* magicnum */ + 4 /* mru */ + 5 /* chap */];
/*
* Check the open NCPs, return true if at least one NCP is open.
*/
-HIDE int
+int
sppp_ncp_check(struct sppp *sp)
{
int i, mask;
* Re-check the open NCPs and see if we should terminate the link.
* Called by the NCPs during their tlf action handling.
*/
-HIDE void
+void
sppp_lcp_check_and_close(struct sppp *sp)
{
*--------------------------------------------------------------------------*
*/
-HIDE void
+void
sppp_ipcp_init(struct sppp *sp)
{
sp->ipcp.opts = 0;
task_set(&sp->ipcp.clear_addr_task, sppp_clear_ip_addrs, sp, NULL);
}
-HIDE void
+void
sppp_ipcp_destroy(struct sppp *sp)
{
task_del(systq, &sp->ipcp.set_addr_task);
task_del(systq, &sp->ipcp.clear_addr_task);
}
-HIDE void
+void
sppp_ipcp_up(struct sppp *sp)
{
sppp_up_event(&ipcp, sp);
}
-HIDE void
+void
sppp_ipcp_down(struct sppp *sp)
{
sppp_down_event(&ipcp, sp);
}
-HIDE void
+void
sppp_ipcp_open(struct sppp *sp)
{
sppp_open_event(&ipcp, sp);
}
-HIDE void
+void
sppp_ipcp_close(struct sppp *sp)
{
sppp_close_event(&ipcp, sp);
}
-HIDE void
+void
sppp_ipcp_TO(void *cookie)
{
sppp_to_event(&ipcp, (struct sppp *)cookie);
* caused action scn. (The return value is used to make the state
* transition decision in the state automaton.)
*/
-HIDE int
+int
sppp_ipcp_RCR(struct sppp *sp, struct lcp_header *h, int len)
{
u_char *buf, *r, *p;
* Analyze the IPCP Configure-Reject option list, and adjust our
* negotiation.
*/
-HIDE void
+void
sppp_ipcp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len)
{
u_char *p;
* Analyze the IPCP Configure-NAK option list, and adjust our
* negotiation.
*/
-HIDE void
+void
sppp_ipcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
{
u_char *p;
addlog("\n");
}
-HIDE void
+void
sppp_ipcp_tlu(struct sppp *sp)
{
if (sp->ipcp.req_myaddr != 0 || sp->ipcp.req_hisaddr != 0)
task_add(systq, &sp->ipcp.set_addr_task);
}
-HIDE void
+void
sppp_ipcp_tld(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipcp_tls(struct sppp *sp)
{
STDDCL;
sp->lcp.protos |= (1 << IDX_IPCP);
}
-HIDE void
+void
sppp_ipcp_tlf(struct sppp *sp)
{
if (sp->ipcp.flags & (IPCP_MYADDR_DYN|IPCP_HISADDR_DYN))
sppp_lcp_check_and_close(sp);
}
-HIDE void
+void
sppp_ipcp_scr(struct sppp *sp)
{
char opt[6 /* compression */ + 6 /* address */];
*/
#ifdef INET6
-HIDE void
+void
sppp_ipv6cp_init(struct sppp *sp)
{
sp->ipv6cp.opts = 0;
&sp->ipv6cp.req_ifid);
}
-HIDE void
+void
sppp_ipv6cp_destroy(struct sppp *sp)
{
task_del(systq, &sp->ipv6cp.set_addr_task);
}
-HIDE void
+void
sppp_ipv6cp_up(struct sppp *sp)
{
sppp_up_event(&ipv6cp, sp);
}
-HIDE void
+void
sppp_ipv6cp_down(struct sppp *sp)
{
sppp_down_event(&ipv6cp, sp);
}
-HIDE void
+void
sppp_ipv6cp_open(struct sppp *sp)
{
STDDCL;
sppp_open_event(&ipv6cp, sp);
}
-HIDE void
+void
sppp_ipv6cp_close(struct sppp *sp)
{
sppp_close_event(&ipv6cp, sp);
}
-HIDE void
+void
sppp_ipv6cp_TO(void *cookie)
{
sppp_to_event(&ipv6cp, (struct sppp *)cookie);
}
-HIDE int
+int
sppp_ipv6cp_RCR(struct sppp *sp, struct lcp_header *h, int len)
{
u_char *buf, *r, *p;
return (rlen == 0);
}
-HIDE void
+void
sppp_ipv6cp_RCN_rej(struct sppp *sp, struct lcp_header *h, int len)
{
u_char *p;
return;
}
-HIDE void
+void
sppp_ipv6cp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len)
{
u_char *p;
addlog("\n");
}
-HIDE void
+void
sppp_ipv6cp_tlu(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipv6cp_tld(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipv6cp_tls(struct sppp *sp)
{
/* indicate to LCP that it must stay alive */
sp->lcp.protos |= (1 << IDX_IPV6CP);
}
-HIDE void
+void
sppp_ipv6cp_tlf(struct sppp *sp)
{
/* we no longer need LCP */
sppp_lcp_check_and_close(sp);
}
-HIDE void
+void
sppp_ipv6cp_scr(struct sppp *sp)
{
char opt[10 /* ifid */ + 4 /* compression, minimum */];
sppp_cp_send(sp, PPP_IPV6CP, CONF_REQ, sp->confid[IDX_IPV6CP], i, opt);
}
#else /*INET6*/
-HIDE void
+void
sppp_ipv6cp_init(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipv6cp_destroy(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipv6cp_up(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipv6cp_down(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipv6cp_open(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipv6cp_close(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipv6cp_TO(void *sp)
{
}
-HIDE int
+int
sppp_ipv6cp_RCR(struct sppp *sp, struct lcp_header *h,
int len)
{
return 0;
}
-HIDE void
+void
sppp_ipv6cp_RCN_rej(struct sppp *sp, struct lcp_header *h,
int len)
{
}
-HIDE void
+void
sppp_ipv6cp_RCN_nak(struct sppp *sp, struct lcp_header *h,
int len)
{
}
-HIDE void
+void
sppp_ipv6cp_tlu(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipv6cp_tld(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipv6cp_tls(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipv6cp_tlf(struct sppp *sp)
{
}
-HIDE void
+void
sppp_ipv6cp_scr(struct sppp *sp)
{
}
}
}
-HIDE void
+void
sppp_chap_init(struct sppp *sp)
{
/* Chap doesn't have STATE_INITIAL at all. */
sp->fail_counter[IDX_CHAP] = 0;
}
-HIDE void
+void
sppp_chap_open(struct sppp *sp)
{
if (sp->myauth.proto == PPP_CHAP &&
/* nothing to be done if we are peer, await a challenge */
}
-HIDE void
+void
sppp_chap_close(struct sppp *sp)
{
if (sp->state[IDX_CHAP] != STATE_CLOSED)
sppp_cp_change_state(&chap, sp, STATE_CLOSED);
}
-HIDE void
+void
sppp_chap_TO(void *cookie)
{
struct sppp *sp = (struct sppp *)cookie;
splx(s);
}
-HIDE void
+void
sppp_chap_tlu(struct sppp *sp)
{
STDDCL;
sppp_phase_network(sp);
}
-HIDE void
+void
sppp_chap_tld(struct sppp *sp)
{
STDDCL;
lcp.Close(sp);
}
-HIDE void
+void
sppp_chap_scr(struct sppp *sp)
{
u_char clen;
/*
* Handle incoming PAP packets. */
-HIDE void
+void
sppp_pap_input(struct sppp *sp, struct mbuf *m)
{
STDDCL;
}
}
-HIDE void
+void
sppp_pap_init(struct sppp *sp)
{
/* PAP doesn't have STATE_INITIAL at all. */
sp->fail_counter[IDX_PAP] = 0;
}
-HIDE void
+void
sppp_pap_open(struct sppp *sp)
{
if (sp->hisauth.proto == PPP_PAP &&
}
}
-HIDE void
+void
sppp_pap_close(struct sppp *sp)
{
if (sp->state[IDX_PAP] != STATE_CLOSED)
* That's the timeout routine if we are authenticator. Since the
* authenticator is basically passive in PAP, we can't do much here.
*/
-HIDE void
+void
sppp_pap_TO(void *cookie)
{
struct sppp *sp = (struct sppp *)cookie;
* we need to retransmit our PAP request since it is apparently lost.
* XXX We should impose a max counter.
*/
-HIDE void
+void
sppp_pap_my_TO(void *cookie)
{
struct sppp *sp = (struct sppp *)cookie;
pap.scr(sp);
}
-HIDE void
+void
sppp_pap_tlu(struct sppp *sp)
{
STDDCL;
sppp_phase_network(sp);
}
-HIDE void
+void
sppp_pap_tld(struct sppp *sp)
{
STDDCL;
lcp.Close(sp);
}
-HIDE void
+void
sppp_pap_scr(struct sppp *sp)
{
u_char idlen, pwdlen;
* mlen == 0.
*/
-HIDE void
+void
sppp_auth_send(const struct cp *cp, struct sppp *sp,
unsigned int type, u_int id, ...)
{
/*
* Flush interface queue.
*/
-HIDE void
+void
sppp_qflush(struct ifqueue *ifq)
{
IF_PURGE(ifq);
/*
* Send keepalive packets, every 10 seconds.
*/
-HIDE void
+void
sppp_keepalive(void *dummy)
{
struct sppp *sp;
/*
* Get both IP addresses.
*/
-HIDE void
+void
sppp_get_ip_addrs(struct sppp *sp, u_int32_t *src, u_int32_t *dst,
u_int32_t *srcmask)
{
* Task adding addresses from process context.
* If an address is 0, leave it the way it is.
*/
-HIDE void
+void
sppp_set_ip_addrs(void *arg1, void *arg2)
{
struct sppp *sp = arg1;
* Task clearing addresses from process context.
* Clear IP addresses.
*/
-HIDE void
+void
sppp_clear_ip_addrs(void *arg1, void *arg2)
{
struct sppp *sp = (struct sppp *)arg1;
/*
* Get both IPv6 addresses.
*/
-HIDE void
+void
sppp_get_ip6_addrs(struct sppp *sp, struct in6_addr *src, struct in6_addr *dst,
struct in6_addr *srcmask)
{
}
/* Task to update my IPv6 address from process context. */
-HIDE void
+void
sppp_update_ip6_addr(void *arg1, void *arg2)
{
struct sppp *sp = arg1;
/*
* Configure my link-local address.
*/
-HIDE void
+void
sppp_set_ip6_addr(struct sppp *sp, const struct in6_addr *src,
const struct in6_addr *dst)
{
/*
* Generate an address that differs from our existing address.
*/
-HIDE void
+void
sppp_suggest_ip6_addr(struct sppp *sp, struct in6_addr *suggest)
{
struct in6_addr myaddr;
}
#endif /*INET6*/
-HIDE int
+int
sppp_get_params(struct sppp *sp, struct ifreq *ifr)
{
int cmd;
}
-HIDE int
+int
sppp_set_params(struct sppp *sp, struct ifreq *ifr)
{
int cmd;
return 0;
}
-HIDE void
+void
sppp_phase_network(struct sppp *sp)
{
int i;
}
-HIDE const char *
+const char *
sppp_cp_type_name(u_char type)
{
static char buf[12];
return buf;
}
-HIDE const char *
+const char *
sppp_auth_type_name(u_short proto, u_char type)
{
static char buf[12];
return buf;
}
-HIDE const char *
+const char *
sppp_lcp_opt_name(u_char opt)
{
static char buf[12];
return buf;
}
-HIDE const char *
+const char *
sppp_ipcp_opt_name(u_char opt)
{
static char buf[12];
}
#ifdef INET6
-HIDE const char *
+const char *
sppp_ipv6cp_opt_name(u_char opt)
{
static char buf[12];
}
#endif
-HIDE const char *
+const char *
sppp_state_name(int state)
{
switch (state) {
return "illegal";
}
-HIDE const char *
+const char *
sppp_phase_name(enum ppp_phase phase)
{
switch (phase) {
return "illegal";
}
-HIDE const char *
+const char *
sppp_proto_name(u_short proto)
{
static char buf[12];
return buf;
}
-HIDE void
+void
sppp_print_bytes(const u_char *p, u_short len)
{
addlog(" %02x", *p++);
addlog("-%02x", *p++);
}
-HIDE void
+void
sppp_print_string(const char *p, u_short len)
{
u_char c;
}
}
-HIDE const char *
+const char *
sppp_dotted_quad(u_int32_t addr)
{
static char s[16];
}
/* a dummy, used to drop uninteresting events */
-HIDE void
+void
sppp_null(struct sppp *unused)
{
/* do just nothing */
* End:
*/
-HIDE void
+void
sppp_set_phase(struct sppp *sp)
{
STDDCL;