trafgen: proto: Store registered protocols in an array
commit48178cd649b48196e16e0481ca44dea206fe04d4
authorTobias Klauser <tklauser@distanz.ch>
Tue, 9 Aug 2016 10:09:23 +0000 (9 12:09 +0200)
committerTobias Klauser <tklauser@distanz.ch>
Tue, 9 Aug 2016 11:56:10 +0000 (9 13:56 +0200)
tree314f976af644cffe639c8c8655dbe294cac7481b
parent7c14a23050eed1575a696dd77c4d5d845eab22c9
trafgen: proto: Store registered protocols in an array

Protocols are registered early at startup and aren't changed at runtime.
In order to speed up lookup while parsing, store the pointers to the
protocol definitions (struct proto_hdr) in an array, indexed by protocol
id rather than in a linked list.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
trafgen_proto.c
trafgen_proto.h