-
Notifications
You must be signed in to change notification settings - Fork 0
/
port.go
50 lines (39 loc) · 1.42 KB
/
port.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
50
package host
/*
AIMS (Attacked Infrastructure Modular Specification)
Copyright (C) 2021 Maxime Landon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import (
"context"
"github.com/maxlandon/aims/proto/host"
"github.com/maxlandon/gondor/maltego"
)
// Port - A port on a Host.
// The type has several categories of fields: general information,
// and Nmap-compliant fields (status, owner, service, scripts etc).
type Port host.Port
//
// General Functions
//
// ToORM - Get the SQL object for the Port.
func (p *Port) ToORM(ctx context.Context) (host.PortORM, error) {
return (*host.Port)(p).ToORM(ctx)
}
// ToPB - Get the Protobuf object for the Port.
func (p *Port) ToPB() *host.Port {
return (*host.Port)(p)
}
// AsEntity - Returns the Port as a valid Maltego Entity.
func (p *Port) AsEntity() maltego.Entity {
return maltego.Entity{}
}