1 2/* 3 * ng_mppc.c 4 * 5 * Copyright (c) 1996-2000 Whistle Communications, Inc. 6 * All rights reserved. 7 * 8 * Subject to the following obligations and disclaimer of warranty, use and --- 23 unchanged lines hidden (view full) --- 32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 35 * OF SUCH DAMAGE. 36 * 37 * Author: Archie Cobbs <archie@freebsd.org> 38 * 39 * $Whistle: ng_mppc.c,v 1.4 1999/11/25 00:10:12 archie Exp $ |
40 * $FreeBSD: head/sys/netgraph/ng_mppc.c 69922 2000-12-12 18:52:14Z julian $ |
41 */ 42 43/* 44 * Microsoft PPP compression (MPPC) and encryption (MPPE) netgraph node type. 45 * 46 * You must define one or both of the NETGRAPH_MPPC_COMPRESSION and/or 47 * NETGRAPH_MPPC_ENCRYPTION options for this node type to be useful. 48 */ --- 99 unchanged lines hidden (view full) --- 148 NULL, 149 ng_mppc_constructor, 150 ng_mppc_rcvmsg, 151 ng_mppc_rmnode, 152 ng_mppc_newhook, 153 NULL, 154 NULL, 155 ng_mppc_rcvdata, |
156 ng_mppc_disconnect, 157 NULL 158}; 159NETGRAPH_INIT(mppc, &ng_mppc_typestruct); 160 161/* Fixed bit pattern to weaken keysize down to 40 bits */ 162static const u_char ng_mppe_weakenkey[3] = { 0xd1, 0x26, 0x9e }; 163 --- 177 unchanged lines hidden (view full) --- 341 return (error); 342} 343 344/* 345 * Receive incoming data on our hook. 346 */ 347static int 348ng_mppc_rcvdata(hook_p hook, struct mbuf *m, meta_p meta, |
349 struct mbuf **ret_m, meta_p *ret_meta, struct ng_mesg **resp) |
350{ 351 const node_p node = hook->node; 352 const priv_p priv = node->private; 353 struct mbuf *out; 354 int error; 355 356 /* Compress and/or encrypt */ 357 if (hook == priv->xmit.hook) { --- 21 unchanged lines hidden (view full) --- 379 if (error == EINVAL && priv->ctrlpath != NULL) { 380 struct ng_mesg *msg; 381 382 /* Need to send a reset-request */ 383 NG_MKMESSAGE(msg, NGM_MPPC_COOKIE, 384 NGM_MPPC_RESETREQ, 0, M_NOWAIT); 385 if (msg == NULL) 386 return (error); |
387 /* XXX can we use a hook instead of ctrlpath? */ 388 ng_send_msg(node, msg, priv->ctrlpath, 389 NULL, NULL, NULL); |
390 } 391 return (error); 392 } 393 m_freem(m); 394 NG_SEND_DATA(error, priv->recv.hook, out, meta); 395 return (error); 396 } 397 --- 399 unchanged lines hidden --- |