diff options
author | Campus <campus@ntop.org> | 2016-05-12 23:17:41 +0200 |
---|---|---|
committer | Campus <campus@ntop.org> | 2016-05-12 23:17:41 +0200 |
commit | 6edb280cc7db6f10c72a36e8165397e59295cdd6 (patch) | |
tree | 40238d93f8e1f56ebce488ea9ca5a475e174d025 /src/lib/protocols/quic.c | |
parent | 32847fcfd0c33cf046bcdd7bd9aefaea62faaaa4 (diff) |
update test pcap due to modification of quic protocol - improved readability of code
Diffstat (limited to 'src/lib/protocols/quic.c')
-rw-r--r-- | src/lib/protocols/quic.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c index 5370b9209..a3e247134 100644 --- a/src/lib/protocols/quic.c +++ b/src/lib/protocols/quic.c @@ -45,11 +45,15 @@ #define DIGIT(X, Y, Z) ((isdigit(X) && isdigit(Y) && isdigit(Z)) ? (INT(X) * 100 + INT(Y) * 10 + INT(Z)) : 0) #ifdef NDPI_PROTOCOL_QUIC + + + static void ndpi_int_quic_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QUIC, NDPI_PROTOCOL_UNKNOWN); } + static int connect_id(const unsigned char pflags) { u_int cid_len; @@ -69,6 +73,7 @@ static int connect_id(const unsigned char pflags) return cid_len + 1; } + static int sequence(const unsigned char *payload) { char test[6] = {0}; @@ -94,6 +99,7 @@ static int sequence(const unsigned char *payload) return memcmp(payload + cid_offs, test, seq_lens); } + void ndpi_search_quic(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { struct ndpi_packet_struct *packet = &flow->packet; @@ -154,10 +160,14 @@ void ndpi_search_quic(struct ndpi_detection_module_struct *ndpi_struct, struct n } } + void init_quic_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) { - ndpi_set_bitmask_protocol_detection("QUIC", ndpi_struct, detection_bitmask, *id, NDPI_PROTOCOL_QUIC, ndpi_search_quic, - NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, SAVE_DETECTION_BITMASK_AS_UNKNOWN, ADD_TO_DETECTION_BITMASK); + ndpi_set_bitmask_protocol_detection("QUIC", ndpi_struct, detection_bitmask, *id, + NDPI_PROTOCOL_QUIC, + ndpi_search_quic, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, ADD_TO_DETECTION_BITMASK); *id += 1; } |