maps

package
v0.0.0-...-5425248 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NF_DENY    = 0
	NF_ALLOW   = 1
	NF_XNAT    = 2
	NF_RDIR    = 4
	NF_SKIP_SM = 8
)
View Source
const (
	CfgFlagOffsetIPv6ProtoDenyAll uint8 = iota
	CfgFlagOffsetIPv4TCPProtoDenyAll
	CfgFlagOffsetIPv4TCPProtoAllowAll
	CfgFlagOffsetIPv4TCPProtoAllowNatEscape
	CfgFlagOffsetIPv4UDPProtoDenyAll
	CfgFlagOffsetIPv4UDPProtoAllowAll
	CfgFlagOffsetIPv4UDPProtoAllowNatEscape
	CfgFlagOffsetIPv4OTHProtoDenyAll
	CfgFlagOffsetIPv4TCPNatByIpPortOn
	CfgFlagOffsetIPv4TCPNatByIpOn
	CfgFlagOffsetIPv4TCPNatAllOff
	CfgFlagOffsetIPv4TCPNatOptOn
	CfgFlagOffsetIPv4TCPNatOptWithLocalAddrOn
	CfgFlagOffsetIPv4TCPNatOptWithLocalPortOn
	CfgFlagOffsetIPv4UDPNatByIpPortOn
	CfgFlagOffsetIPv4UDPNatByIpOn
	CfgFlagOffsetIPv4UDPNatByPortOn
	CfgFlagOffsetIPv4UDPNatAllOff
	CfgFlagOffsetIPv4UDPNatOptOn
	CfgFlagOffsetIPv4UDPNatOptWithLocalAddrOn
	CfgFlagOffsetIPv4UDPNatOptWithLocalPortOn
	CfgFlagOffsetIPv4AclCheckOn
	CfgFlagOffsetIPv4TraceHdrOn
	CfgFlagOffsetIPv4TraceNatOn
	CfgFlagOffsetIPv4TraceOptOn
	CfgFlagOffsetIPv4TraceAclOn
	CfgFlagOffsetIPv4TraceFlowOn
	CfgFlagOffsetIPv4TraceByIpOn
	CfgFlagOffsetIPv4TraceByPortOn
	CfgFlagMax
)

Variables

This section is empty.

Functions

func AddAclEntry

func AddAclEntry(aclKey *AclKey, aclVal *AclVal) error

func AddIFaceEntry

func AddIFaceEntry(ifaceKey *IFaceKey, ifaceVal *IFaceVal) error

func AddNatEntry

func AddNatEntry(natKey *NatKey, natVal *NatVal) error

func AddTCPFlowEntry

func AddTCPFlowEntry(flowKey *FlowKey, flowVal *FlowTCPVal) error

func AddTCPOptEntry

func AddTCPOptEntry(optKey *OptKey, optVal *OptVal) error

func AddTraceIPEntry

func AddTraceIPEntry(traceIPKey *TraceIPKey, traceIPVal *TraceIPVal) error

func AddTracePortEntry

func AddTracePortEntry(tracePortKey *TracePortKey, tracePortVal *TracePortVal) error

func AddUDPFlowEntry

func AddUDPFlowEntry(flowKey *FlowKey, flowVal *FlowUDPVal) error

func AddUDPOptEntry

func AddUDPOptEntry(optKey *OptKey, optVal *OptVal) error

func DelAclEntry

func DelAclEntry(aclKey *AclKey) error

func DelIFaceEntry

func DelIFaceEntry(ifaceKey *IFaceKey) error

func DelNatEntry

func DelNatEntry(natKey *NatKey) error

func DelTCPFlowEntry

func DelTCPFlowEntry(flowKey *FlowKey) error

func DelTCPOptEntry

func DelTCPOptEntry(optKey *OptKey) error

func DelTraceIPEntry

func DelTraceIPEntry(traceIPKey *TraceIPKey) error

func DelTracePortEntry

func DelTracePortEntry(tracePortKey *TracePortKey) error

func DelUDPFlowEntry

func DelUDPFlowEntry(flowKey *FlowKey) error

