log_data

package
v0.0.0-...-8790277 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNKNOWN_SERVER_ERROR                             = -1
	NONE                                  KafakaCode = 0
	OFFSET_OUT_OF_RANGE                              = 1
	CORRUPT_MESSAGE                                  = 2
	UNKNOWN_TOPIC_OR_PARTITION                       = 3
	INVALID_FETCH_SIZE                               = 4
	LEADER_NOT_AVAILABLE                             = 5
	NOT_LEADER_OR_FOLLOWER                           = 6
	REQUEST_TIMED_OUT                                = 7
	BROKER_NOT_AVAILABLE                             = 8
	REPLICA_NOT_AVAILABLE                            = 9
	MESSAGE_TOO_LARGE                                = 10
	STALE_CONTROLLER_EPOCH                           = 11
	OFFSET_METADATA_TOO_LARGE                        = 12
	NETWORK_EXCEPTION                                = 13
	COORDINATOR_LOAD_IN_PROGRESS                     = 14
	COORDINATOR_NOT_AVAILABLE                        = 15
	NOT_COORDINATOR                                  = 16
	INVALID_TOPIC_EXCEPTION                          = 17
	RECORD_LIST_TOO_LARGE                            = 18
	NOT_ENOUGH_REPLICAS                              = 19
	NOT_ENOUGH_REPLICAS_AFTER_APPEND                 = 20
	INVALID_REQUIRED_ACKS                            = 21
	ILLEGAL_GENERATION                               = 22
	INCONSISTENT_GROUP_PROTOCOL                      = 23
	INVALID_GROUP_ID                                 = 24
	UNKNOWN_MEMBER_ID                                = 25
	INVALID_SESSION_TIMEOUT                          = 26
	REBALANCE_IN_PROGRESS                            = 27
	INVALID_COMMIT_OFFSET_SIZE                       = 28
	TOPIC_AUTHORIZATION_FAILED                       = 29
	GROUP_AUTHORIZATION_FAILED                       = 30
	CLUSTER_AUTHORIZATION_FAILED                     = 31
	INVALID_TIMESTAMP                                = 32
	UNSUPPORTED_SASL_MECHANISM                       = 33
	ILLEGAL_SASL_STATE                               = 34
	UNSUPPORTED_VERSION                              = 35
	TOPIC_ALREADY_EXISTS                             = 36
	INVALID_PARTITIONS                               = 37
	INVALID_REPLICATION_FACTOR                       = 38
	INVALID_REPLICA_ASSIGNMENT                       = 39
	INVALID_CONFIG                                   = 40
	NOT_CONTROLLER                                   = 41
	INVALID_REQUEST                                  = 42
	UNSUPPORTED_FOR_MESSAGE_FORMAT                   = 43
	POLICY_VIOLATION                                 = 44
	OUT_OF_ORDER_SEQUENCE_NUMBER                     = 45
	DUPLICATE_SEQUENCE_NUMBER                        = 46
	INVALID_PRODUCER_EPOCH                           = 47
	INVALID_TXN_STATE                                = 48
	INVALID_PRODUCER_ID_MAPPING                      = 49
	INVALID_TRANSACTION_TIMEOUT                      = 50
	CONCURRENT_TRANSACTIONS                          = 51
	TRANSACTION_COORDINATOR_FENCED                   = 52
	TRANSACTIONAL_ID_AUTHORIZATION_FAILED            = 53
	SECURITY_DISABLED                                = 54
	OPERATION_NOT_ATTEMPTED                          = 55
	KAFKA_STORAGE_ERROR                              = 56
	LOG_DIR_NOT_FOUND                                = 57
	SASL_AUTHENTICATION_FAILED                       = 58
	UNKNOWN_PRODUCER_ID                              = 59
	REASSIGNMENT_IN_PROGRESS                         = 60
	DELEGATION_TOKEN_AUTH_DISABLED                   = 61
	DELEGATION_TOKEN_NOT_FOUND                       = 62
	DELEGATION_TOKEN_OWNER_MISMATCH                  = 63
	DELEGATION_TOKEN_REQUEST_NOT_ALLOWED             = 64
	DELEGATION_TOKEN_AUTHORIZATION_FAILED            = 65
	DELEGATION_TOKEN_EXPIRED                         = 66
	INVALID_PRINCIPAL_TYPE                           = 67
	NON_EMPTY_GROUP                                  = 68
	GROUP_ID_NOT_FOUND                               = 69
	FETCH_SESSION_ID_NOT_FOUND                       = 70
	INVALID_FETCH_SESSION_EPOCH                      = 71
	LISTENER_NOT_FOUND                               = 72
	TOPIC_DELETION_DISABLED                          = 73
	FENCED_LEADER_EPOCH                              = 74
	UNKNOWN_LEADER_EPOCH                             = 75
	UNSUPPORTED_COMPRESSION_TYPE                     = 76
	STALE_BROKER_EPOCH                               = 77
	OFFSET_NOT_AVAILABLE                             = 78
	MEMBER_ID_REQUIRED                               = 79
	PREFERRED_LEADER_NOT_AVAILABLE                   = 80
	GROUP_MAX_SIZE_REACHED                           = 81
	FENCED_INSTANCE_ID                               = 82
	ELIGIBLE_LEADERS_NOT_AVAILABLE                   = 83
	ELECTION_NOT_NEEDED                              = 84
	NO_REASSIGNMENT_IN_PROGRESS                      = 85
	GROUP_SUBSCRIBED_TO_TOPIC                        = 86
	INVALID_RECORD                                   = 87
	UNSTABLE_OFFSET_COMMIT                           = 88
	THROTTLING_QUOTA_EXCEEDED                        = 89
	PRODUCER_FENCED                                  = 90
	RESOURCE_NOT_FOUND                               = 91
	DUPLICATE_RESOURCE                               = 92
	UNACCEPTABLE_CREDENTIAL                          = 93
	INCONSISTENT_VOTER_SET                           = 94
	INVALID_UPDATE_VERSION                           = 95
	FEATURE_UPDATE_FAILED                            = 96
	PRINCIPAL_DESERIALIZATION_FAILURE                = 97
	SNAPSHOT_NOT_FOUND                               = 98
	POSITION_OUT_OF_RANGE                            = 99
	UNKNOWN_TOPIC_ID                                 = 100
	DUPLICATE_BROKER_REGISTRATION                    = 101
	BROKER_ID_NOT_REGISTERED                         = 102
	INCONSISTENT_TOPIC_ID                            = 103
	INCONSISTENT_CLUSTER_ID                          = 104
	TRANSACTIONAL_ID_NOT_FOUND                       = 105
	FETCH_SESSION_TOPIC_ID_ERROR                     = 106
)
View Source
const BLOCK_HEAD_SIZE = 16
View Source
const (
	UNKNOWN_SERVER_ERROR_DESC = "The server experienced an unexpected error when processing the request."
)
View Source
const (
	US_TO_S_DEVISOR = 1000000 // 微秒转化为秒的除数
)

