Add new syntax for DNS header generation via 'dns()' proto function.
The fields are supported:
id - 16 bit identifier
qr - message is a query(0) or response(1)
op|oper - specified kind of query
aanswer - authoritative answe
Add trafgen_l7.c module with DNS proto header generation with
support of filling DNS query/answer/authority/additional sections
as sub headers.
Introcuded new concept as 'sub header' which is needed to easy handle
DNS sections which might be added on-demand, and to simplify using
sub-header as reg
Use proto_field_set_xxx(field, ...) instead of
proto_hdr_field_set_xxx(hdr, fid, ...) to be more generic and do not
depent on 'hdr' variable.
Signed-off-by: Vadim Kochan
---
trafgen_parser.y | 13 ++---
trafgen_proto.c | 5 +
trafgen_proto.h | 1 +
3 files changed, 12 insertions
Rename token member to as it is used only for MAC
address parsing, for dynamic sized bytes array we have an .
Signed-off-by: Vadim Kochan
---
trafgen_lexer.l | 2 +-
trafgen_parser.y | 12 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/trafgen_lexer.l b/trafgen_le
Add trafgen_l7.c module with DNS proto header generation with
support of filling DNS query/answer/authority/additional sections
as sub headers.
Introcuded new concept as 'sub header' which is needed to easy handle
DNS sections which might be added on-demand, and to simplify using
sub-header as reg
It is quite tricky to set field value with a variable length
(i.e. DNS query name), to make it possible the field
needs to be added to header with 'len=0' in that case there
will be no any payload allocation, but only while setting the field
value the packet will be appended with a real length byte
Add 'len' parameter to *_set_bytes(...) functoins to have better
control over it.
Signed-off-by: Vadim Kochan
---
trafgen_l2.c | 6 +++---
trafgen_parser.y | 4 ++--
trafgen_proto.c | 48
trafgen_proto.h | 4 ++--
4 files changed, 31 inse
Add str2fqdn for converting hostname string into DNS name notation:
www..yy.com -> 3www42yy3com0
Returned string must be freed after use by the caller.
Signed-off-by: Vadim Kochan
---
str.c | 37 +
str.h | 1 +
2 files changed, 38 insertions(+)