-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
49 lines (41 loc) · 774 Bytes
/
types.go
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
package main
//Adapted from the excellent worker here:
//https://github.com/JustinTimperio/gomap/blob/master/gomap.go
type NetProto int
//declare the protocol enum type
const (
IPV4 NetProto = iota
IPV6
)
func (proto NetProto) String() string {
switch proto {
case IPV4:
return "ip4"
case IPV6:
return "ip6"
}
return "unkown"
}
type ScanOptions struct {
Proto NetProto
TimeoutSeconds int
PPS int
}
func NewScanOptions() *ScanOptions {
return &ScanOptions{Proto: IPV4, TimeoutSeconds: 2, PPS: 6000}
}
type tcpHeader struct {
Src uint16
Dst uint16
Seq uint32
Ack uint32
Flags uint16
Window uint16
ChkSum uint16
UPointer uint16
}
type tcpOption struct {
Kind uint8
Length uint8
Data []byte
}