Variables

View Source
var ApplicationLayerColumns = []*ckdb.Column{

	ckdb.NewColumn("l7_protocol", ckdb.UInt8).SetIndex(ckdb.IndexMinmax),
}
View Source
var DataLinkLayerColumns = []*ckdb.Column{
	ckdb.NewColumn("mac_0", ckdb.UInt64),
	ckdb.NewColumn("mac_1", ckdb.UInt64),
	ckdb.NewColumn("eth_type", ckdb.UInt16).SetIndex(ckdb.IndexSet),
	ckdb.NewColumn("vlan", ckdb.UInt16).SetIndex(ckdb.IndexSet),
}
View Source
var FlowInfoColumns = []*ckdb.Column{

	ckdb.NewColumn("time", ckdb.DateTime).SetComment("精度: 秒,等同end_time的秒精度"),
	ckdb.NewColumn("close_type", ckdb.UInt16).SetIndex(ckdb.IndexSet),
	ckdb.NewColumn("signal_source", ckdb.UInt16),
	ckdb.NewColumn("flow_id", ckdb.UInt64).SetIndex(ckdb.IndexMinmax),
	ckdb.NewColumn("capture_network_type_id", ckdb.UInt8),
	ckdb.NewColumn("nat_source", ckdb.UInt8),
	ckdb.NewColumn("capture_nic_type", ckdb.UInt8),
	ckdb.NewColumn("capture_nic", ckdb.UInt32),
	ckdb.NewColumn("observation_point", ckdb.LowCardinalityString),
	ckdb.NewColumn("agent_id", ckdb.UInt16).SetIndex(ckdb.IndexSet),
	ckdb.NewColumn("l2_end_0", ckdb.UInt8).SetIndex(ckdb.IndexNone),
	ckdb.NewColumn("l2_end_1", ckdb.UInt8).SetIndex(ckdb.IndexNone),
	ckdb.NewColumn("l3_end_0", ckdb.UInt8).SetIndex(ckdb.IndexNone),
	ckdb.NewColumn("l3_end_1", ckdb.UInt8).SetIndex(ckdb.IndexNone),
	ckdb.NewColumn("start_time", ckdb.DateTime64us).SetComment("精度: 微秒"),
	ckdb.NewColumn("end_time", ckdb.DateTime64us).SetComment("精度: 微秒"),
	ckdb.NewColumn("duration", ckdb.UInt64).SetComment("单位: 微秒"),
	ckdb.NewColumn("is_new_flow", ckdb.UInt8),
	ckdb.NewColumn("status", ckdb.UInt8).SetComment("状态 0:正常, 1:异常 ,2:不存在,3:服务端异常, 4:客户端异常"),
	ckdb.NewColumn("acl_gids", ckdb.ArrayUInt16),
	ckdb.NewColumn("gprocess_id_0", ckdb.UInt32),
	ckdb.NewColumn("gprocess_id_1", ckdb.UInt32),
	ckdb.NewColumn("nat_real_ip4_0", ckdb.IPv4),
	ckdb.NewColumn("nat_real_ip4_1", ckdb.IPv4),
	ckdb.NewColumn("nat_real_port_0", ckdb.UInt16),
	ckdb.NewColumn("nat_real_port_1", ckdb.UInt16),
	ckdb.NewColumn("direction_score", ckdb.UInt8).SetIndex(ckdb.IndexMinmax),
	ckdb.NewColumn("request_domain", ckdb.String).SetIndex(ckdb.IndexBloomfilter),
}
View Source
var InternetColumns = []*ckdb.Column{

	ckdb.NewColumn("province_0", ckdb.LowCardinalityString),
	ckdb.NewColumn("province_1", ckdb.LowCardinalityString),
}
View Source
var KnowledgeGraphColumns = []*ckdb.Column{

	ckdb.NewColumn("region_id_0", ckdb.UInt16),
	ckdb.NewColumn("region_id_1", ckdb.UInt16),
	ckdb.NewColumn("az_id_0", ckdb.UInt16),
	ckdb.NewColumn("az_id_1", ckdb.UInt16),
	ckdb.NewColumn("host_id_0", ckdb.UInt16),
	ckdb.NewColumn("host_id_1", ckdb.UInt16),
	ckdb.NewColumn("l3_device_type_0", ckdb.UInt8),
	ckdb.NewColumn("l3_device_type_1", ckdb.UInt8),
	ckdb.NewColumn("l3_device_id_0", ckdb.UInt32),
	ckdb.NewColumn("l3_device_id_1", ckdb.UInt32),
	ckdb.NewColumn("pod_node_id_0", ckdb.UInt32),
	ckdb.NewColumn("pod_node_id_1", ckdb.UInt32),
	ckdb.NewColumn("pod_ns_id_0", ckdb.UInt16),
	ckdb.NewColumn("pod_ns_id_1", ckdb.UInt16),
	ckdb.NewColumn("pod_group_id_0", ckdb.UInt32),
	ckdb.NewColumn("pod_group_id_1", ckdb.UInt32),
	ckdb.NewColumn("pod_id_0", ckdb.UInt32),
	ckdb.NewColumn("pod_id_1", ckdb.UInt32),
	ckdb.NewColumn("pod_cluster_id_0", ckdb.UInt16),
	ckdb.NewColumn("pod_cluster_id_1", ckdb.UInt16),
	ckdb.NewColumn("l3_epc_id_0", ckdb.Int32),
	ckdb.NewColumn("l3_epc_id_1", ckdb.Int32),
	ckdb.NewColumn("epc_id_0", ckdb.Int32),
	ckdb.NewColumn("epc_id_1", ckdb.Int32),
	ckdb.NewColumn("subnet_id_0", ckdb.UInt16),
	ckdb.NewColumn("subnet_id_1", ckdb.UInt16),
	ckdb.NewColumn("service_id_0", ckdb.UInt32),
	ckdb.NewColumn("service_id_1", ckdb.UInt32),

	ckdb.NewColumn("auto_instance_id_0", ckdb.UInt32),
	ckdb.NewColumn("auto_instance_type_0", ckdb.UInt8),
	ckdb.NewColumn("auto_service_id_0", ckdb.UInt32),
	ckdb.NewColumn("auto_service_type_0", ckdb.UInt8),

	ckdb.NewColumn("auto_instance_id_1", ckdb.UInt32),
	ckdb.NewColumn("auto_instance_type_1", ckdb.UInt8),
	ckdb.NewColumn("auto_service_id_1", ckdb.UInt32),
	ckdb.NewColumn("auto_service_type_1", ckdb.UInt8),

	ckdb.NewColumn("tag_source_0", ckdb.UInt8),
	ckdb.NewColumn("tag_source_1", ckdb.UInt8),

	ckdb.NewColumn("team_id", ckdb.UInt16),
}
View Source
var L4FlowCounter uint32
View Source
var L7FlowLogCounter uint32
View Source
var MetricsColumns = []*ckdb.Column{

	ckdb.NewColumn("packet_tx", ckdb.UInt64),
	ckdb.NewColumn("packet_rx", ckdb.UInt64),
	ckdb.NewColumn("byte_tx", ckdb.UInt64),
	ckdb.NewColumn("byte_rx", ckdb.UInt64),
	ckdb.NewColumn("l3_byte_tx", ckdb.UInt64),
	ckdb.NewColumn("l3_byte_rx", ckdb.UInt64),
	ckdb.NewColumn("l4_byte_tx", ckdb.UInt64),
	ckdb.NewColumn("l4_byte_rx", ckdb.UInt64),
	ckdb.NewColumn("total_packet_tx", ckdb.UInt64),
	ckdb.NewColumn("total_packet_rx", ckdb.UInt64),
	ckdb.NewColumn("total_byte_tx", ckdb.UInt64),
	ckdb.NewColumn("total_byte_rx", ckdb.UInt64),
	ckdb.NewColumn("l7_request", ckdb.UInt32),
	ckdb.NewColumn("l7_response", ckdb.UInt32),
	ckdb.NewColumn("l7_parse_failed", ckdb.UInt32),

	ckdb.NewColumn("rtt", ckdb.Float64).SetComment("单位: 微秒"),
	ckdb.NewColumn("rtt_client", ckdb.Float64).SetComment("单位: 微秒"),
	ckdb.NewColumn("rtt_server", ckdb.Float64).SetComment("单位: 微秒"),
	ckdb.NewColumn("tls_rtt", ckdb.Float64).SetComment("单位: 微秒"),

	ckdb.NewColumn("srt_sum", ckdb.Float64),
	ckdb.NewColumn("art_sum", ckdb.Float64),
	ckdb.NewColumn("rrt_sum", ckdb.Float64),
	ckdb.NewColumn("cit_sum", ckdb.Float64),

	ckdb.NewColumn("srt_count", ckdb.UInt64),
	ckdb.NewColumn("art_count", ckdb.UInt64),
	ckdb.NewColumn("rrt_count", ckdb.UInt64),
	ckdb.NewColumn("cit_count", ckdb.UInt64),

	ckdb.NewColumn("srt_max", ckdb.UInt32).SetComment("单位: 微秒"),
	ckdb.NewColumn("art_max", ckdb.UInt32).SetComment("单位: 微秒"),
	ckdb.NewColumn("rrt_max", ckdb.UInt32).SetComment("单位: 微秒"),
	ckdb.NewColumn("cit_max", ckdb.UInt32).SetComment("单位: 微秒"),

	ckdb.NewColumn("retrans_tx", ckdb.UInt32),
	ckdb.NewColumn("retrans_rx", ckdb.UInt32),
	ckdb.NewColumn("zero_win_tx", ckdb.UInt32),
	ckdb.NewColumn("zero_win_rx", ckdb.UInt32),
	ckdb.NewColumn("syn_count", ckdb.UInt32),
	ckdb.NewColumn("synack_count", ckdb.UInt32),
	ckdb.NewColumn("retrans_syn", ckdb.UInt32),
	ckdb.NewColumn("retrans_synack", ckdb.UInt32),
	ckdb.NewColumn("l7_client_error", ckdb.UInt32),
	ckdb.NewColumn("l7_server_error", ckdb.UInt32),
	ckdb.NewColumn("l7_server_timeout", ckdb.UInt32),
	ckdb.NewColumn("l7_error", ckdb.UInt32),
}
View Source
var NetworkLayerColumns = []*ckdb.Column{
	ckdb.NewColumn("ip4_0", ckdb.IPv4),
	ckdb.NewColumn("ip4_1", ckdb.IPv4),
	ckdb.NewColumn("ip6_0", ckdb.IPv6),
	ckdb.NewColumn("ip6_1", ckdb.IPv6),
	ckdb.NewColumn("is_ipv4", ckdb.UInt8).SetIndex(ckdb.IndexMinmax),
	ckdb.NewColumn("protocol", ckdb.UInt8),
	ckdb.NewColumn("tunnel_tier", ckdb.UInt8),
	ckdb.NewColumn("tunnel_type", ckdb.UInt16),
	ckdb.NewColumn("tunnel_tx_id", ckdb.UInt32),
	ckdb.NewColumn("tunnel_rx_id", ckdb.UInt32),
	ckdb.NewColumn("tunnel_tx_ip4_0", ckdb.IPv4),
	ckdb.NewColumn("tunnel_tx_ip4_1", ckdb.IPv4),
	ckdb.NewColumn("tunnel_rx_ip4_0", ckdb.IPv4),
	ckdb.NewColumn("tunnel_rx_ip4_1", ckdb.IPv4),
	ckdb.NewColumn("tunnel_tx_ip6_0", ckdb.IPv6),
	ckdb.NewColumn("tunnel_tx_ip6_1", ckdb.IPv6),
	ckdb.NewColumn("tunnel_rx_ip6_0", ckdb.IPv6),
	ckdb.NewColumn("tunnel_rx_ip6_1", ckdb.IPv6),
	ckdb.NewColumn("tunnel_is_ipv4", ckdb.UInt8).SetIndex(ckdb.IndexMinmax),
	ckdb.NewColumn("tunnel_tx_mac_0", ckdb.UInt32),
	ckdb.NewColumn("tunnel_tx_mac_1", ckdb.UInt32),
	ckdb.NewColumn("tunnel_rx_mac_0", ckdb.UInt32),
	ckdb.NewColumn("tunnel_rx_mac_1", ckdb.UInt32),
}
View Source
var TransportLayerColumns = []*ckdb.Column{

	ckdb.NewColumn("client_port", ckdb.UInt16),
	ckdb.NewColumn("server_port", ckdb.UInt16).SetIndex(ckdb.IndexSet),
	ckdb.NewColumn("tcp_flags_bit_0", ckdb.UInt16).SetIndex(ckdb.IndexNone),
	ckdb.NewColumn("tcp_flags_bit_1", ckdb.UInt16).SetIndex(ckdb.IndexNone),
	ckdb.NewColumn("syn_seq", ckdb.UInt32).SetComment("握手包的TCP SEQ序列号"),
	ckdb.NewColumn("syn_ack_seq", ckdb.UInt32).SetComment("握手回应包的TCP SEQ序列号"),
	ckdb.NewColumn("last_keepalive_seq", ckdb.UInt32),
	ckdb.NewColumn("last_keepalive_ack", ckdb.UInt32),
}