func DelUDPOptEntry

func DelUDPOptEntry(optKey *OptKey) error

func FlushIdleTCPFlowEntries

func FlushIdleTCPFlowEntries(idleSeconds, batchSize int) (int, error)

func FlushIdleUDPFlowEntries

func FlushIdleUDPFlowEntries(idleSeconds, batchSize int) (int, error)

func GetAclEntries

func GetAclEntries() map[AclKey]AclVal

func GetIFaceEntries

func GetIFaceEntries() map[IFaceKey]IFaceVal

func InitProgEntries

func InitProgEntries() error

func SetXNetCfg

func SetXNetCfg(cfgVal *CfgVal) error

func ShowAclEntries

func ShowAclEntries()

func ShowCfgEntries

func ShowCfgEntries()

func ShowIFaceEntries

func ShowIFaceEntries()

func ShowNatEntries

func ShowNatEntries()

func ShowProgEntries

func ShowProgEntries()

func ShowTCPFlowEntries

func ShowTCPFlowEntries()

func ShowTCPOptEntries

func ShowTCPOptEntries()

func ShowTraceIPEntries

func ShowTraceIPEntries()

func ShowTracePortEntries

func ShowTracePortEntries()

func ShowUDPFlowEntries

func ShowUDPFlowEntries()

func ShowUDPOptEntries

func ShowUDPOptEntries()

Types

type Acl

type Acl uint8
const (
	ACL_DENY    Acl = 0
	ACL_AUDIT   Acl = 1
	ACL_TRUSTED Acl = 2
)

type AclKey

type AclKey FsmAclKeyT

func (*AclKey) String

func (t *AclKey) String() string

type AclVal

type AclVal FsmAclOpT

func (*AclVal) String

func (t *AclVal) String() string

type CfgKey

type CfgKey uint32

type CfgVal

type CfgVal FsmCfgT

func GetXNetCfg

func GetXNetCfg() (*CfgVal, error)

func (*CfgVal) Clear

func (t *CfgVal) Clear(bit uint8)

func (*CfgVal) Get

func (t *CfgVal) Get(bit uint8) uint8

func (*CfgVal) IsSet

func (t *CfgVal) IsSet(bit uint8) bool

func (*CfgVal) Set

func (t *CfgVal) Set(bit uint8)

func (*CfgVal) String

func (t *CfgVal) String() string

type FlowKey

type FlowKey FsmFlowT

func (*FlowKey) String

func (t *FlowKey) String() string

type FlowTCPVal

type FlowTCPVal FsmFlowTOpT

func (*FlowTCPVal) String

func (t *FlowTCPVal) String() string

type FlowUDPVal

type FlowUDPVal FsmFlowUOpT

func (*FlowUDPVal) String

func (t *FlowUDPVal) String() string

type FsmAclKeyT

type FsmAclKeyT struct {
	Addr  [4]uint32
	Port  uint16
	Proto uint8
}

type FsmAclOpT

type FsmAclOpT struct {
	Acl  uint8
	Flag uint8
	Id   uint16
}

type FsmCfgT

type FsmCfgT struct{ Flags uint64 }

type FsmFlowT

type FsmFlowT struct {
	Daddr [4]uint32
	Saddr [4]uint32
	Dport uint16
	Sport uint16
	Proto uint8
	V6    uint8
}

type FsmFlowTOpT

type FsmFlowTOpT struct {
	Lock    struct{ Val uint32 }
	FlowDir uint8
	Fin     uint8
	Nfs     [2]uint8
	Atime   uint64
	Xnat    struct {
		Xmac  [6]uint8
		Rmac  [6]uint8
		Xaddr [4]uint32
		Raddr [4]uint32
		Xport uint16
		Rport uint16
	}
	Trans struct {
		Tcp struct {
			Conns [2]struct {
				Seq        uint32
				PrevSeq    uint32
				PrevAckSeq uint32
				InitAcks   uint32
			}
			State  uint8
			FinDir uint8
			// contains filtered or unexported fields
		}
	}
	DoTrans uint8
	// contains filtered or unexported fields
}

