Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 83 lines (58 sloc) 2.297 kb
94fce13 @msantos Split epcap_net into a new repository and rename
authored
1
2 An Erlang network protocol library.
3
4941f02 @msantos Markdownify README
authored
4 Originally part of epcap:
5 <http://github.com/msantos/epcap>
94fce13 @msantos Split epcap_net into a new repository and rename
authored
6
7
4941f02 @msantos Markdownify README
authored
8 ## EXPORTS
94fce13 @msantos Split epcap_net into a new repository and rename
authored
9
4941f02 @msantos Markdownify README
authored
10 pkt:decapsulate(Data) -> Packet
11
12 Types Data = binary()
13 Packet = [ Headers, Payload ]
14 Headers = Header
15 Header = {ether, binary()} | {arp, binary()} | {null, binary()} |
16 {linux_cooked, binary()} | {ipv4, binary()} |
17 {ipv6, binary()} | {tcp, binary()} | {udp, binary()} |
18 {sctp, binary()} | {icmp, binary()} | {unsupported, binary()}
19 Payload = binary()
20
21 Attempts to decapsulate the packet into a list of tuples.
94fce13 @msantos Split epcap_net into a new repository and rename
authored
22
23
24 The following functions create the protocol headers, converting between
25 records and binaries. See include/pkt.hrl for definition of the record
26 types.
27
4941f02 @msantos Markdownify README
authored
28 ether(Packet) -> {#ether{}, Payload} | binary()
29 null(Packet) -> {#null{}, Payload} | binary()
30 linux_cooked(Packet) -> {#linux_cooked{}, Payload} | binary()
31 arp(Packet) -> {#arp{}, Payload} | binary()
32 ipv4(Packet) -> {#ipv4{}, Payload} | binary()
33 ipv6(Packet) -> {#ipv6{}, Payload} | binary()
34 tcp(Packet) -> {#tcp{}, Payload} | binary()
35 sctp(Packet) -> {#sctp{}, Payload} | binary()
36 udp(Packet) -> {#udp{}, Payload} | binary()
37 icmp(Packet) -> {#icmp{}, Payload} | binary()
7b0ccf4 @msantos Add support for ICMPv6 packets
authored
38 icmp6(Packet) -> {#icmp6{}, Payload} | binary()
4941f02 @msantos Markdownify README
authored
39
40 Types Packet = Header | binary()
41 Header = #ether{} | #null{} | #linux_cooked{} | #arp{} |
7b0ccf4 @msantos Add support for ICMPv6 packets
authored
42 #ipv4{} | #ipv6{} | #tcp{} | #sctp{} | #udp{} |
43 #icmp{} | #icmp6{}
44
4941f02 @msantos Markdownify README
authored
45
46 makesum(Packet) -> integer()
47
48 Types Packet = IPv4_header | [IPv4_header, Header, Payload]
49 IPv4_header = #ipv4{}
50 Header = #tcp{} | #udp{}
51 Payload = binary()
52
53 Calculate the checksum of the packet.
54
55
56 ## TODO
94fce13 @msantos Split epcap_net into a new repository and rename
authored
57
b4cacba @msantos Update docs
authored
58 * DLTs
59 * DLT_SLIP
60 * DLT_PPP
61 * DLT_RAW
62 * DLT\_PPP\_SERIAL
63 * DLT\_PPP\_ETHER
64 * DLT\_IEEE802\_11
65 * DLT_LOOP
66
94fce13 @msantos Split epcap_net into a new repository and rename
authored
67
4941f02 @msantos Markdownify README
authored
68 ## CONTRIBUTORS
94fce13 @msantos Split epcap_net into a new repository and rename
authored
69
b4cacba @msantos Update docs
authored
70 * Olivier Girondel:
71 * preliminary IPv6 support
72
73 * Harald Welte:
74 * support reading packets from pcap file
75 * SCTP support
76 * datalink types
94fce13 @msantos Split epcap_net into a new repository and rename
authored
77
b4cacba @msantos Update docs
authored
78 * Gregory Haskins:
79 * application file fix
c153830 @msantos Update contrib
authored
80
81 * Alexey Larin
82 * GRE support
Something went wrong with that request. Please try again.