Functions

func DF_IPv4String

func DF_IPv4String(ip4 uint32) string

func GetDNSExceptionDesc

func GetDNSExceptionDesc(errCode uint16) string

func GetDubboExceptionDesc

func GetDubboExceptionDesc(errCode uint16) string

func GetHTTPExceptionDesc

func GetHTTPExceptionDesc(errCode uint16) string

func GetKafkaExceptionDesc

func GetKafkaExceptionDesc(errCode int16) string

func GetMQTTV3ExceptionDesc

func GetMQTTV3ExceptionDesc(errCode uint16) string

func GetMQTTV5ExceptionDesc

func GetMQTTV5ExceptionDesc(errCode uint16) string

func IPIntToString

func IPIntToString(ipInt uint32) string

func L4FlowLogColumns

func L4FlowLogColumns() []*ckdb.Column

func L4PacketColumns

func L4PacketColumns() []*ckdb.Column

func L7BaseColumns

func L7BaseColumns() []*ckdb.Column

func L7FlowLogColumns

func L7FlowLogColumns() []*ckdb.Column

func ReleaseL4FlowLog

func ReleaseL4FlowLog(l *L4FlowLog)

func ReleaseL4Packet

func ReleaseL4Packet(l *L4Packet)

func ReleaseL7FlowLog

