Match endpoints by destination port

This commit is contained in:
Daniel
2020-10-15 12:13:25 +02:00
parent 0d09cd9c2d
commit 0e83268356
3 changed files with 18 additions and 3 deletions

View File

@@ -37,9 +37,12 @@ type Entity struct {
// Protocol is the protcol number used by the connection.
Protocol uint8
// Port is the destination port of the connection
// Port is the remote port of the connection
Port uint16
// dstPort is the destination port of the connection
dstPort uint16
// Domain is the target domain of the connection.
Domain string
@@ -92,6 +95,16 @@ func (e *Entity) Init() *Entity {
return e
}
// AddDstPort adds the destination port.
func (e *Entity) AddDstPort(dstPort uint16) {
e.dstPort = dstPort
}
// AddDstPort adds the destination port.
func (e *Entity) DstPort() uint16 {
return e.dstPort
}
// FetchData fetches additional information, meant to be called before persisting an entity record.
func (e *Entity) FetchData(ctx context.Context) {
e.getLocation(ctx)