ng_ether.c (8d8bc0182ea6f8f85409e76e53053487c7d23a84) ng_ether.c (f089869fa51590b56e8fcbdb693f062b30e037bf)
1
2/*
3 * ng_ether.c
4 */
5
6/*-
7 * Copyright (c) 1996-2000 Whistle Communications, Inc.
8 * All rights reserved.

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

277 const priv_p priv = NG_NODE_PRIVATE(node);
278 int error = 0;
279
280 /* If "upper" hook not connected, let packet continue */
281 if (priv->upper == NULL)
282 return (0);
283
284 /* Send it out "upper" hook */
1
2/*
3 * ng_ether.c
4 */
5
6/*-
7 * Copyright (c) 1996-2000 Whistle Communications, Inc.
8 * All rights reserved.

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

277 const priv_p priv = NG_NODE_PRIVATE(node);
278 int error = 0;
279
280 /* If "upper" hook not connected, let packet continue */
281 if (priv->upper == NULL)
282 return (0);
283
284 /* Send it out "upper" hook */
285 NG_OUTBOUND_THREAD_REF();
285 NG_SEND_DATA_ONLY(error, priv->upper, *mp);
286 NG_SEND_DATA_ONLY(error, priv->upper, *mp);
287 NG_OUTBOUND_THREAD_UNREF();
286 return (error);
287}
288
289/*
290 * A new Ethernet interface has been attached.
291 * Create a new node for it, etc.
292 */
293static void

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

411 /* Divert hook is an alias for lower */
412 if (strcmp(name, NG_ETHER_HOOK_DIVERT) == 0)
413 name = NG_ETHER_HOOK_LOWER;
414
415 /* Which hook? */
416 if (strcmp(name, NG_ETHER_HOOK_UPPER) == 0) {
417 hookptr = &priv->upper;
418 NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_upper);
288 return (error);
289}
290
291/*
292 * A new Ethernet interface has been attached.
293 * Create a new node for it, etc.
294 */
295static void

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

413 /* Divert hook is an alias for lower */
414 if (strcmp(name, NG_ETHER_HOOK_DIVERT) == 0)
415 name = NG_ETHER_HOOK_LOWER;
416
417 /* Which hook? */
418 if (strcmp(name, NG_ETHER_HOOK_UPPER) == 0) {
419 hookptr = &priv->upper;
420 NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_upper);
421 NG_HOOK_SET_TO_INBOUND(hook);
419 } else if (strcmp(name, NG_ETHER_HOOK_LOWER) == 0) {
420 hookptr = &priv->lower;
421 NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_lower);
422 } else if (strcmp(name, NG_ETHER_HOOK_ORPHAN) == 0) {
423 hookptr = &priv->orphan;
424 NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_lower);
425 } else
426 return (EINVAL);

--- 411 unchanged lines hidden ---
422 } else if (strcmp(name, NG_ETHER_HOOK_LOWER) == 0) {
423 hookptr = &priv->lower;
424 NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_lower);
425 } else if (strcmp(name, NG_ETHER_HOOK_ORPHAN) == 0) {
426 hookptr = &priv->orphan;
427 NG_HOOK_SET_RCVDATA(hook, ng_ether_rcv_lower);
428 } else
429 return (EINVAL);

--- 411 unchanged lines hidden ---