func ReleaseL7FlowLog(l *L7FlowLog)

Types

type ApplicationLayer

type ApplicationLayer struct {
	L7Protocol uint8 `json:"l7_protocol"` // HTTP, DNS, others
}

func (*ApplicationLayer) Fill

func (a *ApplicationLayer) Fill(f *pb.Flow)

func (*ApplicationLayer) WriteBlock

func (a *ApplicationLayer) WriteBlock(block *ckdb.Block)

type DataLinkLayer

type DataLinkLayer struct {
	MAC0    uint64 `json:"mac_0" category:"$tag" sub:"data_link_layer" to_string:"MacString"`
	MAC1    uint64 `json:"mac_1" category:"$tag" sub:"data_link_layer" to_string:"MacString"`
	EthType uint16 `json:"eth_type" category:"$tag" sub:"data_link_layer"`
	VLAN    uint16 `json:"vlan" category:"$tag" sub:"data_link_layer"`
}

func (*DataLinkLayer) Fill

func (d *DataLinkLayer) Fill(f *pb.Flow)

func (*DataLinkLayer) WriteBlock

func (f *DataLinkLayer) WriteBlock(block *ckdb.Block)

type FlowInfo

type FlowInfo struct {
	Time         uint32 `json:"time" category:"$tag" sub:"flow_info"` // s
	CloseType    uint16 `json:"close_type" category:"$tag" sub:"flow_info" enumfile:"close_type"`
	SignalSource uint16 `json:"signal_source" category:"$tag" sub:"capture_info" enumfile:"l4_signal_source"`
	FlowID       uint64 `json:"flow_id" category:"$tag" sub:"flow_info"`
	TapType      uint8  `json:"capture_network_type_id" category:"$tag" sub:"capture_info"`
	NatSource    uint8  `json:"nat_source" category:"$tag" sub:"capture_info" enumfile:"nat_source"`
	TapPortType  uint8  `json:"capture_nic_type" category:"$tag" sub:"capture_info" enumfile:"capture_nic_type"` // 0: MAC, 1: IPv4, 2:IPv6, 3: ID
	TapPort      uint32 `json:"capture_nic" category:"$tag" sub:"capture_info"`
	TapSide      string `json:"observation_point" category:"$tag" sub:"capture_info" enumfile:"observation_point"`
	VtapID       uint16 `json:"agent_id" category:"$tag" sub:"capture_info"`
	L2End0       bool   `json:"l2_end_0" category:"$tag" sub:"capture_info"`
	L2End1       bool   `json:"l2_end_1" category:"$tag" sub:"capture_info"`
	L3End0       bool   `json:"l3_end_0" category:"$tag" sub:"capture_info"`
	L3End1       bool   `json:"l3_end_1" category:"$tag" sub:"capture_info"`
	StartTime    int64  `json:"start_time" category:"$tag" sub:"flow_info"` // us
	EndTime      int64  `json:"end_time" category:"$tag" sub:"flow_info"`   // us
	Duration     uint64 `json:"duration" category:"$metrics" sub:"delay"`   // us
	IsNewFlow    uint8  `json:"is_new_flow" category:"$tag" sub:"flow_info"`
	Status       uint8  `json:"status" category:"$tag" sub:"flow_info" enumfile:"status"`
	AclGids      []uint16
	GPID0        uint32 `json:"gprocess_id_0" category:"$tag" sub:"universal_tag"`
	GPID1        uint32 `json:"gprocess_id_1" category:"$tag" sub:"universal_tag"`

	NatRealIP0   uint32 `json:"nat_real_ip_0" category:"$tag" sub:"capture_info" to_string:"IPv4String"`
	NatRealIP1   uint32 `json:"nat_real_ip_1" category:"$tag" sub:"capture_info" to_string:"IPv4String"`
	NatRealPort0 uint16 `json:"nat_real_port_0" category:"$tag" sub:"capture_info"`
	NatRealPort1 uint16 `json:"nat_real_port_1" category:"$tag" sub:"capture_info"`

	DirectionScore uint8  `json:"direction_score" category:"$metrics" sub:"l4_throughput"`
	RequestDomain  string `json:"request_domain" category:"$tag" sub:"application_layer"`
}

func (*FlowInfo) Fill

func (i *FlowInfo) Fill(f *pb.Flow)

func (*FlowInfo) WriteBlock

func (f *FlowInfo) WriteBlock(block *ckdb.Block)

type Internet

type Internet struct {
	Province0 string `json:"province_0" category:"$tag" sub:"network_layer"`
	Province1 string `json:"province_1" category:"$tag" sub:"network_layer"`
}

func (*Internet) Fill

func (i *Internet) Fill(f *pb.Flow)

func (*Internet) WriteBlock

func (i *Internet) WriteBlock(block *ckdb.Block)

type KafakaCode

type KafakaCode int16

type KnowledgeGraph

