diff options
author | glebius <glebius@FreeBSD.org> | 2005-04-05 17:22:05 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2005-04-05 17:22:05 +0000 |
commit | bfd07fdc7196218425382637490d0d940dd4d920 (patch) | |
tree | 372d7e839fab2fa0350859e497b8a77a69abdb74 /sys/netgraph/ng_source.h | |
parent | b24803b06b5183f62ba74bb0a23a8c3feee6245f (diff) | |
download | FreeBSD-src-bfd07fdc7196218425382637490d0d940dd4d920.zip FreeBSD-src-bfd07fdc7196218425382637490d0d940dd4d920.tar.gz |
Major overhaul and cleanup of ng_source node.
Functional changes:
- Cut struct source_hookinfo. Just use hook_p pointer.
- Remove "start_now" command. "start" command now requires number of
packets to send as argument. "start" command actually starts sending.
Move the code that actually starts sending from ng_source_rcvmsg()
to ng_source_start().
- Remove check for NG_SOURCE_ACTIVE in ng_source_stop(). We can be called
with flag cleared (see begin of ng_source_intr()).
- If NG_SEND_DATA_ONLY() use log(LOG_DEBUG) instead of printf(). Otherwise
we will *flood* console.
- Add ng_connect_t method, which sends NGM_ETHER_GET_IFNAME command
to "output" hook. Cut ng_source_request_output_ifp(). Refactor
ng_source_store_output_ifp() to use ifunit() and don't muck through
interface list.
- Add "setiface" command, which gives ability to configure interface
in case when ng_source_connect() failed. This happens, when we are not
connected directly to ng_ether(4) node.
- Remove KASSERTs, which can never fire.
- Don't check for M_PKTHDR in rcvdata method. netgraph(4) does this
for us.
Style:
- Assign sc_p = NG_NODE_PRIVATE(node) in declaration, to be
consistent with style of other nodes.
- Sort variables.
- u_intXX -> uintXX.
- Dots at ends of comments.
Sponsored by: Rambler
Diffstat (limited to 'sys/netgraph/ng_source.h')
-rw-r--r-- | sys/netgraph/ng_source.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netgraph/ng_source.h b/sys/netgraph/ng_source.h index 1f3fc96..0d84f06 100644 --- a/sys/netgraph/ng_source.h +++ b/sys/netgraph/ng_source.h @@ -44,7 +44,7 @@ /* Node type name and magic cookie */ #define NG_SOURCE_NODE_TYPE "source" -#define NGM_SOURCE_COOKIE 1034346805 +#define NGM_SOURCE_COOKIE 1110646684 /* Hook names */ #define NG_SOURCE_HOOK_INPUT "input" @@ -82,7 +82,7 @@ enum { NGM_SOURCE_START, /* start sending queued data */ NGM_SOURCE_STOP, /* stop sending queued data */ NGM_SOURCE_CLR_DATA, /* clear the queued data */ - NGM_SOURCE_START_NOW, /* start on non-ether output */ + NGM_SOURCE_SETIFACE, /* configure downstream iface */ }; #endif /* _NETGRAPH_NG_SOURCE_H_ */ |