mirror of
https://github.com/maride/pancap.git
synced 2024-10-18 12:06:32 +00:00
20 lines
524 B
Go
20 lines
524 B
Go
package output
|
|
|
|
// GraphPkg resembles a directed communication from one address to another
|
|
// It wraps up required information to draw a graph of the communication, including spoken protocols.
|
|
type GraphPkg struct {
|
|
from string
|
|
to string
|
|
protocol []string
|
|
}
|
|
|
|
// AddProtocol adds the given protocol to the list of protocols if not already present
|
|
func (p *GraphPkg) AddProtocol(protocol string) {
|
|
for _, p := range p.protocol {
|
|
if p == protocol {
|
|
return
|
|
}
|
|
}
|
|
p.protocol = append(p.protocol, protocol)
|
|
}
|