type KnowledgeGraph struct {
	RegionID0     uint16 `json:"region_id_0" category:"$tag" sub:"universal_tag"`
	RegionID1     uint16 `json:"region_id_1" category:"$tag" sub:"universal_tag"`
	AZID0         uint16 `json:"az_id_0" category:"$tag" sub:"universal_tag"`
	AZID1         uint16 `json:"az_id_1" category:"$tag" sub:"universal_tag"`
	HostID0       uint16 `json:"host_id_0" category:"$tag" sub:"universal_tag"`
	HostID1       uint16 `json:"host_id_1" category:"$tag" sub:"universal_tag"`
	L3DeviceType0 uint8  `json:"l3_device_type_0" category:"$tag" sub:"universal_tag"`
	L3DeviceType1 uint8  `json:"l3_device_type_1" category:"$tag" sub:"universal_tag"`
	L3DeviceID0   uint32 `json:"l3_device_id_0" category:"$tag" sub:"universal_tag"`
	L3DeviceID1   uint32 `json:"l3_device_id_1" category:"$tag" sub:"universal_tag"`
	PodNodeID0    uint32 `json:"pod_node_id_0" category:"$tag" sub:"universal_tag"`
	PodNodeID1    uint32 `json:"pod_node_id_1" category:"$tag" sub:"universal_tag"`
	PodNSID0      uint16 `json:"pod_ns_id_0" category:"$tag" sub:"universal_tag"`
	PodNSID1      uint16 `json:"pod_ns_id_1" category:"$tag" sub:"universal_tag"`
	PodGroupID0   uint32 `json:"pod_group_id_0" category:"$tag" sub:"universal_tag"`
	PodGroupID1   uint32 `json:"pod_group_id_1" category:"$tag" sub:"universal_tag"`
	PodGroupType0 uint8  `json:"pod_group_type_0" category:"$tag" sub:"universal_tag" enumfile:"pod_group_type"` // no need to store
	PodGroupType1 uint8  `json:"pod_group_type_1" category:"$tag" sub:"universal_tag" enumfile:"pod_group_type"` // no need to store
	PodID0        uint32 `json:"pod_id_0" category:"$tag" sub:"universal_tag"`
	PodID1        uint32 `json:"pod_id_1" category:"$tag" sub:"universal_tag"`
	PodClusterID0 uint16 `json:"pod_cluster_id_0" category:"$tag" sub:"universal_tag"`
	PodClusterID1 uint16 `json:"pod_cluster_id_1" category:"$tag" sub:"universal_tag"`
	L3EpcID0      int32  `json:"l3_epc_id_0" category:"$tag" sub:"universal_tag"`
	L3EpcID1      int32  `json:"l3_epc_id_1" category:"$tag" sub:"universal_tag"`
	EpcID0        int32  `json:"epc_id_0" category:"$tag" sub:"universal_tag"`
	EpcID1        int32  `json:"epc_id_1" category:"$tag" sub:"universal_tag"`
	SubnetID0     uint16 `json:"subnet_id_0" category:"$tag" sub:"universal_tag"`
	SubnetID1     uint16 `json:"subnet_id_1" category:"$tag" sub:"universal_tag"`
	ServiceID0    uint32 `json:"service_id_0" category:"$tag" sub:"universal_tag"`
	ServiceID1    uint32 `json:"service_id_1" category:"$tag" sub:"universal_tag"`

	AutoInstanceID0   uint32 `json:"auto_instance_id_0" category:"$tag" sub:"universal_tag"`
	AutoInstanceType0 uint8  `json:"auto_instance_type_0" category:"$tag" sub:"universal_tag" enumfile:"auto_instance_type"`
	AutoServiceID0    uint32 `json:"auto_service_id_0" category:"$tag" sub:"universal_tag"`
	AutoServiceType0  uint8  `json:"auto_service_type_0" category:"$tag" sub:"universal_tag" enumfile:"auto_service_type"`

	AutoInstanceID1   uint32 `json:"auto_instance_id_1" category:"$tag" sub:"universal_tag"`
	AutoInstanceType1 uint8  `json:"auto_instance_type_1" category:"$tag" sub:"universal_tag" enumfile:"auto_instance_type"`
	AutoServiceID1    uint32 `json:"auto_service_id_1" category:"$tag" sub:"universal_tag"`
	AutoServiceType1  uint8  `json:"auto_service_type_1" category:"$tag" sub:"universal_tag" enumfile:"auto_service_type"`

	TagSource0 uint8
	TagSource1 uint8

	OrgId  uint16 // no need to store
	TeamID uint16
}

func (*KnowledgeGraph) FillL4

func (k *KnowledgeGraph) FillL4(f *pb.Flow, isIPv6 bool, platformData *grpc.PlatformInfoTable)

func (*KnowledgeGraph) FillL7

func (k *KnowledgeGraph) FillL7(l *pb.AppProtoLogsBaseInfo, platformData *grpc.PlatformInfoTable, protocol layers.IPProtocol)

func (*KnowledgeGraph) FillOTel

func (k *KnowledgeGraph) FillOTel(l *L7FlowLog, platformData *grpc.PlatformInfoTable)

func (*KnowledgeGraph) WriteBlock

func (k *KnowledgeGraph) WriteBlock(block *ckdb.Block)

type L4FlowLog

type L4FlowLog struct {
	pool.ReferenceCount

	DataLinkLayer
	NetworkLayer
	TransportLayer
	ApplicationLayer
	Internet
	KnowledgeGraph
	FlowInfo
	Metrics
	// contains filtered or unexported fields
}

func AcquireL4FlowLog

func AcquireL4FlowLog() *L4FlowLog

func TaggedFlowToL4FlowLog

func TaggedFlowToL4FlowLog(f *pb.TaggedFlow, platformData *grpc.PlatformInfoTable) *L4FlowLog

func (*L4FlowLog) DataSource

func (l4 *L4FlowLog) DataSource() uint32

func (*L4FlowLog) EncodeTo

func (l4 *L4FlowLog) EncodeTo(protocol config.ExportProtocol, utags *utag.UniversalTagsManager, cfg *config.ExporterCfg) (interface{}, error)

func (*L4FlowLog) EndTime

func (f *L4FlowLog) EndTime() time.Duration

func (*L4FlowLog) GetFieldValueByOffsetAndKind

func (l7 *L4FlowLog) GetFieldValueByOffsetAndKind(offset uintptr, kind reflect.Kind, dataType utils.DataType) interface{}

func (*L4FlowLog) HitPcapPolicy

func (f *L4FlowLog) HitPcapPolicy() bool

func (*L4FlowLog) OrgID

func (f *L4FlowLog) OrgID() uint16

func (*L4FlowLog) QueryUniversalTags

func (l4 *L4FlowLog) QueryUniversalTags(utags *utag.UniversalTagsManager) (*utag.UniversalTags, *utag.UniversalTags)

func (*L4FlowLog) Release

func (f *L4FlowLog) Release()

func (*L4FlowLog) String

func (f *L4FlowLog) String() string

func (*L4FlowLog) TimestampUs

func (l4 *L4FlowLog) TimestampUs() int64

func (*L4FlowLog) WriteBlock

func (f *L4FlowLog) WriteBlock(block *ckdb.Block)

type L4Packet

type L4Packet struct {
	StartTime int64
	EndTime   int64
	FlowID    uint64
	VtapID    uint16

	// Not stored, only determines which database to store in.
	// When Orgid is 0 or 1, it is stored in database 'flow_log', otherwise stored in '<OrgId>_flow_log'.
	OrgId       uint16
	TeamID      uint16
	PacketCount uint32
	PacketBatch []byte
}

func AcquireL4Packet

func AcquireL4Packet() *L4Packet

func DecodePacketSequence

func DecodePacketSequence(decoder *codec.SimpleDecoder, vtapID uint16) (*L4Packet, error)

