summaryrefslogtreecommitdiff
path: root/datastructs.go
blob: 1c088e39ed12fd0c340378a7ba42d6e777ed1ab4 (plain)
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
package main

import (
	"time"
)

type RawData struct {
	Ip_src          string `json:ip_src`
	Ip_dst          string `json:ip_dst`
	As_src          int    `json:as_src`
	As_dst          int    `json:as_dst`
	Port_src        int    `json:port_src`
	Port_dst        int    `json:port_dst`
	Packets         int    `json:packets`
	Pkt_len_distrib string `json:pkt_len_distrib`
	time            time.Time
}

type cleanedData struct {
	ipbSrc     string
	ipbDst     string
	asSrc      int
	asDst      int
	portSrc    int
	portDst    int
	occurences int
	volume     string
	time       time.Time
}

func (cd *cleanedData) equals(other *cleanedData) bool {
	return cd.ipbSrc == other.ipbSrc &&
		cd.ipbDst == other.ipbDst &&
		cd.asSrc == other.asSrc &&
		cd.asDst == other.asDst &&
		cd.portSrc == other.portSrc &&
		cd.portDst == other.portDst &&
		cd.volume == other.volume &&
		cd.time == other.time
}