-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsctpfuzz.h
133 lines (117 loc) · 2.95 KB
/
sctpfuzz.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
//
// sctpfuzz.h
//
//
// Created by ilja van sprundel on 8/11/17.
//
//
#ifndef sctpfuzz_h
#define sctpfuzz_h
#include <stdio.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/time.h>
#include <signal.h>
struct iphdr {
unsigned char v_hdrlen;
unsigned char tos;
unsigned short tot_len;
unsigned short id;
unsigned short frag_off;
unsigned char ttl;
unsigned char protocol;
unsigned short check;
unsigned int saddr;
unsigned int daddr;
}__attribute__((packed));
struct sctp_comm_hdr {
unsigned short sport;
unsigned short dport;
unsigned int tag;
unsigned int check;
}__attribute__((packed));
struct sctp_chunk_hdr {
unsigned char type;
unsigned char flags;
unsigned short len;
}__attribute__((packed));
struct sctp_init_chunk{
unsigned int tag;
unsigned int window_credit;
unsigned short oob_streams;
unsigned short iob_streams;
unsigned int tsn;
}__attribute__((packed));
struct sctp_init_param {
unsigned short type;
unsigned short len;
}__attribute__((packed));
struct args {
char *source;
char *dest;
unsigned int seed;
unsigned int nr_packets;
unsigned short sport;
unsigned short dport;
unsigned int max_nr_params;
unsigned int timeout;
int skip;
};
#define LOOP_NR 100000
#define PACKET_SIZE 1000000
#define SENTO_TIMEOUT 80
#define DEFAULT_SPORT 1337
#define DEFAULT_DPORT 2448
#define SCTP_DATA 0
#define SCTP_INIT 1
#define SCTP_INIT_ACK 2
#define SCTP_SACK 3
#define SCTP_HEARTBEAT 4
#define SCTP_HEARTBEAT_ACK 5
#define SCTP_ABORT 6
#define SCTP_SHUTDOWN 7
#define SCTP_SHUTDOWN_ACK 8
#define SCTP_ERROR 9
#define SCTP_OOKIE_ECHO 10
#define SCTP_COOKIE_ACK 11
#define SCTP_ECNE 12
#define SCTP_CWR 13
#define SCTP_SHUTDOWN_COMPLETE 14
#define SCTP_AUTH 15
#define SCTP_ASCONF_ACK 128
#define SCTP_RECONF 130
#define SCTP_PADDING 132
#define SCTP_FORWARD_TSN 192
#define SCTP_PARAM_HEARTBEAT 1
#define SCTP_PARAM_IPv4 5
#define SCTP_PARAM_IPv6 6
#define SCTP_PARAM_STATE_COOKIE 7
#define SCTP_PARAM_UNRECOGNIZED_PARAM 8
#define SCTP_PARAM_COOKIE_PRESERVATIVE 9
#define SCTP_PARAM_HOSTNAME 11
#define SCTP_PARAM_ADDRESS_TYPES 12
#define SCTP_PARAM_OUT_SSN 13
#define SCTP_PARAM_IN_SSN 14
#define SCTP_PARAM_SSN_RESET 15
#define SCTP_PARAM_RECONFIG_RESPONSE 16
#define SCTP_PARAM_ADD_OUT_REQUEST 17
#define SCTP_PARAM_ADD_IN_REQUEST 18
#define SCTP_PARAM_ECN 32768
#define SCTP_PARAM_RAND 32770
#define SCTP_PARAM_CHUNK_LIST 32771
#define SCTP_PARAM_HMAC_ALG 32772
#define SCTP_PARAM_PADDING 32773
#define SCTP_PARAM_SUPPORT_EXT 32776
#define SCTP_PARAM_FORWARD_TSN 49152
#define SCTP_PARAM_ADD_IP 49153
#define SCTP_PARAM_DEL_IP 49154
#define SCTP_PARAM_ERROR_INDICATION 49155
#define SCTP_PARAM_SET_PRIMARY_ADDRESS 49156
#define SCTP_PARAM_SUCCESS_INDICATION 49157
#define SCTP_PARAM_ADAPTIVE_LAYER_INDICATION 49158
#endif /* sctpfuzz_h */