func (*L4Packet) OrgID

func (s *L4Packet) OrgID() uint16

func (*L4Packet) Release

func (p *L4Packet) Release()

func (*L4Packet) String

func (p *L4Packet) String() string

func (*L4Packet) WriteBlock

func (s *L4Packet) WriteBlock(block *ckdb.Block)

type L7Base

type L7Base struct {
	// 知识图谱
	KnowledgeGraph

	Time uint32 `json:"time" category:"$tag" sub:"flow_info"` // s
	// 网络层
	IP40     uint32 `json:"ip4_0" category:"$tag" sub:"network_layer" to_string:"IPv4String"`
	IP41     uint32 `json:"ip4_1" category:"$tag" sub:"network_layer" to_string:"IPv4String"`
	IP60     net.IP `json:"ip6_0" category:"$tag" sub:"network_layer" to_string:"IPv6String"`
	IP61     net.IP `json:"ip6_1" category:"$tag" sub:"network_layer" to_string:"IPv6String"`
	IsIPv4   bool   `json:"is_ipv4" category:"$tag" sub:"network_layer"`
	Protocol uint8  `json:"protocol" category:"$tag" sub:"network_layer" enumfile:"l7_ip_protocol"`

	// 传输层
	ClientPort uint16 `json:"client_port" category:"$tag" sub:"transport_layer" `
	ServerPort uint16 `json:"server_port" category:"$tag" sub:"transport_layer"`

	// 流信息
	FlowID       uint64 `json:"flow_id" category:"$tag" sub:"flow_info"`
	TapType      uint8  `json:"capture_network_type_id" category:"$tag" sub:"capture_info"`
	NatSource    uint8  `json:"nat_source" category:"$tag" sub:"capture_info" enumfile:"nat_source"`
	TapPortType  uint8  `json:"capture_nic_type category:"$tag" sub:"capture_info"`
	SignalSource uint16 `json:"signal_source" category:"$tag" sub:"capture_info" enumfile:"l7_signal_source"`
	TunnelType   uint8  `json:"tunnel_type" category:"$tag" sub:"tunnel_info"`
	TapPort      uint32 `json:"capture_nic" category:"$tag" sub:"capture_info"`
	TapSide      string `json:"observation_point" category:"$tag" sub:"capture_info" enumfile:"observation_point"`
	VtapID       uint16 `json:"agent_id" category:"$tag" sub:"capture_info"`
	ReqTcpSeq    uint32 `json:"req_tcp_seq" category:"$tag" sub:"transport_layer"`
	RespTcpSeq   uint32 `json:"resp_tcp_seq" category:"$tag" sub:"transport_layer"`
	StartTime    int64  `json:"start_time" category:"$tag" sub:"flow_info"` // us
	EndTime      int64  `json:"end_time" category:"$tag" sub:"flow_info"`   // us
	GPID0        uint32 `json:"gprocess_id_0" category:"$tag" sub:"universal_tag"`
	GPID1        uint32 `json:"gprocess_id_1" category:"$tag" sub:"universal_tag"`
	BizType      uint8  `json:"biz_type" category:"$tag" sub:"capture_info"`

	ProcessID0             uint32 `json:"process_id_0" category:"$tag" sub:"service_info"`
	ProcessID1             uint32 `json:"process_id_1" category:"$tag" sub:"service_info"`
	ProcessKName0          string `json:"process_kname_0" category:"$tag" sub:"service_info"`
	ProcessKName1          string `json:"process_kname_1" category:"$tag" sub:"service_info"`
	SyscallTraceIDRequest  uint64 `json:"syscall_trace_id_request" category:"$tag" sub:"tracing_info"`
	SyscallTraceIDResponse uint64 `json:"syscall_trace_id_response" category:"$tag" sub:"tracing_info"`
	SyscallThread0         uint32 `json:"syscall_thread_0" category:"$tag" sub:"tracing_info"`
	SyscallThread1         uint32 `json:"syscall_thread_1" category:"$tag" sub:"tracing_info"`
	SyscallCoroutine0      uint64 `json:"syscall_coroutine_0" category:"$tag" sub:"tracing_info"`
	SyscallCoroutine1      uint64 `json:"syscall_coroutine_1" category:"$tag" sub:"tracing_info"`
	SyscallCapSeq0         uint32 `json:"syscall_cap_seq_0" category:"$tag" sub:"tracing_info"`
	SyscallCapSeq1         uint32 `json:"syscall_cap_seq_1" category:"$tag" sub:"tracing_info"`
}

func (*L7Base) Fill

func (b *L7Base) Fill(log *pb.AppProtoLogsData, platformData *grpc.PlatformInfoTable)

func (*L7Base) WriteBlock

func (f *L7Base) WriteBlock(block *ckdb.Block)

type L7FlowLog

type L7FlowLog struct {
	pool.ReferenceCount

	L7Base

	L7Protocol    uint8  `json:"l7_protocol" category:"$tag" sub:"application_layer" enumfile:"l7_protocol"`
	L7ProtocolStr string `json:"l7_protocol_str" category:"$tag" sub:"application_layer"`
	Version       string `json:"version" category:"$tag" sub:"application_layer"`
	Type          uint8  `json:"type" category:"$tag" sub:"application_layer" enumfile:"l7_log_type"`
	IsTLS         uint8  `json:"is_tls" category:"$tag" sub:"application_layer"`

	RequestType     string `json:"request_type" category:"$tag" sub:"application_layer"`
	RequestDomain   string `json:"request_domain" category:"$tag" sub:"application_layer"`
	RequestResource string `json:"request_resource" category:"$tag" sub:"application_layer"`
	Endpoint        string `json:"end_point" category:"$tag" sub:"service_info"`

	// 数据库nullabled类型的字段, 需使用指针传值写入。如果值无意义,应传递nil.
	RequestId *uint64 `json:"request_id" category:"$tag" sub:"application_layer" data_type:"*uint64"`

	ResponseStatus uint8  `json:"response_status" category:"$tag" sub:"application_layer" enumfile:"response_status"`
	ResponseCode   *int32 `json:"response_code" category:"$tag" sub:"application_layer" data_type:"*int32"`

	ResponseException string `json:"response_exception" category:"$tag" sub:"application_layer"`
	ResponseResult    string `json:"response_result" category:"$tag" sub:"application_layer"`

	HttpProxyClient string `json:"http_proxy_client" category:"$tag" sub:"tracing_info"`
	XRequestId0     string `json:"x_request_id_0" category:"$tag" sub:"tracing_info"`
	XRequestId1     string `json:"x_request_id_1" category:"$tag" sub:"tracing_info"`
	TraceId         string `json:"trace_id" category:"$tag" sub:"tracing_info"`
	TraceIdIndex    uint64
	SpanId          string `json:"span_id" category:"$tag" sub:"tracing_info"`
	ParentSpanId    string `json:"parent_span_id" category:"$tag" sub:"tracing_info"`
	SpanKind        uint8

	AppService  string `json:"app_service" category:"$tag" sub:"service_info"`
	AppInstance string `json:"app_instance" category:"$tag" sub:"service_info"`

	ResponseDuration uint64 `json:"response_duration" category:"$metrics" sub:"delay"`
	RequestLength    *int64 `json:"request_length" category:"$metrics" sub:"throughput" data_type:"*int64"`

	ResponseLength *int64 `json:"response_length" category:"$metrics" sub:"throughput" data_type:"*int64"`

	SqlAffectedRows *uint64 `json:"sql_affected_rows" category:"$metrics" sub:"throughput" data_type:"*uint64"`

	DirectionScore uint8 `json:"direction_score" category:"$metrics" sub:"l4_throughput"`

	// For Packet signal sources, it represents the packet length captured by AF_PACKET, excluding the layer 4 headers; for eBPF signal sources, it indicates the number of bytes for a single system call, and note that when TCP stream reassembly is enabled, it represents the total number of bytes from multiple system calls.
	CapturedRequestByte  uint32
	CapturedResponseByte uint32

	AttributeNames  []string `json:"attribute_names" category:"$tag" sub:"native_tag" data_type:"[]string"`
	AttributeValues []string `json:"attribute_values" category:"$tag" sub:"native_tag" data_type:"[]string"`

	MetricsNames  []string  `json:"metrics_names" category:"$metrics" data_type:"[]string"`
	MetricsValues []float64 `json:"metrics_values" category:"$metrics" data_type:"[]float64"`

	Events string `json:"events" category:"$tag" sub:"application_layer"`
	// contains filtered or unexported fields
}

