diff options
author | David Perry <boolean263@protonmail.com> | 2023-05-09 07:01:21 +0000 |
---|---|---|
committer | AndersBroman <a.broman58@gmail.com> | 2023-05-09 07:01:21 +0000 |
commit | a93eb2be8514f6164a851f093b257b294e307e0c (patch) | |
tree | 8004e6c4b451d1aa4d95cb7162db4015a62da2a0 /epan/dissectors/asn1/ocsp | |
parent | 0a651f7cc1fc8c4ff5212c79ec7d8f286433f2eb (diff) |
Use `register_dissector()` in ASN.1 dissectors
Diffstat (limited to 'epan/dissectors/asn1/ocsp')
-rw-r--r-- | epan/dissectors/asn1/ocsp/packet-ocsp-template.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/asn1/ocsp/packet-ocsp-template.c b/epan/dissectors/asn1/ocsp/packet-ocsp-template.c index dd1736d273..412ee9579b 100644 --- a/epan/dissectors/asn1/ocsp/packet-ocsp-template.c +++ b/epan/dissectors/asn1/ocsp/packet-ocsp-template.c @@ -29,6 +29,9 @@ void proto_register_ocsp(void); void proto_reg_handoff_ocsp(void); +static dissector_handle_t ocsp_request_handle; +static dissector_handle_t ocsp_response_handle; + /* Initialize the protocol and registered fields */ int proto_ocsp = -1; static int hf_ocsp_responseType_id = -1; @@ -109,16 +112,13 @@ void proto_register_ocsp(void) { proto_register_field_array(proto_ocsp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + /* Register dissectors */ + ocsp_request_handle = register_dissector(PFNAME "_req", dissect_ocsp_request, proto_ocsp); + ocsp_response_handle = register_dissector(PFNAME "_res", dissect_ocsp_response, proto_ocsp); } /*--- proto_reg_handoff_ocsp -------------------------------------------*/ void proto_reg_handoff_ocsp(void) { - dissector_handle_t ocsp_request_handle; - dissector_handle_t ocsp_response_handle; - - ocsp_request_handle = create_dissector_handle(dissect_ocsp_request, proto_ocsp); - ocsp_response_handle = create_dissector_handle(dissect_ocsp_response, proto_ocsp); - dissector_add_string("media_type", "application/ocsp-request", ocsp_request_handle); dissector_add_string("media_type", "application/ocsp-response", ocsp_response_handle); |