diff options
author | emaste <emaste@FreeBSD.org> | 2007-03-01 23:16:17 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2007-03-01 23:16:17 +0000 |
commit | 6086e6d82ae2cc0542ea4b8f999a22d2e04472bb (patch) | |
tree | 8e31afcbd1d06f5221f742419922b9fbd8578693 /sys/netgraph/ng_source.h | |
parent | d38fdb51a0c6e3f8ae006b01ab0d882fcaabf54e (diff) | |
download | FreeBSD-src-6086e6d82ae2cc0542ea4b8f999a22d2e04472bb.zip FreeBSD-src-6086e6d82ae2cc0542ea4b8f999a22d2e04472bb.tar.gz |
Add "settimestamp" and "gettimestamp" messages, providing the the ability
to embed a timestamp (struct timeval) in outgoing packets. The message
specifies the offset at which the timestamp should be inserted.
NG_SOURCE(4) gives an example usage that queues an ICMP packet. Using that
example, the following command will insert a timestamp in the ICMP's data
payload:
ngctl msg src0: settimestamp '{ offset=0x2a flags=1 }'
Sponsored by: Sandvine Incorporated
Diffstat (limited to 'sys/netgraph/ng_source.h')
-rw-r--r-- | sys/netgraph/ng_source.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/netgraph/ng_source.h b/sys/netgraph/ng_source.h index fcfb151..b3db2cf 100644 --- a/sys/netgraph/ng_source.h +++ b/sys/netgraph/ng_source.h @@ -78,6 +78,21 @@ extern const struct ng_parse_type ng_source_timeval_type; { NULL } \ } +/* Packet embedding info for NGM_SOURCE_GET/SET_TIMESTAMP */ +struct ng_source_embed_info { + uint16_t offset; /* offset from ethernet header */ + uint8_t flags; + uint8_t spare; +}; +#define NGM_SOURCE_EMBED_ENABLE 0x01 /* enable embedding */ + +/* Keep this in sync with the above structure definition. */ +#define NG_SOURCE_EMBED_TYPE_INFO { \ + { "offset", &ng_parse_hint16_type }, \ + { "flags", &ng_parse_hint8_type }, \ + { NULL } \ +} + /* Netgraph commands */ enum { NGM_SOURCE_GET_STATS = 1, /* get stats */ @@ -88,6 +103,8 @@ enum { NGM_SOURCE_CLR_DATA, /* clear the queued data */ NGM_SOURCE_SETIFACE, /* configure downstream iface */ NGM_SOURCE_SETPPS, /* rate-limiting packets per second */ + NGM_SOURCE_SET_TIMESTAMP, /* embed xmit timestamp */ + NGM_SOURCE_GET_TIMESTAMP, }; #endif /* _NETGRAPH_NG_SOURCE_H_ */ |