func AcquireL7FlowLog

func AcquireL7FlowLog() *L7FlowLog

func OTelTracesDataToL7FlowLogs

func OTelTracesDataToL7FlowLogs(vtapID uint16, l *v1.TracesData, platformData *grpc.PlatformInfoTable, cfg *flowlogCfg.Config) []*L7FlowLog

func ProtoLogToL7FlowLog

func ProtoLogToL7FlowLog(l *pb.AppProtoLogsData, platformData *grpc.PlatformInfoTable, cfg *flowlogCfg.Config) *L7FlowLog

func (*L7FlowLog) DataSource

func (l7 *L7FlowLog) DataSource() uint32

func (*L7FlowLog) EncodeTo

func (l7 *L7FlowLog) EncodeTo(protocol config.ExportProtocol, utags *utag.UniversalTagsManager, cfg *config.ExporterCfg) (interface{}, error)

func (*L7FlowLog) EncodeToOtlp

func (l7 *L7FlowLog) EncodeToOtlp(utags *utag.UniversalTagsManager, dataTypeBits uint64) interface{}

func (*L7FlowLog) EndTime

func (h *L7FlowLog) EndTime() time.Duration

func (*L7FlowLog) Fill

func (h *L7FlowLog) Fill(l *pb.AppProtoLogsData, platformData *grpc.PlatformInfoTable, cfg *flowlogCfg.Config)

func (*L7FlowLog) FillOTel

func (h *L7FlowLog) FillOTel(l *v1.Span, resAttributes []*v11.KeyValue, platformData *grpc.PlatformInfoTable, cfg *flowlogCfg.Config)

func (*L7FlowLog) GenerateNewFlowTags

func (h *L7FlowLog) GenerateNewFlowTags(cache *flow_tag.FlowTagCache)

func (*L7FlowLog) GetFieldValueByOffsetAndKind

func (l7 *L7FlowLog) GetFieldValueByOffsetAndKind(offset uintptr, kind reflect.Kind, dataType utils.DataType) interface{}

func (*L7FlowLog) ID

func (h *L7FlowLog) ID() uint64

func (*L7FlowLog) OrgID

func (h *L7FlowLog) OrgID() uint16

func (*L7FlowLog) QueryUniversalTags

func (l7 *L7FlowLog) QueryUniversalTags(utags *utag.UniversalTagsManager) (*utag.UniversalTags, *utag.UniversalTags)

func (*L7FlowLog) Release

func (h *L7FlowLog) Release()

func (*L7FlowLog) StartTime

func (h *L7FlowLog) StartTime() time.Duration

func (*L7FlowLog) String

func (h *L7FlowLog) String() string

func (*L7FlowLog) TimestampUs

func (l7 *L7FlowLog) TimestampUs() int64

func (*L7FlowLog) WriteBlock

func (h *L7FlowLog) WriteBlock(block *ckdb.Block)

type Metrics

type Metrics struct {
	PacketTx      uint64 `json:"packet_tx" category:"$metrics" sub:"l3_throughput"`
	PacketRx      uint64 `json:"packet_rx" category:"$metrics" sub:"l3_throughput"`
	ByteTx        uint64 `json:"byte_tx" category:"$metrics" sub:"l3_throughput"`
	ByteRx        uint64 `json:"byte_rx" category:"$metrics" sub:"l3_throughput"`
	L3ByteTx      uint64 `json:"l3_byte_tx" category:"$metrics" sub:"l3_throughput"`
	L3ByteRx      uint64 `json:"l3_byte_rx" category:"$metrics" sub:"l3_throughput"`
	L4ByteTx      uint64 `json:"l4_byte_tx" category:"$metrics" sub:"l4_throughput"`
	L4ByteRx      uint64 `json:"l4_byte_rx" category:"$metrics" sub:"l4_throughput"`
	TotalPacketTx uint64 `json:"total_packet_tx" category:"$metrics" sub:"l3_throughput"`
	TotalPacketRx uint64 `json:"total_packet_rx" category:"$metrics" sub:"l3_throughput"`
	TotalByteTx   uint64 `json:"total_byte_tx" category:"$metrics" sub:"l3_throughput"`
	TotalByteRx   uint64 `json:"total_byte_rx" category:"$metrics" sub:"l3_throughput"`
	L7Request     uint32 `json:"l7_request" category:"$metrics" sub:"application"`
	L7Response    uint32 `json:"l7_response" category:"$metrics" sub:"application"`
	L7ParseFailed uint32 `json:"l7_parse_failed" category:"$metrics" sub:"application"`

	RTT       uint32 `json:"rtt" category:"$metrics" sub:"delay"`        // us
	RTTClient uint32 `json:"rtt_client" category:"$metrics" sub:"delay"` // us
	RTTServer uint32 `json:"rtt_server" category:"$metrics" sub:"delay"` // us
	TLSRTT    uint32 `json:"tls_rtt" category:"$metrics" sub:"delay"`    // us

	SRTSum uint32 `json:"srt_sum" category:"$metrics" sub:"delay"`
	ARTSum uint32 `json:"art_sum" category:"$metrics" sub:"delay"`
	RRTSum uint64 `json:"rrt_sum" category:"$metrics" sub:"delay"`
	CITSum uint32 `json:"cit_sum" category:"$metrics" sub:"delay"`

	SRTCount uint32 `json:"srt_count" category:"$metrics" sub:"delay"`
	ARTCount uint32 `json:"art_count" category:"$metrics" sub:"delay"`
	RRTCount uint32 `json:"rrt_count" category:"$metrics" sub:"delay"`
	CITCount uint32 `json:"cit_count" category:"$metrics" sub:"delay"`

	SRTMax uint32 `json:"srt_max" category:"$metrics" sub:"delay"` // us
	ARTMax uint32 `json:"art_max" category:"$metrics" sub:"delay"` // us
	RRTMax uint32 `json:"rrt_max" category:"$metrics" sub:"delay"` // us
	CITMax uint32 `json:"cit_max" category:"$metrics" sub:"delay"` // us

	RetransTx       uint32 `json:"retrans_tx" category:"$metrics" sub:"tcp_slow"`
	RetransRx       uint32 `json:"retrans_rx" category:"$metrics" sub:"tcp_slow"`
	ZeroWinTx       uint32 `json:"zero_win_tx" category:"$metrics" sub:"tcp_slow"`
	ZeroWinRx       uint32 `json:"zero_win_rx" category:"$metrics" sub:"tcp_slow"`
	SynCount        uint32 `json:"syn_count" category:"$metrics" sub:"l4_throughput"`
	SynackCount     uint32 `json:"synack_count" category:"$metrics" sub:"l4_throughput"`
	RetransSyn      uint32 `json:"retrans_syn" category:"$metrics" sub:"tcp_slow"`
	RetransSynack   uint32 `json:"retrans_synack" category:"$metrics" sub:"tcp_slow"`
	L7ClientError   uint32 `json:"l7_client_error" category:"$metrics" sub:"application"`
	L7ServerError   uint32 `json:"l7_server_error" category:"$metrics" sub:"application"`
	L7ServerTimeout uint32 `json:"l7_server_timeout" category:"$metrics" sub:"application"`
	L7Error         uint32 `json:"l7_error" category:"$metrics" sub:"application"`
}

