From 88b359d2aa7e3a2bcbe166ca39d93cfd7e04ef08 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Mon, 1 Feb 2016 19:01:35 +0200 Subject: trafgen: proto: Simplify getting lower protocol after init Change proto_header_init(...) and proto_lower_default_add(...) functions to return struct proto_hdr * to do not call proto_current_header(...) after, so it makes more sense to get struct proto_hdr * right after initializing protocol by id. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- trafgen_proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'trafgen_proto.h') diff --git a/trafgen_proto.h b/trafgen_proto.h index 02a8cc5..2d74f4c 100644 --- a/trafgen_proto.h +++ b/trafgen_proto.h @@ -55,10 +55,10 @@ struct proto_hdr { extern void protos_init(const char *dev); extern void proto_header_register(struct proto_hdr *hdr); -extern void proto_header_init(enum proto_id pid); +extern struct proto_hdr *proto_header_init(enum proto_id pid); extern void proto_header_finish(struct proto_hdr *hdr); extern void proto_packet_finish(void); -extern void proto_lower_default_add(enum proto_id pid); +extern struct proto_hdr *proto_lower_default_add(enum proto_id pid); extern struct proto_hdr *proto_current_header(void); extern struct proto_hdr *proto_lower_header(struct proto_hdr *hdr); -- cgit v1.2.3-54-g00ecf