Lines Matching +full:software +full:- +full:dl
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 1996 - 2001 Brian Somers <brian@Awfulhak.org>
5 * based on work by Toshiharu OHNO <tony-o@iij.ad.jp>
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
80 #define MAXPAPCODE (sizeof papcodes / sizeof papcodes[0] - 1)
85 struct bundle *bundle = authp->physical->dl->bundle; in pap_Req()
91 namelen = strlen(bundle->cfg.auth.name); in pap_Req()
92 keylen = strlen(bundle->cfg.auth.key); in pap_Req()
95 log_Printf(LogPHASE, "Pap Output: %s ********\n", bundle->cfg.auth.name); in pap_Req()
96 if (*bundle->cfg.auth.name == '\0') in pap_Req()
99 lh.id = authp->id; in pap_Req()
105 memcpy(cp, bundle->cfg.auth.name, namelen); in pap_Req()
108 memcpy(cp, bundle->cfg.auth.key, keylen); in pap_Req()
109 link_PushPacket(&authp->physical->link, bp, bundle, in pap_Req()
110 LINK_QUEUES(&authp->physical->link) - 1, PROTO_PAP); in pap_Req()
122 lh.id = authp->id; in SendPapCode()
138 link_PushPacket(&authp->physical->link, bp, authp->physical->dl->bundle, in SendPapCode()
139 LINK_QUEUES(&authp->physical->link) - 1, PROTO_PAP); in SendPapCode()
145 struct bundle *bundle = authp->physical->dl->bundle; in pap_Success()
147 datalink_GotAuthname(authp->physical->dl, authp->in.name); in pap_Success()
149 if (*bundle->radius.cfg.file && bundle->radius.repstr) in pap_Success()
150 SendPapCode(authp, PAP_ACK, bundle->radius.repstr); in pap_Success()
154 authp->physical->link.lcp.auth_ineed = 0; in pap_Success()
156 physical_Login(authp->physical, authp->in.name); in pap_Success()
158 if (authp->physical->link.lcp.auth_iwait == 0) in pap_Success()
163 datalink_AuthOk(authp->physical->dl); in pap_Success()
170 datalink_AuthNotOk(authp->physical->dl); in pap_Failure()
183 struct authinfo *authp = &p->dl->pap; in pap_Input()
189 log_Printf(LogERROR, "pap_Input: Not a physical link - dropped\n"); in pap_Input()
196 log_Printf(LogPHASE, "Unexpected pap input - dropped !\n"); in pap_Input()
202 ntohs(authp->in.hdr.length) == 0) { in pap_Input()
207 if (authp->in.hdr.code == 0 || authp->in.hdr.code > MAXPAPCODE) { in pap_Input()
208 log_Printf(LogPHASE, "Pap Input: %d: Bad PAP code !\n", authp->in.hdr.code); in pap_Input()
213 if (authp->in.hdr.code != PAP_REQUEST && authp->id != authp->in.hdr.id && in pap_Input()
217 papcodes[authp->in.hdr.code], authp->in.hdr.id, authp->id); in pap_Input()
222 authp->id = authp->in.hdr.id; /* We respond with this id */ in pap_Input()
226 if (authp->in.hdr.code == PAP_ACK) { in pap_Input()
229 * nlen (a one-byte length). Show the rest of the ack packet in pap_Input()
237 txt = authp->in.name; in pap_Input()
238 txtlen = strlen(authp->in.name); in pap_Input()
246 papcodes[authp->in.hdr.code], txtlen, txt); in pap_Input()
248 switch (authp->in.hdr.code) { in pap_Input()
267 if (*bundle->radius.cfg.file) { in pap_Input()
268 if (!radius_Authenticate(&bundle->radius, authp, authp->in.name, in pap_Input()
273 if (auth_Validate(bundle, authp->in.name, key)) in pap_Input()
283 if (p->link.lcp.auth_iwait == PROTO_PAP) { in pap_Input()
284 p->link.lcp.auth_iwait = 0; in pap_Input()
285 if (p->link.lcp.auth_ineed == 0) in pap_Input()
291 datalink_AuthOk(p->dl); in pap_Input()
297 datalink_AuthNotOk(p->dl); in pap_Input()