Deleted Added
sdiff udiff text old ( 68876 ) new ( 69922 )
full compact
1
2/*
3 * ng_ppp.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

--- 22 unchanged lines hidden (view full) ---

31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
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 * $FreeBSD: head/sys/netgraph/ng_ppp.c 68876 2000-11-18 15:17:43Z dwmalone $
40 * $Whistle: ng_ppp.c,v 1.24 1999/11/01 09:24:52 julian Exp $
41 */
42
43/*
44 * PPP node type.
45 */
46
47#include <sys/param.h>

--- 299 unchanged lines hidden (view full) ---

347 NULL,
348 ng_ppp_constructor,
349 ng_ppp_rcvmsg,
350 ng_ppp_rmnode,
351 ng_ppp_newhook,
352 NULL,
353 NULL,
354 ng_ppp_rcvdata,
355 ng_ppp_rcvdata,
356 ng_ppp_disconnect,
357 ng_ppp_cmds
358};
359NETGRAPH_INIT(ppp, &ng_ppp_typestruct);
360
361static int *compareLatencies; /* hack for ng_ppp_intcmp() */
362
363/* Address and control field header */

--- 190 unchanged lines hidden (view full) ---

554 break;
555 }
556 break;
557 case NGM_VJC_COOKIE:
558 {
559 char path[NG_PATHLEN + 1];
560 node_p origNode;
561
562 if ((error = ng_path2node(node,
563 raddr, &origNode, NULL, NULL)) != 0)
564 ERROUT(error);
565 snprintf(path, sizeof(path), "[%lx]:%s",
566 (long)node, NG_PPP_HOOK_VJC_IP);
567 return ng_send_msg(origNode, msg, path, rptr);
568 }
569 default:
570 error = EINVAL;
571 break;
572 }
573 if (rptr)
574 *rptr = resp;
575 else if (resp)

--- 4 unchanged lines hidden (view full) ---

580 return (error);
581}
582
583/*
584 * Receive data on a hook
585 */
586static int
587ng_ppp_rcvdata(hook_p hook, struct mbuf *m, meta_p meta,
588 struct mbuf **ret_m, meta_p *ret_meta)
589{
590 const node_p node = hook->node;
591 const priv_p priv = node->private;
592 const int index = HOOK_INDEX(hook);
593 u_int16_t linkNum = NG_PPP_BUNDLE_LINKNUM;
594 hook_p outHook = NULL;
595 int proto = 0, error;
596

--- 179 unchanged lines hidden (view full) ---

776 return ng_ppp_input(node, 0, NG_PPP_BUNDLE_LINKNUM, m, meta);
777
778 case HOOK_INDEX_VJC_IP:
779 outHook = priv->hooks[HOOK_INDEX_INET];
780 break;
781 }
782
783 /* Send packet out hook */
784 NG_SEND_DATA_RET(error, outHook, m, meta);
785 if (m != NULL || meta != NULL)
786 return ng_ppp_rcvdata(outHook, m, meta, NULL, NULL);
787 return (error);
788}
789
790/*
791 * Destroy node
792 */
793static int
794ng_ppp_rmnode(node_p node)

--- 1241 unchanged lines hidden ---