libschc
schc_config_example.h
Go to the documentation of this file.
1 #ifndef SCHC_CONFIG_H_
2 #define SCHC_CONFIG_H_
3 
4 #include <stdio.h>
5 #include <unistd.h>
6 #include <inttypes.h>
7 
8 #define CLICK 0
9 #define SCHC_BUFSIZE 256
10 
11 #define DYNAMIC_MEMORY 0
12 
13 #define SCHC_CONF_RX_CONNS 1
14 #define SCHC_CONF_MBUF_POOL_LEN 32
15 
16 #define USE_COAP 1
17 #define USE_UDP 1
18 #define USE_IPv6 1
19 
20 #define NUMBER_OF_LAYERS USE_COAP + USE_UDP + USE_IPv6
21 
22 // the maximum length of a single header field
23 // e.g. you can use 4 ipv6 source iid addresses with match-mapping
24 #define MAX_FIELD_LENGTH 32
25 
26 // maximum number of header fields present in a rule (vertical, top to bottom)
27 #define IPV6_FIELDS 10
28 #define UDP_FIELDS 4
29 #define COAP_FIELDS 12
30 
31 #define MAX_HEADER_LENGTH 256
32 
33 #define MAX_COAP_HEADER_LENGTH 64
34 #define MAX_PAYLOAD_LENGTH 256
35 #define MAX_COAP_MSG_SIZE (MAX_COAP_HEADER_LENGTH + MAX_PAYLOAD_LENGTH)
36 
37 // the maximum transfer unit of the underlying technology
38 #define MAX_MTU_LENGTH 242
39 
40 // the maximum number of tokens inside a JSON structure
41 #define JSON_TOKENS 16
42 
43 #define RULE_SIZE_BITS 4
44 
45 #define DEBUG_PRINTF(...) printf(__VA_ARGS__) //log_print_string(__VA_ARGS__)
46 
47 // the number of ack attempts
48 #define MAX_ACK_REQUESTS 3
49 
50 // the number of FCN bits
51 #define FCN_SIZE_BITS 3
52 
53 // the number of DTAG bits
54 #define DTAG_SIZE_BITS 0
55 
56 // the number of bytes the MIC consists of
57 #define MIC_SIZE_BYTES 4
58 
59 // the length of the bitmap
60 #define BITMAP_SIZE_BYTES 2 // pow(2, FCN_SIZE_BITS) / 8
61 
62 #endif