type FsmFlowUOpT

type FsmFlowUOpT struct {
	Lock    struct{ Val uint32 }
	FlowDir uint8
	Fin     uint8
	Nfs     [2]uint8
	Atime   uint64
	Xnat    struct {
		Xmac  [6]uint8
		Rmac  [6]uint8
		Xaddr [4]uint32
		Raddr [4]uint32
		Xport uint16
		Rport uint16
	}
	Trans struct {
		Udp struct{ Conns struct{ Pkts uint32 } }
		// contains filtered or unexported fields
	}
	DoTrans uint8
	// contains filtered or unexported fields
}

type FsmIfInfoT

type FsmIfInfoT struct {
	Ifi  uint32
	Addr [4]uint32
	Mac  [6]uint8
}

type FsmIfNameT

type FsmIfNameT struct {
	Len  uint8
	Name [16]uint8
}

type FsmNatKeyT

type FsmNatKeyT struct {
	Daddr [4]uint32
	Dport uint16
	Proto uint8
	V6    uint8
	TcDir uint8
}

type FsmNatOpT

type FsmNatOpT struct {
	Lock  struct{ Val uint32 }
	EpSel uint16
	EpCnt uint16
	Eps   [128]struct {
		Raddr    [4]uint32
		Rport    uint16
		Rmac     [6]uint8
		Inactive uint8
		// contains filtered or unexported fields
	}
}

type FsmOptKeyT

type FsmOptKeyT struct {
	Laddr [4]uint32
	Raddr [4]uint32
	Lport uint16
	Rport uint16
	Proto uint8
	V6    uint8
}

type FsmTrIpT

type FsmTrIpT struct{ Addr [4]uint32 }

type FsmTrOpT

type FsmTrOpT struct{ TcDir [2]uint8 }

type FsmTrPortT

type FsmTrPortT struct{ Port uint16 }

type IFaceKey

type IFaceKey FsmIfNameT

func (*IFaceKey) String

func (t *IFaceKey) String() string

type IFaceVal

type IFaceVal FsmIfInfoT

func GetIFaceEntry

func GetIFaceEntry(ifaceKey *IFaceKey) (*IFaceVal, error)

func (*IFaceVal) String

func (t *IFaceVal) String() string

type L4Proto

type L4Proto uint8
const (
	IPPROTO_TCP L4Proto = 6
	IPPROTO_UDP L4Proto = 17
)

type NatKey

type NatKey FsmNatKeyT

func (*NatKey) String

func (t *NatKey) String() string

type NatVal

type NatVal FsmNatOpT

func GetNatEntry

func GetNatEntry(natKey *NatKey) (*NatVal, error)

func (*NatVal) AddEp

func (t *NatVal) AddEp(raddr net.IP, rport uint16, rmac []uint8, inactive bool) (bool, error)

func (*NatVal) DelEp

func (t *NatVal) DelEp(raddr net.IP, rport uint16) error

func (*NatVal) String

func (t *NatVal) String() string

type OptKey

type OptKey FsmOptKeyT

func (*OptKey) String

func (t *OptKey) String() string

type OptVal

type OptVal FsmFlowT

func (*OptVal) String

func (t *OptVal) String() string

type ProgKey

type ProgKey uint32

type ProgVal

type ProgVal int

type TcDir

type TcDir uint8
const (
	TC_DIR_IGR TcDir = 0
	TC_DIR_EGR TcDir = 1
)

type TraceIPKey

type TraceIPKey FsmTrIpT

func (*TraceIPKey) String

func (t *TraceIPKey) String() string

type TraceIPVal

type TraceIPVal FsmTrOpT

func (*TraceIPVal) String

func (t *TraceIPVal) String() string

type TracePortKey

type TracePortKey FsmTrPortT

func (*TracePortKey) String

func (t *TracePortKey) String() string

type TracePortVal

type TracePortVal FsmTrOpT

func (*TracePortVal) String

func (t *TracePortVal) String() string

type UpStream

type UpStream struct {
	Addr string
	Port uint16
}

Jump to

Keyboard shortcuts

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