From dccc746af16bdc3e85610e067eebc951b75b73f1 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Wed, 8 Jan 2014 13:02:15 +0000 Subject: proto: add helper function to update protocol context Add a helper function which is to be used to update the protocol update. Signed-off-by: Patrick McHardy protocol[h->base].desc = h->desc; } +/** + * proto_ctx_update: update protocol context for given protocol base + * + * @ctx: protocol context + * @base: protocol base + * @loc: location of the relational expression definiting the context + * @desc: protocol description for the given layer + */ +void proto_ctx_update(struct proto_ctx *ctx, enum proto_bases base, + const struct location *loc, + const struct proto_desc *desc) +{ + ctx->protocol[base].location = *loc; + ctx->protocol[base].desc = desc; +} + #define HDR_TEMPLATE(__name, __dtype, __type, __member) \ PROTO_HDR_TEMPLATE(__name, __dtype, \ offsetof(__type, __member) * 8, \ -- cgit v1.2.3