func (*Metrics) Fill

func (m *Metrics) Fill(f *pb.Flow)

func (*Metrics) WriteBlock

func (m *Metrics) WriteBlock(block *ckdb.Block)

type NetworkLayer

type NetworkLayer struct {
	IP40         uint32 `json:"ip4_0" category:"$tag" sub:"network_layer" to_string:"IPv4String"`
	IP41         uint32 `json:"ip4_1" category:"$tag" sub:"network_layer" to_string:"IPv4String"`
	IP60         net.IP `json:"ip6_0" category:"$tag" sub:"network_layer"`
	IP61         net.IP `json:"ip6_1" category:"$tag" sub:"network_layer"`
	IsIPv4       bool   `json:"is_ipv4" category:"$tag" sub:"network_layer"`
	Protocol     uint8  `json:"protocol" category:"$tag"  sub:"network_layer" enumfile:"protocol" tranlate:"tunnel_tier"`
	TunnelTier   uint8  `json:"tunnel_tier" category:"$tag" sub:"tunnel_info" tranlate:"tunnel_type"`
	TunnelType   uint16 `json:"tunnel_type" category:"$tag" sub:"tunnel_info"`
	TunnelTxID   uint32 `json:"tunnel_tx_id" category:"$tag" sub:"tunnel_info"`
	TunnelRxID   uint32 `json:"tunnel_rx_id" category:"$tag" sub:"tunnel_info"`
	TunnelTxIP40 uint32 `json:"tunnel_tx_ip4_0" category:"$tag" sub:"tunnel_info" to_string:"IPv4String"`
	TunnelTxIP41 uint32 `json:"tunnel_tx_ip4_1" category:"$tag" sub:"tunnel_info" to_string:"IPv4String"`
	TunnelRxIP40 uint32 `json:"tunnel_rx_ip4_0" category:"$tag" sub:"tunnel_info" to_string:"IPv4String"`
	TunnelRxIP41 uint32 `json:"tunnel_rx_ip4_1" category:"$tag" sub:"tunnel_info" to_string:"IPv4String"`
	TunnelTxIP60 net.IP `json:"tunnel_tx_ip6_0" category:"$tag" sub:"tunnel_info" to_string:"IPv6String"`
	TunnelTxIP61 net.IP `json:"tunnel_tx_ip6_1" category:"$tag" sub:"tunnel_info" to_string:"IPv6String"`
	TunnelRxIP60 net.IP `json:"tunnel_rx_ip6_0" category:"$tag" sub:"tunnel_info" to_string:"IPv6String"`
	TunnelRxIP61 net.IP `json:"tunnel_rx_ip6_1" category:"$tag" sub:"tunnel_info" to_string:"IPv6String"`
	TunnelIsIPv4 bool   `json:"tunnel_is_ipv4" category:"$tag" sub:"tunnel_info"`
	TunnelTxMac0 uint32 `json:"tunnel_tx_mac_0" category:"$tag" sub:"tunnel_info"`
	TunnelTxMac1 uint32 `json:"tunnel_tx_mac_1" category:"$tag" sub:"tunnel_info"`
	TunnelRxMac0 uint32 `json:"tunnel_rx_mac_0" category:"$tag" sub:"tunnel_info"`
	TunnelRxMac1 uint32 `json:"tunnel_rx_mac_1" category:"$tag" sub:"tunnel_info"`
}

func (*NetworkLayer) Fill

func (n *NetworkLayer) Fill(f *pb.Flow, isIPV6 bool)

func (*NetworkLayer) WriteBlock

func (n *NetworkLayer) WriteBlock(block *ckdb.Block)

type TransportLayer

type TransportLayer struct {
	ClientPort       uint16 `json:"client_port" category:"$tag" sub:"transport_layer"`
	ServerPort       uint16 `json:"server_port" category:"$tag" sub:"transport_layer"`
	TCPFlagsBit0     uint16 `json:"tcp_flags_bit_0" category:"$tag" sub:"transport_layer"`
	TCPFlagsBit1     uint16 `json:"tcp_flags_bit_1" category:"$tag" sub:"transport_layer"`
	SynSeq           uint32 `json:"syn_seq" category:"$tag" sub:"transport_layer"`
	SynAckSeq        uint32 `json:"syn_ack_seq" category:"$tag" sub:"transport_layer"`
	LastKeepaliveSeq uint32 `json:"last_keepalive_seq" category:"$tag" sub:"transport_layer"`
	LastKeepaliveAck uint32 `json:"last_keepalive_ack" category:"$tag" sub:"transport_layer"`
}

func (*TransportLayer) Fill

func (t *TransportLayer) Fill(f *pb.Flow)

func (*TransportLayer) WriteBlock

func (t *TransportLayer) WriteBlock(block *ckdb.Block)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL