Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 59 lines (49 sloc) 1.275 kb
0406018 @msantos Add licensing and do cleanup. In other words, do stuff.
authored
1
2 -define(IPPROTO_IP, 0).
3 -define(IPPROTO_ICMP, 1).
4 -define(IPPROTO_TCP, 6).
5 -define(IPPROTO_UDP, 17).
6
7 -define(ICMP_ECHOREPLY, 0).
8 -define(ICMP_DEST_UNREACH, 3).
9 -define(ICMP_SOURCE_QUENCH, 4).
10 -define(ICMP_REDIRECT, 5).
11 -define(ICMP_ECHO, 8).
12 -define(ICMP_TIME_EXCEEDED, 11).
13 -define(ICMP_PARAMETERPROB, 12).
14 -define(ICMP_TIMESTAMP, 13).
15 -define(ICMP_TIMESTAMPREPLY, 14).
16 -define(ICMP_INFO_REQUEST, 15).
17 -define(ICMP_INFO_REPLY, 16).
18 -define(ICMP_ADDRESS, 17).
19 -define(ICMP_ADDRESSREPLY, 18).
20
21 -record(ether, {
22 dhost, shost, type, crc
23 }).
24
25 -record(ipv4, {
26 valid = false,
27 v = 4, hl = 5, tos = 0, len = 20,
28 id, df = 0, mf = 0,
29 off = 0, ttl = 0, p = ?IPPROTO_TCP, sum = 0,
30 saddr = {127,0,0,1}, daddr = {127,0,0,1}
31 }).
32
33 -record(tcp, {
34 valid = false,
35 sport = 0, dport = 0,
36 seqno = 0,
37 ackno = 0,
38 off = 0, cwr = 0, ece = 0, urg = 0, ack = 0,
39 psh = 0, rst = 0, syn = 0, fin = 0, win = 0,
40 sum, urp = 0,
41 opt = <<>>
42 }).
43
44 -record(udp, {
45 valid = false,
46 sport = 0, dport = 0, ulen = 0, sum = 0
47 }).
48
49 -record(icmp, {
50 valid,
51 type, code, checksum,
52 id, sequence,
53 gateway,
54 un,
55 mtu
56 }).
57
58
Something went wrong with that request. Please try again.