Versions in this module Expand all Collapse all v0 v0.0.5 Nov 13, 2021 v0.0.4 Nov 12, 2021 Changes in this version + type CLI interface + Exec func(args ...string) ([]byte, error) + type CTLimit map[string]uint64 type Client + DataPath *DataPathService + type ConnTrackReader interface + GetCTLimits func(string, []uint64) (ConntrackOutput, error) + type ConnTrackWriter interface + DelCTLimits func(string, []uint64) (string, error) + SetCTLimits func(string) (string, error) + type ConntrackOutput struct + type DataPathReader interface + GetDataPath func() ([]string, error) + Version func() (string, error) + type DataPathService struct + func NewDataPathService() *DataPathService + func (dp *DataPathService) AddDataPath(dpName string) error + func (dp *DataPathService) DelCTLimits(dpName string, zones []uint64) (string, error) + func (dp *DataPathService) DelDataPath(dpName string) error + func (dp *DataPathService) GetCTLimits(dpName string, zones []uint64) (*ConntrackOutput, error) + func (dp *DataPathService) GetDataPaths() ([]string, error) + func (dp *DataPathService) SetCTLimits(dpName string, zone map[string]uint64) (string, error) + func (dp *DataPathService) Version() (string, error) + type DataPathWriter interface + AddDataPath func(string) error + DelDataPath func(string) error + type DpCLI struct + func (cli *DpCLI) Exec(args ...string) ([]byte, error) type InterfaceOptions + BfdEnable bool v0.0.2 Aug 23, 2021 Changes in this version type InterfaceOptions + DstPort uint32 + LocalIP string v0.0.1 Aug 22, 2021 Changes in this version + const AnyTable + const DefaultIngressBurstPolicing + const DefaultIngressRatePolicing + const FlowFormatNXMTableID + const FlowFormatOXMOpenFlow14 + const PortLOCAL + const ProtocolOpenFlow10 + const ProtocolOpenFlow11 + const ProtocolOpenFlow12 + const ProtocolOpenFlow13 + const ProtocolOpenFlow14 + const ProtocolOpenFlow15 + const VLANNone + var ErrInvalidFlowStats = errors.New("invalid flow statistics") + var ErrInvalidPortRange = errors.New("invalid port range") + var ErrInvalidPortStats = errors.New("invalid port statistics") + var ErrInvalidProtoTrace = errors.New("invalid ofproto/trace output") + var ErrInvalidTable = errors.New("invalid openflow table") + func IsPortNotExist(err error) bool + func SetState(state CTState) string + func SetTCPFlag(flag TCPFlag) string + func UnsetState(state CTState) string + func UnsetTCPFlag(flag TCPFlag) string + type Action interface + func All() Action + func Conjunction(id int, dimensionNumber int, dimensionSize int) Action + func ConnectionTracking(args string) Action + func Drop() Action + func Flood() Action + func InPort() Action + func Learn(learned *LearnedFlow) Action + func Load(value string, field string) Action + func Local() Action + func ModDataLinkDestination(addr net.HardwareAddr) Action + func ModDataLinkSource(addr net.HardwareAddr) Action + func ModNetworkDestination(ip net.IP) Action + func ModNetworkSource(ip net.IP) Action + func ModTransportDestinationPort(port uint16) Action + func ModTransportSourcePort(port uint16) Action + func ModVLANVID(vid int) Action + func Move(src, dst string) Action + func Normal() Action + func Output(port int) Action + func OutputField(field string) Action + func Resubmit(port int, table int) Action + func ResubmitPort(port int) Action + func SetField(value string, field string) Action + func SetTunnel(tunnelID uint64) Action + func StripVLAN() Action + type AppService struct + func (a *AppService) ProtoTrace(bridge string, protocol Protocol, matches []Match, params ...string) (*ProtoTrace, error) + type BitRange struct + Mask uint16 + Value uint16 + type BridgeOptions struct + Protocols []string + type CTState string + const CTStateEstablished + const CTStateInvalid + const CTStateNew + const CTStateRelated + const CTStateReply + const CTStateTracked + type Client struct + App *AppService + OpenFlow *OpenFlowService + VSwitch *VSwitchService + func New(options ...OptionFunc) *Client + type DataPathActions interface + func NewDataPathActions(actions string) DataPathActions + type DataPathFlows struct + Matches []Match + Protocol Protocol + func (df *DataPathFlows) UnmarshalText(b []byte) error + type Error struct + Err error + Out []byte + func (e *Error) Error() string + type ExecFunc func(cmd string, args ...string) ([]byte, error) + type FailMode string + const FailModeSecure + const FailModeStandalone + type Flow struct + Actions []Action + Cookie uint64 + IdleTimeout int + InPort int + Matches []Match + Priority int + Protocol Protocol + Table int + func (f *Flow) MarshalText() ([]byte, error) + func (f *Flow) MatchFlow() *MatchFlow + func (f *Flow) UnmarshalText(b []byte) error + type FlowError struct + Err error + Str string + func (e *FlowError) Error() string + type FlowStats struct + ByteCount uint64 + PacketCount uint64 + func (f *FlowStats) UnmarshalText(b []byte) error + type FlowTransaction struct + func (tx *FlowTransaction) Add(flows ...*Flow) + func (tx *FlowTransaction) Commit() error + func (tx *FlowTransaction) Delete(flows ...*MatchFlow) + func (tx *FlowTransaction) Discard(err error) error + type IPFragFlag string + const IPFragFlagFirst + const IPFragFlagLater + const IPFragFlagNo + const IPFragFlagNotLater + const IPFragFlagYes + type InterfaceOptions struct + DfDefault string + IngressBurstPolicing int64 + IngressRatePolicing int64 + Key string + MTURequest int + Peer string + RemoteIP string + Type InterfaceType + type InterfaceType string + const InterfaceTypeGRE + const InterfaceTypeInternal + const InterfaceTypePatch + const InterfaceTypeSTT + const InterfaceTypeVXLAN + type LearnedFlow struct + Actions []Action + Cookie uint64 + DeleteLearned bool + FinHardTimeout int + HardTimeout int + IdleTimeout int + InPort int + Limit int + Matches []Match + Priority int + Table int + func (f *LearnedFlow) MarshalText() ([]byte, error) + type Match interface + func ARPOperation(oper uint16) Match + func ARPSourceHardwareAddress(addr net.HardwareAddr) Match + func ARPSourceProtocolAddress(ip string) Match + func ARPTargetHardwareAddress(addr net.HardwareAddr) Match + func ARPTargetProtocolAddress(ip string) Match + func ArpOp(op uint16) Match + func ConjunctionID(id uint32) Match + func ConnectionTrackingMark(mark, mask uint32) Match + func ConnectionTrackingState(state ...string) Match + func ConnectionTrackingZone(zone uint16) Match + func DataLinkDestination(addr string) Match + func DataLinkSource(addr string) Match + func DataLinkType(etherType uint16) Match + func DataLinkVLAN(vid int) Match + func DataLinkVLANPCP(pcp int) Match + func FieldMatch(field, srcOrValue string) Match + func ICMP6Code(code uint8) Match + func ICMP6Type(typ uint8) Match + func ICMPCode(code uint8) Match + func ICMPType(typ uint8) Match + func IPFrag(flag IPFragFlag) Match + func IPv6Destination(ip string) Match + func IPv6Label(label, mask uint32) Match + func IPv6Source(ip string) Match + func InPortMatch(port int) Match + func Metadata(id uint64) Match + func MetadataWithMask(id, mask uint64) Match + func NeighborDiscoverySourceLinkLayer(addr net.HardwareAddr) Match + func NeighborDiscoveryTarget(ip string) Match + func NeighborDiscoveryTargetLinkLayer(addr net.HardwareAddr) Match + func NetworkDestination(ip string) Match + func NetworkECN(ecn int) Match + func NetworkProtocol(num uint8) Match + func NetworkSource(ip string) Match + func NetworkTOS(tos int) Match + func NetworkTTL(ttl int) Match + func TCPFlags(flags ...string) Match + func TransportDestinationMaskedPort(port uint16, mask uint16) Match + func TransportDestinationPort(port uint16) Match + func TransportSourceMaskedPort(port uint16, mask uint16) Match + func TransportSourcePort(port uint16) Match + func TunnelDst(addr string) Match + func TunnelFlags(flags int) Match + func TunnelGBP(gbp int) Match + func TunnelGbpFlags(gbpFlags int) Match + func TunnelID(id uint64) Match + func TunnelIDWithMask(id, mask uint64) Match + func TunnelSrc(addr string) Match + func TunnelTOS(tos int) Match + func TunnelTTL(ttl int) Match + func VLANTCI(tci, mask uint16) Match + func VLANTCI1(tci, mask uint16) Match + type MatchFlow struct + Cookie uint64 + CookieMask uint64 + InPort int + Matches []Match + Protocol Protocol + Table int + func (f *MatchFlow) MarshalText() ([]byte, error) + type MatchFlowError struct + Err error + Str string + func (e *MatchFlowError) Error() string + type OpenFlowService struct + func (o *OpenFlowService) AddFlow(bridge string, flow *Flow) error + func (o *OpenFlowService) AddFlowBundle(bridge string, fn func(tx *FlowTransaction) error) error + func (o *OpenFlowService) DelFlows(bridge string, flow *MatchFlow) error + func (o *OpenFlowService) DumpAggregate(bridge string, flow *MatchFlow) (*FlowStats, error) + func (o *OpenFlowService) DumpFlows(bridge string) ([]*Flow, error) + func (o *OpenFlowService) DumpPort(bridge string, port string) (*PortStats, error) + func (o *OpenFlowService) DumpPorts(bridge string) ([]*PortStats, error) + func (o *OpenFlowService) DumpTables(bridge string) ([]*Table, error) + func (o *OpenFlowService) ModPort(bridge string, port string, action PortAction) error + type OptionFunc func(c *Client) + func Debug(enable bool) OptionFunc + func Exec(fn ExecFunc) OptionFunc + func FlowFormat(format string) OptionFunc + func Pipe(fn PipeFunc) OptionFunc + func Protocols(versions []string) OptionFunc + func SetSSLParam(pkey string, cert string, cacert string) OptionFunc + func SetTCPParam(addr string) OptionFunc + func Sudo() OptionFunc + func Timeout(seconds int) OptionFunc + type PipeFunc func(stdin io.Reader, cmd string, args ...string) ([]byte, error) + type PortAction string + const PortActionDown + const PortActionFlood + const PortActionForward + const PortActionNoFlood + const PortActionNoForward + const PortActionNoPacketIn + const PortActionNoReceive + const PortActionNoReceiveSTP + const PortActionNoSTP + const PortActionPacketIn + const PortActionReceive + const PortActionReceiveSTP + const PortActionSTP + const PortActionUp + type PortRange struct + End uint16 + Start uint16 + func (r *PortRange) BitwiseMatch() ([]BitRange, error) + type PortStats struct + PortID int + Received PortStatsReceive + Transmitted PortStatsTransmit + func (p *PortStats) UnmarshalText(b []byte) error + type PortStatsReceive struct + Bytes uint64 + CRC uint64 + Dropped uint64 + Errors uint64 + Frame uint64 + Over uint64 + Packets uint64 + type PortStatsTransmit struct + Bytes uint64 + Collisions uint64 + Dropped uint64 + Errors uint64 + Packets uint64 + type ProtoTrace struct + CommandStr string + DataPathActions DataPathActions + FinalFlow *DataPathFlows + FlowActions []string + InputFlow *DataPathFlows + func (pt *ProtoTrace) UnmarshalText(b []byte) error + type Protocol string + const ProtocolARP + const ProtocolICMPv4 + const ProtocolICMPv6 + const ProtocolIPv4 + const ProtocolIPv6 + const ProtocolTCPv4 + const ProtocolTCPv6 + const ProtocolUDPv4 + const ProtocolUDPv6 + type TCPFlag string + const TCPFlagACK + const TCPFlagFIN + const TCPFlagPSH + const TCPFlagRST + const TCPFlagSYN + const TCPFlagURG + type Table struct + Active int + ID int + Lookup uint64 + Matched uint64 + Max int + Name string + Wild string + func (t *Table) UnmarshalText(b []byte) error + type TransportPortRanger interface + MaskedPorts func() ([]Match, error) + func TransportDestinationPortRange(startPort uint16, endPort uint16) TransportPortRanger + func TransportSourcePortRange(startPort uint16, endPort uint16) TransportPortRanger + type VSwitchGetService struct + func (v *VSwitchGetService) Bridge(bridge string) (BridgeOptions, error) + type VSwitchService struct + Get *VSwitchGetService + Set *VSwitchSetService + func (v *VSwitchService) AddBridge(bridge string) error + func (v *VSwitchService) AddPort(bridge string, port string) error + func (v *VSwitchService) DeleteBridge(bridge string) error + func (v *VSwitchService) DeletePort(bridge string, port string) error + func (v *VSwitchService) GetController(bridge string) (string, error) + func (v *VSwitchService) GetFailMode(bridge string) (FailMode, error) + func (v *VSwitchService) ListBridges() ([]string, error) + func (v *VSwitchService) ListPorts(bridge string) ([]string, error) + func (v *VSwitchService) PortToBridge(port string) (string, error) + func (v *VSwitchService) SetController(bridge string, address string) error + func (v *VSwitchService) SetFailMode(bridge string, mode FailMode) error + type VSwitchSetService struct + func (v *VSwitchSetService) Bridge(bridge string, options BridgeOptions) error + func (v *VSwitchSetService) Interface(ifi string, options InterfaceOptions) error