httpflow

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package httpflow collects http(s) request flow

Index

Constants

View Source
const (
	NoValue           = "N/A"
	DirectionOutgoing = "outgoing"
	DirectionIncoming = "incoming"
)
View Source
const (
	ConnL3Mask uint32 = dknetflow.ConnL3Mask
	ConnL3IPv4 uint32 = dknetflow.ConnL3IPv4
	ConnL3IPv6 uint32 = dknetflow.ConnL3IPv6

	ConnL4Mask uint32 = dknetflow.ConnL4Mask
	ConnL4TCP  uint32 = dknetflow.ConnL4TCP
	ConnL4UDP  uint32 = dknetflow.ConnL4UDP

	PayloadBufSize    = 2048
	KernelTaskCommLen = 16
)
View Source
const (
	HTTP_METHOD_UNKNOWN = 0x00 + iota
	HTTP_METHOD_GET
	HTTP_METHOD_POST
	HTTP_METHOD_PUT
	HTTP_METHOD_DELETE
	HTTP_METHOD_HEAD
	HTTP_METHOD_OPTIONS
	HTTP_METHOD_PATCH

	// TODO parse such HTTP data.
	HTTP_METHOD_CONNECT
	HTTP_METHOD_TRACE
)
View Source
const HTTPPayloadMaxsize = 157

Variables

This section is empty.

Functions

func ConnNotNeedToFilter

func ConnNotNeedToFilter(conn ConnectionInfo) bool

func CreateTracePoint

func CreateTracePoint(traceInfo *tracing.TraceInfo, httpStat *HTTPReqFinishedInfo) (*client.Point, error)

func FindHTTPURI

func FindHTTPURI(payload string) (string, bool)

func HTTPMethodInt

func HTTPMethodInt(method int) string

func HTTPMethodString

func HTTPMethodString(method string) int

func NewHTTPFlowManger

func NewHTTPFlowManger(constEditor []manager.ConstantEditor, bmaps map[string]*ebpf.Map,
	closedEventHandler, bufHandler perferEventHandle, enableTLS bool) (*manager.Manager, *sysmonitor.UprobeRegister, error)

func ParseHTTPVersion

func ParseHTTPVersion(v uint32) string

func SetK8sNetInfo

func SetK8sNetInfo(n *k8sinfo.K8sNetInfo)

func SetLogger

func SetLogger(nl *logger.Logger)

func TransPayloadToThrID

func TransPayloadToThrID(id *CPayloadID) uint64

Types

type CHTTPReqFinished

type CHTTPReqFinished C.struct_http_req_finished

type CL7Buffer

type CL7Buffer C.struct_l7_buffer

type CLayer7Http

type CLayer7Http C.struct_layer7_http

type CPayloadID

type CPayloadID C.struct_payload_id

func (CPayloadID) String

func (payloadid CPayloadID) String() string

type ConnectionInfo

type ConnectionInfo dknetflow.ConnectionInfo

func (ConnectionInfo) String

func (conn ConnectionInfo) String() string

type ConnectionInfoC

type ConnectionInfoC dknetflow.ConnectionInfoC

type FlowAgg

type FlowAgg struct {
	// contains filtered or unexported fields
}

func (*FlowAgg) Append

func (agg *FlowAgg) Append(httpFinReq *HTTPReqFinishedInfo) error

func (*FlowAgg) Clean

func (agg *FlowAgg) Clean()

func (*FlowAgg) Len

func (agg *FlowAgg) Len() int

func (*FlowAgg) ToPoint

func (agg *FlowAgg) ToPoint(tags map[string]string, k8sInfo *k8sinfo.K8sNetInfo) []*client.Point

type HTTPFlowTracer

type HTTPFlowTracer struct {
	TPacket *afpacket.TPacket
	// contains filtered or unexported fields
}

func NewHTTPFlowTracer

func NewHTTPFlowTracer(tags map[string]string, datakitPostURL, tracePostURL string,
	conv2dd, enableTrace bool, filter *tracing.ProcessFilter) *HTTPFlowTracer

func (*HTTPFlowTracer) Run

func (tracer *HTTPFlowTracer) Run(ctx context.Context, constEditor []manager.ConstantEditor,
	bmaps map[string]*ebpf.Map, enableTLS bool, interval time.Duration) error

type HTTPReqFinishedInfo

type HTTPReqFinishedInfo struct {
	ConnInfo  ConnectionInfo
	HTTPStats HTTPStats
}

type HTTPStats

type HTTPStats struct {
	Direction string

	ReqMethod uint8

	Path     string
	RespCode uint32

	HTTPVersion uint32

	Recv int
	Send int

	ReqSeq  int64
	RespSeq int64

	ReqTS  uint64
	RespTS uint64
}

type ReqCache

type ReqCache struct {
	// contains filtered or unexported fields
}

func NewReqCache

func NewReqCache() *ReqCache

func (*ReqCache) AppendFinReq

func (cache *ReqCache) AppendFinReq(id CPayloadID, finReq *HTTPReqFinishedInfo)

func (*ReqCache) AppendPayload

func (cache *ReqCache) AppendPayload(payloadID CPayloadID, info *tracing.TraceInfo)

func (*ReqCache) CleanPathExpr

func (cache *ReqCache) CleanPathExpr()

func (*ReqCache) MergeReq

func (cache *ReqCache) MergeReq(etrace bool, procFilter *tracing.ProcessFilter) ([]*HTTPReqFinishedInfo, []*client.Point)

Jump to

Keyboard shortcuts

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