1 /*
2  * BER support functions
3  *
4  * Copyright (C) 2014-2021 Cisco and/or its affiliates. All rights reserved.
5  * Copyright (C) 2007-2013 Sourcefire, Inc. All Rights Reserved
6  *
7  * Writen by Patrick Mullen <pmullen@sourcefire.com>
8  *
9  * This file may contain proprietary rules that were created, tested and
10  * certified by Sourcefire, Inc. (the "VRT Certified Rules") as well as
11  * rules that were created by Sourcefire and other third parties and
12  * distributed under the GNU General Public License (the "GPL Rules").  The
13  * VRT Certified Rules contained in this file are the property of
14  * Sourcefire, Inc. Copyright 2005 Sourcefire, Inc. All Rights Reserved.
15  * The GPL Rules created by Sourcefire, Inc. are the property of
16  * Sourcefire, Inc. Copyright 2002-2005 Sourcefire, Inc. All Rights
17  * Reserved.  All other GPL Rules are owned and copyrighted by their
18  * respective owners (please see www.snort.org/contributors for a list of
19  * owners and their respective copyrights).  In order to determine what
20  * rules are VRT Certified Rules or GPL Rules, please refer to the VRT
21  * Certified Rules License Agreement.
22 */
23 
24 #ifndef MISC_BER_H
25 #define MISC_BER_H
26 
27 #include "sf_snort_plugin_api.h"
28 #include "sf_snort_packet.h"
29 
30 
31 typedef struct {
32    u_int8_t type;
33    u_int32_t total_len;
34    u_int32_t data_len;
35    union {
36       const u_int8_t *data_ptr;
37       u_int32_t int_val;
38    } data;
39 } BER_ELEMENT;
40 
41 int ber_get_size(SFSnortPacket *, const u_int8_t *, u_int32_t *, u_int32_t *);
42 int ber_get_int(const u_int8_t *, u_int32_t, u_int32_t *);
43 int ber_get_element(SFSnortPacket *, const u_int8_t *, BER_ELEMENT *);
44 
45 #endif /* MISC_BER_H */
46 
47