1 Star 0 Fork 1

爱不爱生活/goboot

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
flow_packet.go 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
package packet
import "gitee.com/ixxyy/goboot/utils/text/gstr"
//
// FlowPacket
// @Description: flow packet
//
type FlowPacket struct {
Seq uint64
SrcMac string `json:"SrcMac"`
SrcIp string `json:"SrcIp"`
SrcIpv6 string `json:"SrcIpv6"`
SrcPort int `json:"SrcPort"`
DstMac string `json:"DstMac"`
DstIp string `json:"DstIp"`
DstIpv6 string `json:"DstIpv6"`
DstPort int `json:"DstPort"`
MetaTimestamp int64
MetaCaptureLength int
MetaLength int
MetaInterfaceIndex int
MetaTruncated int
EtherType string `json:"EtherType"`
L3Version string `json:"L3Version"`
L4Protocol string `json:"L4Protocol"`
Protocol string `json:"Protocol"`
PacketData string `json:"PacketData"`
PacketLength int `json:"PacketLength"`
SampleTime int64 `json:"TimeReceived"`
SampleIp string `json:"SamplerIp"`
HttpType string `json:"HttpType"`
Command string `json:"Command"`
HttpHeaders map[string]string `json:"HttpHeaders"`
UserAgent string `json:"UserAgent"`
HttpStatus string `json:"HttpStatus"`
RequestUri string `json:"RequestUri"`
Body string `json:"body"`
PassivePort int `json:"PassivePort"`
}
//
// getServiceHost
// @Description: get target service ip and port
// @receiver flow
// @return string
//
func (flow *FlowPacket) getServiceHost() string {
if flow.DstPort <= 0 && !gstr.IsValidIp(flow.DstIp) {
return ""
}
return flow.DstIp + ":" + gstr.ToString(flow.DstPort)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/ixxyy/goboot.git
git@gitee.com:ixxyy/goboot.git
ixxyy
goboot
goboot
v0.1.27

搜索帮助