openflow13

package
v0.0.0-...-d967b14 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionType_Output     = 0
	ActionType_CopyTtlOut = 11
	ActionType_CopyTtlIn  = 12
	ActionType_SetMplsTtl = 15
	ActionType_DecMplsTtl = 16
	ActionType_PushVlan   = 17
	ActionType_PopVlan    = 18
	ActionType_PushMpls   = 19
	ActionType_PopMpls    = 20
	ActionType_SetQueue   = 21
	ActionType_Group      = 22
	ActionType_SetNwTtl   = 23
	ActionType_DecNwTtl   = 24
	ActionType_SetField   = 25
	ActionType_PushPbb    = 26
	ActionType_PopPbb     = 27

	ActionType_Experimenter = 0xffff
)

ofp_action_type 1.3

View Source
const (
	OFPCML_MAX       = 0xffe5 /* maximum max_len value which can be used to request a specific byte length. */
	OFPCML_NO_BUFFER = 0xffff /* indicates that no buffering should be applied and the whole packet is to be sent to the controller. */
)

ofp_controller_max_len 1.3

View Source
const (
	OFPBCT_OPEN_REQUEST uint16 = iota
	OFPBCT_OPEN_REPLY
	OFPBCT_CLOSE_REQUEST
	OFPBCT_CLOSE_REPLY
	OFPBCT_COMMIT_REQUEST
	OFPBCT_COMMIT_REPLY
	OFPBCT_DISCARD_REQUEST
	OFPBCT_DISCARD_REPLY
)

Bundle control types

View Source
const (
	Type_BundleCtrl uint32 = 2300
	Type_BundleAdd  uint32 = 2301
)

Bundle message types

View Source
const (
	OFPBCT_ATOMIC  = uint16(1 << 0)
	OFPBCT_ORDERED = uint16(1 << 1)
)

Bundle control flags

View Source
const (
	BEC_UNKNOWN           uint16 = 2300 /* Unspecified error. */
	BEC_ERERM             uint16 = 2301 /* Permissions error. */
	BEC_BAD_ID            uint16 = 2302 /* Bundle ID doesn't exist. */
	BEC_BUNDLE_EXIST      uint16 = 2303 /* Bundle ID already exist. */
	BEC_BUNDLE_CLOSED     uint16 = 2304 /* Bundle ID is closed. */
	BEC_OUT_OF_BUNDLE     uint16 = 2305 /* Too many bundle IDs. */
	BEC_BAD_TYPE          uint16 = 2306 /* Unsupported or unknown message control type. */
	BEC_BAD_FLAGS         uint16 = 2307 /* Unsupported, unknown or inconsistent flags. */
	BEC_MSG_BAD_LEN       uint16 = 2308 /* Length problem in included message. */
	BEC_MSG_BAD_XID       uint16 = 2309 /* Inconsistent or duplicate XID. */
	BEC_MSG_UNSUP         uint16 = 2310 /* Unsupported message in this bundle. */
	BEC_MSG_CONFLICT      uint16 = 2311 /* Unsupported message combination in this bundle. */
	BEC_MSG_TOO_MANY      uint16 = 2312 /* Can't handle this many messages in bundle. */
	BEC_MSG_FAILD         uint16 = 2313 /* One message in bundle failed. */
	BEC_TIMEOUT           uint16 = 2314 /* Bundle is taking too long. */
	BEC_BUNDLE_IN_PROCESS uint16 = 2315 /* Bundle is locking the resource. */
)

Bundle error code.

View Source
const (
	FC_ADD = iota // OFPFC_ADD = 0
	FC_MODIFY
	FC_MODIFY_STRICT
	FC_DELETE
	FC_DELETE_STRICT
)

ofp_flow_mod_command 1.3

View Source
const (
	FF_SEND_FLOW_REM = 1 << 0 /* Send flow removed message when flow expires or is deleted. */
	FF_CHECK_OVERLAP = 1 << 1 /* Check for overlapping entries first */
	FF_RESET_COUNTS  = 1 << 2 /* Reset flow packet and byte counts */
	FF_NO_PKT_COUNTS = 1 << 3 /* Don’t keep track of packet count */
	FF_NO_BYT_COUNTS = 1 << 4 /* Don’t keep track of byte count */
)

ofp_flow_mod_flags 1.3

View Source
const (
	RR_IDLE_TIMEOUT = iota /* Flow idle time exceeded idle_timeout. */
	RR_HARD_TIMEOUT        /* Time exceeded hard_timeout. */
	RR_DELETE              /* Evicted by a DELETE flow mod. */
	RR_GROUP_DELETE        /* Group was removed. */
)

ofp_flow_removed_reason 1.3

View Source
const (
	OFPG_MAX = 0xffffff00 /* Last usable group number. */
	/* Fake groups. */
	OFPG_ALL = 0xfffffffc /* Represents all groups for group delete commands. */
	OFPG_ANY = 0xffffffff /* Wildcard group used only for flow stats requests. Selects all flows regardless of group (including flows with no group).
	 */
)
View Source
const (
	OFPGC_ADD           = 0 /* New group. */
	OFPGC_MODIFY        = 1 /* Modify all matching groups. */
	OFPGC_DELETE        = 2 /* Delete all matching groups. */
	OFPGC_INSERT_BUCKET = 3 /* Insert action buckets to the already available
	list of action buckets in a matching group */
)
View Source
const (
	OFPGT_ALL      = 0 /* All (multicast/broadcast) group. */
	OFPGT_SELECT   = 1 /* Select group. */
	OFPGT_INDIRECT = 2 /* Indirect group. */
	OFPGT_FF       = 3 /* Fast failover group. */
)
View Source
const (
	InstrType_GOTO_TABLE     = 1      /* Setup the next table in the lookup pipeline */
	InstrType_WRITE_METADATA = 2      /* Setup the metadata field for use later in pipeline */
	InstrType_WRITE_ACTIONS  = 3      /* Write the action(s) onto the datapath action set */
	InstrType_APPLY_ACTIONS  = 4      /* Applies the action(s) immediately */
	InstrType_CLEAR_ACTIONS  = 5      /* Clears all actions from the datapath action set */
	InstrType_METER          = 6      /* Apply meter (rate limiter) */
	InstrType_EXPERIMENTER   = 0xFFFF /* Experimenter instruction */
)

ofp_instruction_type 1.3

View Source
const (
	MatchType_Standard = iota /* Deprecated. */
	MatchType_OXM
)

ofp_match_type 1.3

View Source
const (
	OXM_CLASS_NXM_0          = 0x0000 /* Backward compatibility with NXM */
	OXM_CLASS_NXM_1          = 0x0001 /* Backward compatibility with NXM */
	OXM_CLASS_OPENFLOW_BASIC = 0x8000 /* Basic class for OpenFlow */
	OXM_CLASS_EXPERIMENTER   = 0xFFFF /* Experimenter class */

	ONF_EXPERIMENTER_ID = 0x4f4e4600 /* ONF Experimenter ID */
)

ofp_oxm_class 1.3

View Source
const (
	OXM_FIELD_IN_PORT        = 0  /* Switch input port. */
	OXM_FIELD_IN_PHY_PORT    = 1  /* Switch physical input port. */
	OXM_FIELD_METADATA       = 2  /* Metadata passed between tables. */
	OXM_FIELD_ETH_DST        = 3  /* Ethernet destination address. */
	OXM_FIELD_ETH_SRC        = 4  /* Ethernet source address. */
	OXM_FIELD_ETH_TYPE       = 5  /* Ethernet frame type. */
	OXM_FIELD_VLAN_VID       = 6  /* VLAN id. */
	OXM_FIELD_VLAN_PCP       = 7  /* VLAN priority. */
	OXM_FIELD_IP_DSCP        = 8  /* IP DSCP (6 bits in ToS field). */
	OXM_FIELD_IP_ECN         = 9  /* IP ECN (2 bits in ToS field). */
	OXM_FIELD_IP_PROTO       = 10 /* IP protocol. */
	OXM_FIELD_IPV4_SRC       = 11 /* IPv4 source address. */
	OXM_FIELD_IPV4_DST       = 12 /* IPv4 destination address. */
	OXM_FIELD_TCP_SRC        = 13 /* TCP source port. */
	OXM_FIELD_TCP_DST        = 14 /* TCP destination port. */
	OXM_FIELD_UDP_SRC        = 15 /* UDP source port. */
	OXM_FIELD_UDP_DST        = 16 /* UDP destination port. */
	OXM_FIELD_SCTP_SRC       = 17 /* SCTP source port. */
	OXM_FIELD_SCTP_DST       = 18 /* SCTP destination port. */
	OXM_FIELD_ICMPV4_TYPE    = 19 /* ICMP type. */
	OXM_FIELD_ICMPV4_CODE    = 20 /* ICMP code. */
	OXM_FIELD_ARP_OP         = 21 /* ARP opcode. */
	OXM_FIELD_ARP_SPA        = 22 /* ARP source IPv4 address. */
	OXM_FIELD_ARP_TPA        = 23 /* ARP target IPv4 address. */
	OXM_FIELD_ARP_SHA        = 24 /* ARP source hardware address. */
	OXM_FIELD_ARP_THA        = 25 /* ARP target hardware address. */
	OXM_FIELD_IPV6_SRC       = 26 /* IPv6 source address. */
	OXM_FIELD_IPV6_DST       = 27 /* IPv6 destination address. */
	OXM_FIELD_IPV6_FLABEL    = 28 /* IPv6 Flow Label */
	OXM_FIELD_ICMPV6_TYPE    = 29 /* ICMPv6 type. */
	OXM_FIELD_ICMPV6_CODE    = 30 /* ICMPv6 code. */
	OXM_FIELD_IPV6_ND_TARGET = 31 /* Target address for ND. */
	OXM_FIELD_IPV6_ND_SLL    = 32 /* Source link-layer for ND. */
	OXM_FIELD_IPV6_ND_TLL    = 33 /* Target link-layer for ND. */
	OXM_FIELD_MPLS_LABEL     = 34 /* MPLS label. */
	OXM_FIELD_MPLS_TC        = 35 /* MPLS TC. */
	OXM_FIELD_MPLS_BOS       = 36 /* MPLS BoS bit. */
	OXM_FIELD_PBB_ISID       = 37 /* PBB I-SID. */
	OXM_FIELD_TUNNEL_ID      = 38 /* Logical Port Metadata. */
	OXM_FIELD_IPV6_EXTHDR    = 39 /* IPv6 Extension Header pseudo-field */
	OXM_FIELD_PBB_UCA        = 41 /* PBB UCA header field (from OpenFlow 1.4) */
	OXM_FIELD_TCP_FLAGS      = 42 /* TCP flags (from OpenFlow 1.5) */
	OXM_FIELD_ACTSET_OUTPUT  = 43 /* actset output port number (from OpenFlow 1.5) */
)
View Source
const (
	NXM_NX_REG0          = 0  /* nicira extension: reg0 */
	NXM_NX_REG1          = 1  /* nicira extension: reg1 */
	NXM_NX_REG2          = 2  /* nicira extension: reg2 */
	NXM_NX_REG3          = 3  /* nicira extension: reg3 */
	NXM_NX_REG4          = 4  /* nicira extension: reg4 */
	NXM_NX_REG5          = 5  /* nicira extension: reg5 */
	NXM_NX_REG6          = 6  /* nicira extension: reg6 */
	NXM_NX_REG7          = 7  /* nicira extension: reg7 */
	NXM_NX_REG8          = 8  /* nicira extension: reg8 */
	NXM_NX_REG9          = 9  /* nicira extension: reg9 */
	NXM_NX_REG10         = 10 /* nicira extension: reg10 */
	NXM_NX_REG11         = 11 /* nicira extension: reg11 */
	NXM_NX_REG12         = 12 /* nicira extension: reg12 */
	NXM_NX_REG13         = 13 /* nicira extension: reg13 */
	NXM_NX_REG14         = 14 /* nicira extension: reg14 */
	NXM_NX_REG15         = 15 /* nicira extension: reg15 */
	NXM_NX_TUN_ID        = 16 /* nicira extension: tun_id, VNI */
	NXM_NX_ARP_SHA       = 17 /* nicira extension: arp_sha, ARP Source Ethernet Address */
	NXM_NX_ARP_THA       = 18 /* nicira extension: arp_tha, ARP Target Ethernet Address */
	NXM_NX_IPV6_SRC      = 19 /* nicira extension: tun_ipv6_src, IPv6 source address */
	NXM_NX_IPV6_DST      = 20 /* nicira extension: tun_ipv6_src, IPv6 destination address */
	NXM_NX_ICMPV6_TYPE   = 21 /* nicira extension: icmpv6_type, ICMPv6 type */
	NXM_NX_ICMPV6_CODE   = 22 /* nicira extension: icmpv6_code, ICMPv6 code */
	NXM_NX_ND_TARGET     = 23 /* nicira extension: nd_target, ICMPv6 neighbor discovery source ethernet address*/
	NXM_NX_ND_SLL        = 24 /* nicira extension: nd_sll, ICMPv6 neighbor discovery source ethernet address*/
	NXM_NX_ND_TLL        = 25 /* nicira extension: nd_tll, ICMPv6 neighbor discovery target ethernet address */
	NXM_NX_IP_FRAG       = 26 /* nicira extension: ip_frag, IP fragments */
	NXM_NX_IPV6_LABEL    = 27 /* nicira extension: ipv6_label, least 20 bits hold flow label from IPv6 header, others are zero*/
	NXM_NX_IP_ECN        = 28 /* nicira extension: nw_ecn, TOS byte with DSCP bits cleared to 0 */
	NXM_NX_IP_TTL        = 29 /* nicira extension: nw_ttl, time-to-live field */
	NXM_NX_MPLS_TTL      = 30 /* nicira extension: mpls_ttl, time-to-live field from MPLS label */
	NXM_NX_TUN_IPV4_SRC  = 31 /* nicira extension: tun_src, src IPv4 address of tunnel */
	NXM_NX_TUN_IPV4_DST  = 32 /* nicira extension: tun_dst, dst IPv4 address of tunnel */
	NXM_NX_PKT_MARK      = 33 /* nicira extension: pkg_mark, packet mark from Linux kernal */
	NXM_NX_TCP_FLAGS     = 34 /* nicira extension: tcp_flags */
	NXM_NX_DP_HASH       = 35
	NXM_NX_RECIRC_ID     = 36  /* nicira extension: recirc_id, used with ct */
	NXM_NX_CONJ_ID       = 37  /* nicira extension: conj_id, conjunction ID for conjunctive match */
	NXM_NX_TUN_GBP_ID    = 38  /* nicira extension: tun_gbp_id, GBP policy ID */
	NXM_NX_TUN_GBP_FLAGS = 39  /* nicira extension: tun_gbp_flags, GBP policy Flags*/
	NXM_NX_TUN_METADATA0 = 40  /* nicira extension: tun_metadata, for Geneve header variable data */
	NXM_NX_TUN_METADATA1 = 41  /* nicira extension: tun_metadata, for Geneve header variable data */
	NXM_NX_TUN_METADATA2 = 42  /* nicira extension: tun_metadata, for Geneve header variable data */
	NXM_NX_TUN_METADATA3 = 43  /* nicira extension: tun_metadata, for Geneve header variable data */
	NXM_NX_TUN_METADATA4 = 44  /* nicira extension: tun_metadata, for Geneve header variable data */
	NXM_NX_TUN_METADATA5 = 45  /* nicira extension: tun_metadata, for Geneve header variable data */
	NXM_NX_TUN_METADATA6 = 46  /* nicira extension: tun_metadata, for Geneve header variable data */
	NXM_NX_TUN_METADATA7 = 47  /* nicira extension: tun_metadata, for Geneve header variable data */
	NXM_NX_TUN_FLAGS     = 104 /* nicira extension: tunnel Flags */
	NXM_NX_CT_STATE      = 105 /* nicira extension: ct_state for conn_track */
	NXM_NX_CT_ZONE       = 106 /* nicira extension: ct_zone for conn_track */
	NXM_NX_CT_MARK       = 107 /* nicira extension: ct_mark for conn_track */
	NXM_NX_CT_LABEL      = 108 /* nicira extension: ct_label for conn_track */
	NXM_NX_TUN_IPV6_SRC  = 109 /* nicira extension: tun_dst_ipv6, dst IPv6 address of tunnel */
	NXM_NX_TUN_IPV6_DST  = 110 /* nicira extension: tun_dst_ipv6, src IPv6 address of tunnel */
	NXM_NX_XXREG0        = 111 /* nicira extension: xxreg0 */
	NXM_NX_XXREG1        = 112 /* nicira extension: xxreg0 */
	NXM_NX_XXREG2        = 113 /* nicira extension: xxreg0 */
	NXM_NX_XXREG3        = 114 /* nicira extension: xxreg0 */
	NXM_NX_CT_NW_PROTO   = 119 /* nicira extension: ct_nw_proto, the protocol byte in the IPv4 or IPv6 header forthe original direction tuple of the conntrack entry */
	NXM_NX_CT_NW_SRC     = 120 /* nicira extension: ct_nw_src, source IPv4 address of the original direction tuple of the conntrack entry */
	NXM_NX_CT_NW_DST     = 121 /* nicira extension: ct_nw_dst, destination IPv4 address of the original direction tuple of the conntrack entry */
	NXM_NX_CT_IPV6_SRC   = 122 /* nicira extension: ct_ipv6_src, source IPv6 address of the original direction tuple of the conntrack entry */
	NXM_NX_CT_IPV6_DST   = 123 /* nicira extension: ct_ipv6_dst, destination IPv6 address of the original direction tuple of the conntrack entry */
	NXM_NX_CT_TP_SRC     = 124 /* nicira extension: ct_tp_src, transport layer source port of the original direction tuple of the conntrack entry */
	NXM_NX_CT_TP_DST     = 125 /* nicira extension: ct_tp_dst, transport layer destination port of the original direction tuple of the conntrack entry */
)
View Source
const (
	OFPMBT13_DROP         = 1      /* Drop packet. */
	OFPMBT13_DSCP_REMARK  = 2      /* Remark DSCP in the IP header. */
	OFPMBT13_EXPERIMENTER = 0xFFFF /* Experimenter meter band. */

	OFPMC_ADD    = 0 /* New meter. */
	OFPMC_MODIFY = 1 /* Modify specified meter. */
	OFPMC_DELETE = 2 /* Delete specified meter. */

	OFPMF13_KBPS  = 0b0001 /* Rate value in kb/s (kilo-bit per second). */
	OFPMF13_PKTPS = 0b0010 /* Rate value in packet/sec. */
	OFPMF13_BURST = 0b0100 /* Do burst size. */
	OFPMF13_STATS = 0b1000 /* Collect statistics. */

	/* Meter numbering. Flow meters can use any number up to OFPM_MAX. */
	OFPM13_MAX        = 0xffff0000 /* Last usable meter. */
	OFPM13_SLOWPATH   = 0xfffffffd /* Meter for slow datapath. */
	OFPM13_CONTROLLER = 0xfffffffe /* Meter for controller connection. */
	OFPM13_ALL        = 0xffffffff /* Represents all meters for stat requests commands. */

	METER_BAND_HEADER_LEN = 12
	METER_BAND_LEN        = 16
)
View Source
const (
	OFPMPF_REQ_MORE   = 1 << 0 /* More requests to follow. */
	OFPMPF_REPLY_MORE = 1 << 0 /* More replies to follow. */
)

ofp_multipart_request_flags & ofp_multipart_reply_flags 1.3

View Source
const (
	/* Description of this OpenFlow switch.
	 * The request body is empty.
	 * The reply body is struct ofp_desc_stats. */
	MultipartType_Desc = iota

	/* Individual flow statistics.
	 * The request body is struct ofp_flow_stats_request.
	 * The reply body is an array of struct ofp_flow_stats. */
	MultipartType_Flow

	/* Aggregate flow statistics.
	 * The request body is struct ofp_aggregate_stats_request.
	 * The reply body is struct ofp_aggregate_stats_reply. */
	MultipartType_Aggregate

	/* Flow table statistics.
	 * The request body is empty.
	 * The reply body is an array of struct ofp_table_stats. */
	MultipartType_Table

	/* Port statistics.
	 * The request body is struct ofp_port_stats_request.
	 * The reply body is an array of struct ofp_port_stats. */
	MultipartType_Port

	/* Queue statistics for a port
	 * The request body is struct _queue_stats_request.
	 * The reply body is an array of struct ofp_queue_stats */
	MultipartType_Queue

	/* Group counter statistics.
	 * The request body is struct ofp_group_stats_request.
	 * The reply is an array of struct ofp_group_stats. */
	MultipartType_Group

	/* Group description.
	 * The request body is empty.
	 * The reply body is an array of struct ofp_group_desc. */
	MultipartType_GroupDesc

	/* Group features.
	 * The request body is empty.
	 * The reply body is struct ofp_group_features. */
	MultipartType_GroupFeatures

	/* Meter statistics.
	 * The request body is struct ofp_meter_multipart_requests.
	 * The reply body is an array of struct ofp_meter_stats. */
	MultipartType_Meter

	/* Meter configuration.
	 * The request body is struct ofp_meter_multipart_requests.
	 * The reply body is an array of struct ofp_meter_config. */
	MultipartType_MeterConfig

	/* Meter features.
	 * The request body is empty.
	 * The reply body is struct ofp_meter_features. */
	MultipartType_MeterFeatures

	/* Table features.
	 * The request body is either empty or contains an array of
	 * struct ofp_table_features containing the controller’s
	 * desired view of the switch. If the switch is unable to
	 * set the specified view an error is returned.
	 * The reply body is an array of struct ofp_table_features. */
	MultipartType_TableFeatures

	/* Port description.
	 * The request body is empty.
	 * The reply body is an array of struct ofp_port. */
	MultipartType_PortDesc

	/* Experimenter extension.
	 * The request and reply bodies begin with
	 * struct ofp_experimenter_multipart_header.
	 * The request and reply bodies are otherwise experimenter-defined. */
	MultipartType_Experimenter = 0xffff
)

_stats_types

View Source
const (
	DESC_STR_LEN   = 256
	SERIAL_NUM_LEN = 32
)
View Source
const (
	OFPTT_MAX = 0xfe
	/* Fake tables. */
	OFPTT_ALL = 0xff /* Wildcard table used for table config, flow stats and flow deletes. */
)
View Source
const (
	PR_ADD = iota
	PR_DELETE
	PR_MODIFY
)

ofp_port_reason 1.0

View Source
const (
	NxExperimenterID     = 0x00002320 // Vendor ID for Nicira extension messages
	NxActionHeaderLength = 10         // Length of Nicira extension message header
)

NX Action constants

View Source
const (
	NXAST_RESUBMIT         = 1  // Nicira extended action: resubmit(port)
	NXAST_SET_TUNNEL       = 2  // Nicira extended action: set_tunnel
	NXAST_DROP_SPOOFED_ARP = 3  // Nicira extended action: drop spoofed arp packets
	NXAST_SET_QUEUE        = 4  // Nicira extended action: set_queue
	NXAST_POP_QUEUE        = 5  // Nicira extended action: pop_tunnel
	NXAST_REG_MOVE         = 6  // Nicira extended action: move:srcField[m1..n1]->dstField[m2..n2]
	NXAST_REG_LOAD         = 7  // Nicira extended action: load:data->dstField[m..n]
	NXAST_NOTE             = 8  // Nicira extended action: note
	NXAST_SET_TUNNEL_V6    = 9  // Nicira extended action: set_tunnel64
	NXAST_MULTIPATH        = 10 // Nicira extended action: set_tunnel
	NXAST_AUTOPATH         = 11 // Nicira extended action: multipath
	NXAST_BUNDLE           = 12 // Nicira extended action: bundle
	NXAST_BUNDLE_LOAD      = 13 // Nicira extended action: bundle_load
	NXAST_RESUBMIT_TABLE   = 14 // Nicira extended action: resubmit(port, table)
	NXAST_OUTPUT_REG       = 15 // Nicira extended action: output:field
	NXAST_LEARN            = 16 // Nicira extended action: learn
	NXAST_EXIT             = 17 // Nicira extended action: exit
	NXAST_DEC_TTL          = 18 // Nicira extended action: dec_ttl
	NXAST_FIN_TIMEOUT      = 19 // Nicira extended action: fin_timeout
	NXAST_CONTROLLER       = 20 // Nicira extended action: controller(reason=xx,max_len=xx,id=xx)
	NXAST_DEC_TTL_CNT_IDS  = 21 // Nicira extended action: dec_ttl(id1,[id2]...)
	NXAST_PUSH_MPLS        = 23 // Nicira extended action: push_mpls
	NXAST_POP_MPLS         = 24 // Nicira extended action: pop_mpls
	NXAST_SET_MPLS_TTL     = 25 // Nicira extended action: set_mpls_ttl
	NXAST_DEC_MPLS_TTL     = 26 // Nicira extended action: dec_mpls_ttl
	NXAST_STACK_PUSH       = 27 // Nicira extended action: push:src
	NXAST_STACK_POP        = 28 // Nicira extended action: pop:dst
	NXAST_SAMPLE           = 29 // Nicira extended action: sample
	NXAST_SET_MPLS_LABEL   = 30 // Nicira extended action: set_mpls_label
	NXAST_SET_MPLS_TC      = 31 // Nicira extended action: set_mpls_tc
	NXAST_OUTPUT_REG2      = 32 // Nicira extended action: output(port=port,max_len)
	NXAST_REG_LOAD2        = 33 // Nicira extended action: load
	NXAST_CONJUNCTION      = 34 // Nicira extended action: conjunction
	NXAST_CT               = 35 // Nicira extended action: ct
	NXAST_NAT              = 36 // Nicira extended action: nat, need to be along with ct action
	NXAST_CONTROLLER2      = 37 // Nicira extended action: controller(userdata=xxx,pause)
	NXAST_SAMPLE2          = 38 // Nicira extended action: sample, support for exporting egress tunnel
	NXAST_OUTPUT_TRUNC     = 39 // Nicira extended action: truncate output action
	NXAST_CT_CLEAR         = 43 // Nicira extended action: ct_clear
	NXAST_CT_RESUBMIT      = 44 // Nicira extended action: resubmit to table in ct
	NXAST_RAW_ENCAP        = 46 // Nicira extended action: encap
	NXAST_RAW_DECAP        = 47 // Nicira extended action: decap
	NXAST_DEC_NSH_TTL      = 48 // Nicira extended action: dec_nsh_ttl
)

NX Action subtypes

View Source
const (
	NX_CT_STATE_NEW_OFS  = 0
	NX_CT_STATE_EST_OFS  = 1
	NX_CT_STATE_REL_OFS  = 2
	NX_CT_STATE_RPL_OFS  = 3
	NX_CT_STATE_INV_OFS  = 4
	NX_CT_STATE_TRK_OFS  = 5
	NX_CT_STATE_SNAT_OFS = 6
	NX_CT_STATE_DNAT_OFS = 7
)

NX_CT_STATES

View Source
const (
	NX_CT_F_COMMIT    = 1 << 0
	NX_CT_F_FORCE     = 1 << 1
	NX_CT_RECIRC_NONE = 0xff
)

NX_CT Flags

View Source
const (
	NX_NAT_RANGE_IPV4_MIN  = 1 << 0
	NX_NAT_RANGE_IPV4_MAX  = 1 << 1
	NX_NAT_RANGE_IPV6_MIN  = 1 << 2
	NX_NAT_RANGE_IPV6_MAX  = 1 << 3
	NX_NAT_RANGE_PROTO_MIN = 1 << 4
	NX_NAT_RANGE_PROTO_MAX = 1 << 5
)

NX_NAT_RANGE flags

View Source
const (
	NX_NAT_F_SRC          = 1 << 0
	NX_NAT_F_DST          = 1 << 1
	NX_NAT_F_PERSISTENT   = 1 << 2
	NX_NAT_F_PROTO_HASH   = 1 << 3
	NX_NAT_F_PROTO_RANDOM = 1 << 4
	NX_NAT_F_MASK         = (NX_NAT_F_SRC | NX_NAT_F_DST | NX_NAT_F_PERSISTENT | NX_NAT_F_PROTO_HASH | NX_NAT_F_PROTO_RANDOM)
)

NX_NAT flags

View Source
const (
	NX_LEARN_F_SEND_FLOW_REM  = 1 << 0
	NX_LEARN_F_DELETE_LEARNED = 1 << 1
	NX_LEARN_F_WRITE_RESULT   = 1 << 2
)

NX_LEARN flags

View Source
const (
	LEARN_SPEC_HEADER_LOAD  = 11
	LEARN_SPEC_HEADER_MATCH = 13
)

NX_LEARN field offset

View Source
const (
	NXM_OF_IN_PORT uint8 = iota
	NXM_OF_ETH_DST
	NXM_OF_ETH_SRC
	NXM_OF_ETH_TYPE
	NXM_OF_VLAN_TCI
	NXM_OF_IP_TOS
	NXM_OF_IP_PROTO
	NXM_OF_IP_SRC
	NXM_OF_IP_DST
	NXM_OF_TCP_SRC
	NXM_OF_TCP_DST
	NXM_OF_UDP_SRC
	NXM_OF_UDP_DST
	NXM_OF_ICMP_TYPE
	NXM_OF_ICMP_CODE
	NXM_OF_ARP_OP
	NXM_OF_ARP_SPA
	NXM_OF_ARP_TPA
)

NXM_OF fields. The class number of these fields are 0x0000.

View Source
const (
	NXTTMC_ADD = iota
	NXTTMC_DELETE
	NXTTMC_CLEAR
)

TLV_Table_Mod commands.

View Source
const (
	Type_SetFlowFormat     = 12
	Type_FlowModTableId    = 15
	Type_SetPacketInFormat = 16
	Type_SetControllerId   = 20
	Type_TlvTableMod       = 24
	Type_TlvTableRequest   = 25
	Type_TlvTableReply     = 26
	Type_Resume            = 28
	Type_CtFlushZone       = 29
)

Nicira extension messages.

View Source
const (
	OFPERR_NXTTMFC_BAD_COMMAND     = 16
	OFPERR_NXTTMFC_BAD_OPT_LEN     = 17
	ERR_NXTTMFC_BAD_FIELD_IDX      = 18
	OFPERR_NXTTMFC_TABLE_FULL      = 19
	OFPERR_NXTTMFC_ALREADY_MAPPED  = 20
	OFPERR_NXTTMFC_DUP_ENTRY       = 21
	OFPERR_NXTTMFC_INVALID_TLV_DEL = 38
)

ofpet_tlv_table_mod_failed_code 1.3

View Source
const (
	/* Immutable messages. */
	Type_Hello        = 0
	Type_Error        = 1
	Type_EchoRequest  = 2
	Type_EchoReply    = 3
	Type_Experimenter = 4

	/* Switch configuration messages. */
	Type_FeaturesRequest  = 5
	Type_FeaturesReply    = 6
	Type_GetConfigRequest = 7
	Type_GetConfigReply   = 8
	Type_SetConfig        = 9

	/* Asynchronous messages. */
	Type_PacketIn    = 10
	Type_FlowRemoved = 11
	Type_PortStatus  = 12

	/* Controller command messages. */
	Type_PacketOut = 13
	Type_FlowMod   = 14
	Type_GroupMod  = 15
	Type_PortMod   = 16
	Type_TableMod  = 17

	/* Multipart messages. */
	Type_MultiPartRequest = 18
	Type_MultiPartReply   = 19

	/* Barrier messages. */
	Type_BarrierRequest = 20
	Type_BarrierReply   = 21

	/* Queue Configuration messages. */
	Type_QueueGetConfigRequest = 22
	Type_QueueGetConfigReply   = 23

	/* Controller role change request messages. */
	Type_RoleRequest = 24
	Type_RoleReply   = 25

	/* Asynchronous message configuration. */
	Type_GetAsyncRequest = 26
	Type_GetAsyncReply   = 27
	Type_SetAsync        = 28

	/* Meters and rate limiters configuration messages. */
	Type_MeterMod = 29
)

ofp_type 1.3

View Source
const (
	R_NO_MATCH    = iota /* No matching flow (table-miss flow entry). */
	R_ACTION             /* Action explicitly output to controller. */
	R_INVALID_TTL        /* Packet has invalid TTL */
)

ofp_packet_in_reason 1.3

View Source
const (
	C_FRAG_NORMAL = 0
	C_FRAG_DROP   = 1
	C_FRAG_REASM  = 2
	C_FRAG_MASK   = 3
)

ofp_config_flags 1.3

View Source
const (
	ET_HELLO_FAILED          = 0      /* Hello protocol failed. */
	ET_BAD_REQUEST           = 1      /* Request was not understood. */
	ET_BAD_ACTION            = 2      /* Error in action description. */
	ET_BAD_INSTRUCTION       = 3      /* Error in instruction list. */
	PET_BAD_MATCH            = 4      /* Error in match. */
	ET_FLOW_MOD_FAILED       = 5      /* Problem modifying flow entry. */
	ET_GROUP_MOD_FAILED      = 6      /* Problem modifying group entry. */
	ET_PORT_MOD_FAILED       = 7      /* Port mod request failed. */
	ET_TABLE_MOD_FAILED      = 8      /* Table mod request failed. */
	ET_QUEUE_OP_FAILED       = 9      /* Queue operation failed. */
	ET_ROLE_REQUEST_FAILED   = 11     /* Controller Role request failed. */
	ET_METER_MOD_FAILED      = 12     /* Error in meter. */
	ET_TABLE_FEATURES_FAILED = 13     /* Setting table features failed. */
	ET_EXPERIMENTER          = 0xffff /* Experimenter error messages. */
)

ofp_error_type 1.3

View Source
const (
	HFC_INCOMPATIBLE = iota
	HFC_EPERM
)

ofp_hello_failed_code 1.3

View Source
const (
	BRC_BAD_VERSION = iota
	BRC_BAD_TYPE
	BRC_BAD_MULTIPART
	BRC_BAD_EXPERIMENTER

	BRC_BAD_EXP_TYPE
	BRC_EPERM
	BRC_BAD_LEN
	BRC_BUFFER_EMPTY
	BRC_BUFFER_UNKNOWN
	BRC_BAD_TABLE_ID
	BRC_IS_SLAVE
	BRC_BAD_PORT
	BRC_BAD_PACKET
	BRC_MULTIPART_BUFFER_OVERFLOW
)

ofp_bad_request_code 1.3

View Source
const (
	BAC_BAD_TYPE = iota
	BAC_BAD_LEN
	BAC_BAD_EXPERIMENTER
	BAC_BAD_EXP_TYPE
	BAC_BAD_OUT_PORT
	BAC_BAD_ARGUMENT
	BAC_EPERM
	BAC_TOO_MANY
	BAC_BAD_QUEUE
	BAC_BAD_OUT_GROUP
	BAC_MATCH_INCONSISTENT
	BAC_UNSUPPORTED_ORDER
	BAC_BAD_TAG
	BAC_BAD_SET_TYPE
	BAC_BAD_SET_LEN
	BAC_BAD_SET_ARGUMENT
)

ofp_bad_action_code 1.3

View Source
const (
	BIC_UNKNOWN_INST        = 0 /* Unknown instruction. */
	BIC_UNSUP_INST          = 1 /* Switch or table does not support the instruction. */
	BIC_BAD_TABLE_ID        = 2 /* Invalid Table-ID specified. */
	BIC_UNSUP_METADATA      = 3 /* Metadata value unsupported by datapath. */
	BIC_UNSUP_METADATA_MASK = 4 /* Metadata mask value unsupported by datapath. */
	BIC_BAD_EXPERIMENTER    = 5 /* Unknown experimenter id specified. */
	BIC_BAD_EXP_TYPE        = 6 /* Unknown instruction for experimenter id. */
	BIC_BAD_LEN             = 7 /* Length problem in instructions. */
	BIC_EPERM               = 8 /* Permissions error. */
)

ofp_bad_instruction_code 1.3

View Source
const (
	FMFC_UNKNOWN      = 0 /* Unspecified error. */
	FMFC_TABLE_FULL   = 1 /* Flow not added because table was full. */
	FMFC_BAD_TABLE_ID = 2 /* Table does not exist */
	FMFC_OVERLAP      = 3 /* Attempted to add overlapping flow with CHECK_OVERLAP flag set. */
	FMFC_EPERM        = 4 /* Permissions error. */
	FMFC_BAD_TIMEOUT  = 5 /* Flow not added because of unsupported idle/hard timeout. */
	FMFC_BAD_COMMAND  = 6 /* Unsupported or unknown command. */
	FMFC_BAD_FLAGS    = 7 /* Unsupported or unknown flags. */
)

ofp_flow_mod_failed_code 1.3

View Source
const (
	BMC_BAD_TYPE         = 0  /* Unsupported match type specified by the match */
	BMC_BAD_LEN          = 1  /* Length problem in match. */
	BMC_BAD_TAG          = 2  /* Match uses an unsupported tag/encap. */
	BMC_BAD_DL_ADDR_MASK = 3  /* Unsupported datalink addr mask - switch does not support arbitrary datalink address mask. */
	BMC_BAD_NW_ADDR_MASK = 4  /* Unsupported network addr mask - switch does not support arbitrary network address mask. */
	BMC_BAD_WILDCARDS    = 5  /* Unsupported combination of fields masked or omitted in the match. */
	BMC_BAD_FIELD        = 6  /* Unsupported field type in the match. */
	BMC_BAD_VALUE        = 7  /* Unsupported value in a match field. */
	BMC_BAD_MASK         = 8  /* Unsupported mask specified in the match, field is not dl-address or nw-address. */
	BMC_BAD_PREREQ       = 9  /* A prerequisite was not met. */
	BMC_DUP_FIELD        = 10 /* A field type was duplicated. */
	BMC_EPERM            = 11 /* Permissions error. */
)

ofp_bad_match_code 1.3

View Source
const (
	GMFC_GROUP_EXISTS         = 0  /* Group not added because a group ADD attempted to replace an already-present group. */
	GMFC_INVALID_GROUP        = 1  /* Group not added because Group specified is invalid. */
	GMFC_WEIGHT_UNSUPPORTED   = 2  /* Switch does not support unequal load 105 ➞ 2013; The Open Networking Foundation OpenFlow Switch Specification Version 1.3.3 sharing with select groups. */
	GMFC_OUT_OF_GROUPS        = 3  /* The group table is full. */
	GMFC_OUT_OF_BUCKETS       = 4  /* The maximum number of action buckets for a group has been exceeded. */
	GMFC_CHAINING_UNSUPPORTED = 5  /* Switch does not support groups that forward to groups. */
	GMFC_WATCH_UNSUPPORTED    = 6  /* This group cannot watch the watch_port or watch_group specified. */
	GMFC_LOOP                 = 7  /* Group entry would cause a loop. */
	GMFC_UNKNOWN_GROUP        = 8  /* Group not modified because a group MODIFY attempted to modify a non-existent group. */
	GMFC_CHAINED_GROUP        = 9  /* Group not deleted because another group is forwarding to it. */
	GMFC_BAD_TYPE             = 10 /* Unsupported or unknown group type. */
	GMFC_BAD_COMMAND          = 11 /* Unsupported or unknown command. */
	GMFC_BAD_BUCKET           = 12 /* Error in bucket. */
	GMFC_BAD_WATCH            = 13 /* Error in watch port/group. */
	GMFC_EPERM                = 14 /* Permissions error. */
)

ofp_group_mod_failed_code 1.3

View Source
const (
	PMFC_BAD_PORT = iota
	PMFC_BAD_HW_ADDR
	PMFC_BAD_CONFIG
	PMFC_BAD_ADVERTISE
	PMFC_EPERM
)

ofp_port_mod_failed_code 1.0

View Source
const (
	TMFC_BAD_TABLE  = 0 /* Specified table does not exist. */
	TMFC_BAD_CONFIG = 1 /* Specified config is invalid. */
	TMFC_EPERM      = 2 /* Permissions error. */
)

ofp_table_mod_failed_code

View Source
const (
	QOFC_BAD_PORT = iota
	QOFC_BAD_QUEUE
	QOFC_EPERM
)

ofp_queue_op_failed_code 1.0

View Source
const (
	C_FLOW_STATS   = 1 << 0
	C_TABLE_STATS  = 1 << 1
	C_PORT_STATS   = 1 << 2
	C_GROUP_STATS  = 1 << 3
	C_RESERVED     = 1 << 4
	C_IP_REASM     = 1 << 5
	C_QUEUE_STATS  = 1 << 6
	C_PORT_BLOCKED = 1 << 8
)

ofp_capabilities 1.3

View Source
const (
	ETH_ALEN          = 6
	MAX_PORT_NAME_LEN = 16
)
View Source
const (
	PC_PORT_DOWN = 1 << 0

	PC_NO_RECV      = 1 << 2
	PC_NO_FWD       = 1 << 5
	PC_NO_PACKET_IN = 1 << 6
)

ofp_port_config 1.3

View Source
const (
	PS_LINK_DOWN = 1 << 0
	PS_BLOCKED   = 1 << 1
	PS_LIVE      = 1 << 2
)

ofp_port_state 1.3

View Source
const (
	P_MAX = 0xffffff00

	P_IN_PORT = 0xfffffff8
	P_TABLE   = 0xfffffff9

	P_NORMAL = 0xfffffffa
	P_FLOOD  = 0xfffffffb

	P_ALL        = 0xfffffffc
	P_CONTROLLER = 0xfffffffd
	P_LOCAL      = 0xfffffffe
	P_ANY        = 0xffffffff
)

ofp_port_no 1.3

View Source
const (
	PF_10MB_HD  = 1 << 0
	PF_10MB_FD  = 1 << 1
	PF_100MB_HD = 1 << 2
	PF_100MB_FD = 1 << 3
	PF_1GB_HD   = 1 << 4
	PF_1GB_FD   = 1 << 5
	PF_10GB_FD  = 1 << 6
	PF_40GB_FD  = 1 << 7
	PF_100GB_FD = 1 << 8
	PF_1TB_FD   = 1 << 9
	PF_OTHER    = 1 << 10

	PF_COPPER     = 1 << 11
	PF_FIBER      = 1 << 12
	PF_AUTONEG    = 1 << 13
	PF_PAUSE      = 1 << 14
	PF_PAUSE_ASYM = 1 << 15
)

ofp_port_features 1.3

View Source
const (
	MAX_TABLE_NAME_LEN = 32
)
View Source
const (
	OFPBPT_EXPERIMENTER = 0xFFFF
)

Bundle property types

View Source
const (
	// OFPP_IN_PORT is the default number of in_port field in resubmit actions.
	OFPP_IN_PORT = 0xfff8
)
View Source
const OFPVID_NONE = 0x0000 /* No VLAN id was set. */
View Source
const OFPVID_PRESENT = 0x1000 /* Bit that indicate that a VLAN id is set */
View Source
const (
	VERSION = 4
)

Variables

View Source
var NewOfp13Header func() common.Header = common.NewHeaderGenerator(VERSION)

Returns a new OpenFlow header with version field set to v1.3.

Functions

func DecodeMatchField

func DecodeMatchField(class uint16, field uint8, length uint8, hasMask bool, data []byte) (util.Message, error)

func NewConfigRequest

func NewConfigRequest() *common.Header

func NewEchoReply

func NewEchoReply() *common.Header

Echo request/reply messages can be sent from either the switch or the controller, and must return an echo reply. They can be used to indicate the latency, bandwidth, and/or liveness of a controller-switch connection.

func NewEchoRequest

func NewEchoRequest() *common.Header

Echo request/reply messages can be sent from either the switch or the controller, and must return an echo reply. They can be used to indicate the latency, bandwidth, and/or liveness of a controller-switch connection.

func NewFeaturesRequest

func NewFeaturesRequest() *common.Header

FeaturesRequest constructor

func Parse

func Parse(b []byte) (message util.Message, err error)

func ParseBundleError

func ParseBundleError(errCode uint16) error

ParseBundleError returns error according to bundle error code.

Types

type Action

type Action interface {
	Header() *ActionHeader
	util.Message
}

func DecodeAction

func DecodeAction(data []byte) (Action, error)

Decode Action types.

func DecodeNxAction

func DecodeNxAction(data []byte) Action

type ActionDecNwTtl

type ActionDecNwTtl struct {
	ActionHeader
	// contains filtered or unexported fields
}

func NewActionDecNwTtl

func NewActionDecNwTtl() *ActionDecNwTtl

func (*ActionDecNwTtl) Len

func (a *ActionDecNwTtl) Len() (n uint16)

func (*ActionDecNwTtl) MarshalBinary

func (a *ActionDecNwTtl) MarshalBinary() (data []byte, err error)

func (*ActionDecNwTtl) UnmarshalBinary

func (a *ActionDecNwTtl) UnmarshalBinary(data []byte) error

type ActionGroup

type ActionGroup struct {
	ActionHeader
	GroupId uint32
}

func NewActionGroup

func NewActionGroup(group uint32) *ActionGroup

func (*ActionGroup) Len

func (a *ActionGroup) Len() (n uint16)

func (*ActionGroup) MarshalBinary

func (a *ActionGroup) MarshalBinary() (data []byte, err error)

func (*ActionGroup) UnmarshalBinary

func (a *ActionGroup) UnmarshalBinary(data []byte) error

type ActionHeader

type ActionHeader struct {
	Type   uint16
	Length uint16
}

func (*ActionHeader) Header

func (a *ActionHeader) Header() *ActionHeader

func (*ActionHeader) Len

func (a *ActionHeader) Len() (n uint16)

func (*ActionHeader) MarshalBinary

func (a *ActionHeader) MarshalBinary() (data []byte, err error)

func (*ActionHeader) UnmarshalBinary

func (a *ActionHeader) UnmarshalBinary(data []byte) error

type ActionMplsTtl

type ActionMplsTtl struct {
	ActionHeader
	MplsTtl uint8
	// contains filtered or unexported fields
}

type ActionNwTtl

type ActionNwTtl struct {
	ActionHeader
	NwTtl uint8
	// contains filtered or unexported fields
}

type ActionOutput

type ActionOutput struct {
	ActionHeader
	Port   uint32
	MaxLen uint16
	// contains filtered or unexported fields
}

Action structure for OFPAT_OUTPUT, which sends packets out ’port’. When the ’port’ is the OFPP_CONTROLLER, ’max_len’ indicates the max number of bytes to send. A ’max_len’ of zero means no bytes of the packet should be sent.

func NewActionOutput

func NewActionOutput(portNum uint32) *ActionOutput

Returns a new Action Output message which sends packets out port number.

func (*ActionOutput) Len

func (a *ActionOutput) Len() (n uint16)

func (*ActionOutput) MarshalBinary

func (a *ActionOutput) MarshalBinary() (data []byte, err error)

func (*ActionOutput) UnmarshalBinary

func (a *ActionOutput) UnmarshalBinary(data []byte) error

type ActionPopMpls

type ActionPopMpls struct {
	ActionHeader
	EtherType uint16
	// contains filtered or unexported fields
}

func NewActionPopMpls

func NewActionPopMpls(etherType uint16) *ActionPopMpls

func (*ActionPopMpls) Len

func (a *ActionPopMpls) Len() (n uint16)

func (*ActionPopMpls) MarshalBinary

func (a *ActionPopMpls) MarshalBinary() (data []byte, err error)

func (*ActionPopMpls) UnmarshalBinary

func (a *ActionPopMpls) UnmarshalBinary(data []byte) error

type ActionPopVlan

type ActionPopVlan struct {
	ActionHeader
	// contains filtered or unexported fields
}

func NewActionPopVlan

func NewActionPopVlan() *ActionPopVlan

func (*ActionPopVlan) Len

func (a *ActionPopVlan) Len() (n uint16)

func (*ActionPopVlan) MarshalBinary

func (a *ActionPopVlan) MarshalBinary() (data []byte, err error)

func (*ActionPopVlan) UnmarshalBinary

func (a *ActionPopVlan) UnmarshalBinary(data []byte) error

type ActionPush

type ActionPush struct {
	ActionHeader
	EtherType uint16
	// contains filtered or unexported fields
}

func NewActionPushMpls

func NewActionPushMpls(etherType uint16) *ActionPush

func NewActionPushVlan

func NewActionPushVlan(etherType uint16) *ActionPush

func (*ActionPush) Len

func (a *ActionPush) Len() (n uint16)

func (*ActionPush) MarshalBinary

func (a *ActionPush) MarshalBinary() (data []byte, err error)

func (*ActionPush) UnmarshalBinary

func (a *ActionPush) UnmarshalBinary(data []byte) error

type ActionSetField

type ActionSetField struct {
	ActionHeader
	Field MatchField
}

func NewActionSetField

func NewActionSetField(field MatchField) *ActionSetField

func (*ActionSetField) Len

func (a *ActionSetField) Len() (n uint16)

func (*ActionSetField) MarshalBinary

func (a *ActionSetField) MarshalBinary() (data []byte, err error)

func (*ActionSetField) UnmarshalBinary

func (a *ActionSetField) UnmarshalBinary(data []byte) error

type ActionSetqueue

type ActionSetqueue struct {
	ActionHeader
	QueueId uint32
}

func NewActionSetQueue

func NewActionSetQueue(queue uint32) *ActionSetqueue

func (*ActionSetqueue) Len

func (a *ActionSetqueue) Len() (n uint16)

func (*ActionSetqueue) MarshalBinary

func (a *ActionSetqueue) MarshalBinary() (data []byte, err error)

func (*ActionSetqueue) UnmarshalBinary

func (a *ActionSetqueue) UnmarshalBinary(data []byte) error

type ActsetOutputField

type ActsetOutputField struct {
	OutputPort uint32
}

ACTSET_OUTPUT field

func (*ActsetOutputField) Len

func (m *ActsetOutputField) Len() uint16

func (*ActsetOutputField) MarshalBinary

func (m *ActsetOutputField) MarshalBinary() (data []byte, err error)

func (*ActsetOutputField) UnmarshalBinary

func (m *ActsetOutputField) UnmarshalBinary(data []byte) error

type AggregateStats

type AggregateStats struct {
	PacketCount uint64
	ByteCount   uint64
	FlowCount   uint32
	// contains filtered or unexported fields
}

ofp_aggregate_stats_reply 1.3

func NewAggregateStats

func NewAggregateStats() *AggregateStats

func (*AggregateStats) Len

func (s *AggregateStats) Len() (n uint16)

func (*AggregateStats) MarshalBinary

func (s *AggregateStats) MarshalBinary() (data []byte, err error)

func (*AggregateStats) UnmarshalBinary

func (s *AggregateStats) UnmarshalBinary(data []byte) error

type AggregateStatsRequest

type AggregateStatsRequest struct {
	TableId uint8

	OutPort  uint32
	OutGroup uint32

	Cookie     uint64
	CookieMask uint64
	Match
	// contains filtered or unexported fields
}

ofp_aggregate_stats_request 1.3

func NewAggregateStatsRequest

func NewAggregateStatsRequest() *AggregateStatsRequest

func (*AggregateStatsRequest) Len

func (s *AggregateStatsRequest) Len() (n uint16)

func (*AggregateStatsRequest) MarshalBinary

func (s *AggregateStatsRequest) MarshalBinary() (data []byte, err error)

func (*AggregateStatsRequest) UnmarshalBinary

func (s *AggregateStatsRequest) UnmarshalBinary(data []byte) error

type ArpOperField

type ArpOperField struct {
	ArpOper uint16
}

ARP Oper type field

func (*ArpOperField) Len

func (m *ArpOperField) Len() uint16

func (*ArpOperField) MarshalBinary

func (m *ArpOperField) MarshalBinary() (data []byte, err error)

func (*ArpOperField) UnmarshalBinary

func (m *ArpOperField) UnmarshalBinary(data []byte) error

type ArpXHaField

type ArpXHaField struct {
	ArpHa net.HardwareAddr
}

ARP Host Address field message, used by arp_sha and arp_tha match

func (*ArpXHaField) Len

func (m *ArpXHaField) Len() uint16

func (*ArpXHaField) MarshalBinary

func (m *ArpXHaField) MarshalBinary() (data []byte, err error)

func (*ArpXHaField) UnmarshalBinary

func (m *ArpXHaField) UnmarshalBinary(data []byte) error

type ArpXPaField

type ArpXPaField struct {
	ArpPa net.IP
}

ARP Protocol Address field message, used by arp_spa and arp_tpa match

func (*ArpXPaField) Len

func (m *ArpXPaField) Len() uint16

func (*ArpXPaField) MarshalBinary

func (m *ArpXPaField) MarshalBinary() (data []byte, err error)

func (*ArpXPaField) UnmarshalBinary

func (m *ArpXPaField) UnmarshalBinary(data []byte) error

type Bucket

type Bucket struct {
	Length     uint16 /* Length the bucket in bytes, including this header and any padding to make it 64-bit aligned. */
	Weight     uint16 /* Relative weight of bucket. Only defined for select groups. */
	WatchPort  uint32 /* Used for FRR groups */
	WatchGroup uint32 /* Used for FRR groups */

	Actions []Action /* zero or more actions */
	// contains filtered or unexported fields
}

func NewBucket

func NewBucket() *Bucket

Create a new Bucket

func (*Bucket) AddAction

func (b *Bucket) AddAction(act Action)

Add an action to the bucket

func (*Bucket) Len

func (b *Bucket) Len() (n uint16)

func (*Bucket) MarshalBinary

func (b *Bucket) MarshalBinary() (data []byte, err error)

func (*Bucket) UnmarshalBinary

func (b *Bucket) UnmarshalBinary(data []byte) error

type BundleAdd

type BundleAdd struct {
	BundleID uint32

	Flags      uint16
	Message    util.Message
	Properties []BundlePropertyExperimenter
	// contains filtered or unexported fields
}

BundleAdd is a message to add supported message in the opened bundle. After all required messages are added, close the bundle and commit it. The Switch will realized added messages in the bundle. Discard the bundle after close it, if the added messages are not wanted to realize on the switch.

func (*BundleAdd) Len

func (b *BundleAdd) Len() (n uint16)

func (*BundleAdd) MarshalBinary

func (b *BundleAdd) MarshalBinary() (data []byte, err error)

func (*BundleAdd) UnmarshalBinary

func (b *BundleAdd) UnmarshalBinary(data []byte) error

type BundleControl

type BundleControl struct {
	BundleID uint32
	Type     uint16
	Flags    uint16
}

BundleControl is a message to control the bundle.

func (*BundleControl) Len

func (b *BundleControl) Len() (n uint16)

func (*BundleControl) MarshalBinary

func (b *BundleControl) MarshalBinary() (data []byte, err error)

func (*BundleControl) UnmarshalBinary

func (b *BundleControl) UnmarshalBinary(data []byte) error

type BundlePropertyExperimenter

type BundlePropertyExperimenter struct {
	Type             uint16
	Length           uint16
	ExperimenterID   uint32
	ExperimenterType uint32
	// contains filtered or unexported fields
}

func NewBundlePropertyExperimenter

func NewBundlePropertyExperimenter() *BundlePropertyExperimenter

func (*BundlePropertyExperimenter) Len

func (*BundlePropertyExperimenter) MarshalBinary

func (p *BundlePropertyExperimenter) MarshalBinary() (data []byte, err error)

func (*BundlePropertyExperimenter) UnmarshalBinary

func (p *BundlePropertyExperimenter) UnmarshalBinary(data []byte) error

type ByteArrayField

type ByteArrayField struct {
	Data   []byte
	Length uint8
}

func (*ByteArrayField) Len

func (m *ByteArrayField) Len() uint16

Len returns the length of ByteArrayField. The length of ByteArrayField should be multiple of 8 byte.

func (*ByteArrayField) MarshalBinary

func (m *ByteArrayField) MarshalBinary() (data []byte, err error)

func (*ByteArrayField) UnmarshalBinary

func (m *ByteArrayField) UnmarshalBinary(data []byte) error

type CTLabel

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

func (*CTLabel) Len

func (m *CTLabel) Len() uint16

func (*CTLabel) MarshalBinary

func (m *CTLabel) MarshalBinary() (data []byte, err error)

func (*CTLabel) UnmarshalBinary

func (m *CTLabel) UnmarshalBinary(data []byte) error

type CTStates

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

func NewCTStates

func NewCTStates() *CTStates

func (*CTStates) SetDNAT

func (s *CTStates) SetDNAT()

SetDNAT sets ct_state as "+dnat".

func (*CTStates) SetEst

func (s *CTStates) SetEst()

SetEst sets ct_state as "+est".

func (*CTStates) SetInv

func (s *CTStates) SetInv()

SetInv sets ct_state as "+inv".

func (*CTStates) SetNew

func (s *CTStates) SetNew()

SetNew sets ct_state as "+new".

func (*CTStates) SetRel

func (s *CTStates) SetRel()

SetRel sets ct_state as "+rel".

func (*CTStates) SetRpl

func (s *CTStates) SetRpl()

SetRpl sets ct_state as "+rpl".

func (*CTStates) SetSNAT

func (s *CTStates) SetSNAT()

SetSNAT sets ct_state as "+snat".

func (*CTStates) SetTrk

func (s *CTStates) SetTrk()

SetTrk sets ct_state as "+trk".

func (*CTStates) UnsetDNAT

func (s *CTStates) UnsetDNAT()

UnsetDNAT sets ct_state as "-dnat".

func (*CTStates) UnsetEst

func (s *CTStates) UnsetEst()

UnsetEst sets ct_state as "-est".

func (*CTStates) UnsetInv

func (s *CTStates) UnsetInv()

UnsetInv sets ct_state as "-inv".

func (*CTStates) UnsetNew

func (s *CTStates) UnsetNew()

UnsetNew sets ct_state as "-new".

func (*CTStates) UnsetRel

func (s *CTStates) UnsetRel()

UnsetRel sets ct_state as "-rel".

func (*CTStates) UnsetRpl

func (s *CTStates) UnsetRpl()

UnsetRpl sets ct_state as "-rpl".

func (*CTStates) UnsetSNAT

func (s *CTStates) UnsetSNAT()

UnsetSNAT sets ct_state as "-snat".

func (*CTStates) UnsetTrk

func (s *CTStates) UnsetTrk()

UnsetTrk sets ct_state as "-trk".

type ControllerID

type ControllerID struct {
	ID uint16
	// contains filtered or unexported fields
}

func (*ControllerID) Len

func (c *ControllerID) Len() uint16

func (*ControllerID) MarshalBinary

func (c *ControllerID) MarshalBinary() (data []byte, err error)

func (*ControllerID) UnmarshalBinary

func (c *ControllerID) UnmarshalBinary(data []byte) error

type DescStats

type DescStats struct {
	MfrDesc   []byte // Size DESC_STR_LEN
	HWDesc    []byte // Size DESC_STR_LEN
	SWDesc    []byte // Size DESC_STR_LEN
	SerialNum []byte // Size SERIAL_NUM_LEN
	DPDesc    []byte // Size DESC_STR_LEN
}

ofp_desc_stats 1.3

func NewDescStats

func NewDescStats() *DescStats

func (*DescStats) Len

func (s *DescStats) Len() (n uint16)

func (*DescStats) MarshalBinary

func (s *DescStats) MarshalBinary() (data []byte, err error)

func (*DescStats) UnmarshalBinary

func (s *DescStats) UnmarshalBinary(data []byte) error

type ErrorMsg

type ErrorMsg struct {
	common.Header
	Type uint16
	Code uint16
	Data util.Buffer
}

BEGIN: ofp13 - 7.4.4 ofp_error_msg 1.3

func NewErrorMsg

func NewErrorMsg() *ErrorMsg

func (*ErrorMsg) Len

func (e *ErrorMsg) Len() (n uint16)

func (*ErrorMsg) MarshalBinary

func (e *ErrorMsg) MarshalBinary() (data []byte, err error)

func (*ErrorMsg) UnmarshalBinary

func (e *ErrorMsg) UnmarshalBinary(data []byte) error

type EthDstField

type EthDstField struct {
	EthDst net.HardwareAddr
}

ETH_DST field

func (*EthDstField) Len

func (m *EthDstField) Len() uint16

func (*EthDstField) MarshalBinary

func (m *EthDstField) MarshalBinary() (data []byte, err error)

func (*EthDstField) UnmarshalBinary

func (m *EthDstField) UnmarshalBinary(data []byte) error

type EthSrcField

type EthSrcField struct {
	EthSrc net.HardwareAddr
}

ETH_SRC field

func (*EthSrcField) Len

func (m *EthSrcField) Len() uint16

func (*EthSrcField) MarshalBinary

func (m *EthSrcField) MarshalBinary() (data []byte, err error)

func (*EthSrcField) UnmarshalBinary

func (m *EthSrcField) UnmarshalBinary(data []byte) error

type EthTypeField

type EthTypeField struct {
	EthType uint16
}

ETH_TYPE field

func (*EthTypeField) Len

func (m *EthTypeField) Len() uint16

func (*EthTypeField) MarshalBinary

func (m *EthTypeField) MarshalBinary() (data []byte, err error)

func (*EthTypeField) UnmarshalBinary

func (m *EthTypeField) UnmarshalBinary(data []byte) error

type FlowMod

type FlowMod struct {
	common.Header
	Cookie     uint64
	CookieMask uint64

	TableId uint8 /* ID of the table to put the flow in */
	Command uint8 /* flowmod command */

	IdleTimeout uint16 /* Idle time before discarding (seconds). */
	HardTimeout uint16 /* Max time before discarding (seconds). */

	Priority uint16 /* Priority level of flow entry. */
	BufferId uint32 /* Buffered packet to apply to */

	OutPort  uint32
	OutGroup uint32
	Flags    uint16

	Match        Match         // Fields to match
	Instructions []Instruction //  Instruction set - 0 or more.
	// contains filtered or unexported fields
}

ofp_flow_mod 1.3

func NewFlowMod

func NewFlowMod() *FlowMod

func (*FlowMod) AddInstruction

func (f *FlowMod) AddInstruction(instr Instruction)

func (*FlowMod) Len

func (f *FlowMod) Len() (n uint16)

func (*FlowMod) MarshalBinary

func (f *FlowMod) MarshalBinary() (data []byte, err error)

func (*FlowMod) UnmarshalBinary

func (f *FlowMod) UnmarshalBinary(data []byte) error

type FlowRemoved

type FlowRemoved struct {
	common.Header
	Cookie   uint64
	Priority uint16
	Reason   uint8
	TableId  uint8

	DurationSec  uint32
	DurationNSec uint32

	IdleTimeout uint16
	HardTimeout uint16

	PacketCount uint64
	ByteCount   uint64

	Match Match
}

BEGIN: ofp13 - 7.4.2

func NewFlowRemoved

func NewFlowRemoved() *FlowRemoved

func (*FlowRemoved) Len

func (f *FlowRemoved) Len() (n uint16)

func (*FlowRemoved) MarshalBinary

func (f *FlowRemoved) MarshalBinary() (data []byte, err error)

func (*FlowRemoved) UnmarshalBinary

func (f *FlowRemoved) UnmarshalBinary(data []byte) error

type FlowStats

type FlowStats struct {
	Length  uint16
	TableId uint8

	DurationSec  uint32
	DurationNSec uint32
	Priority     uint16
	IdleTimeout  uint16
	HardTimeout  uint16
	Flags        uint16

	Cookie       uint64
	PacketCount  uint64
	ByteCount    uint64
	Match        Match
	Instructions []Instruction
	// contains filtered or unexported fields
}

ofp_flow_stats 1.3

func NewFlowStats

func NewFlowStats() *FlowStats

func (*FlowStats) Len

func (s *FlowStats) Len() (n uint16)

func (*FlowStats) MarshalBinary

func (s *FlowStats) MarshalBinary() (data []byte, err error)

func (*FlowStats) UnmarshalBinary

func (s *FlowStats) UnmarshalBinary(data []byte) error

type FlowStatsRequest

type FlowStatsRequest struct {
	TableId uint8

	OutPort  uint32
	OutGroup uint32

	Cookie     uint64
	CookieMask uint64
	Match      Match
	// contains filtered or unexported fields
}

ofp_flow_stats_request 1.3

func NewFlowStatsRequest

func NewFlowStatsRequest() *FlowStatsRequest

func (*FlowStatsRequest) Len

func (s *FlowStatsRequest) Len() (n uint16)

func (*FlowStatsRequest) MarshalBinary

func (s *FlowStatsRequest) MarshalBinary() (data []byte, err error)

func (*FlowStatsRequest) UnmarshalBinary

func (s *FlowStatsRequest) UnmarshalBinary(data []byte) error

type GroupMod

type GroupMod struct {
	common.Header
	Command uint16 /* One of OFPGC_*. */
	Type    uint8  /* One of OFPGT_*. */

	GroupId uint32   /* Group identifier. */
	Buckets []Bucket /* List of buckets */
	// contains filtered or unexported fields
}

GroupMod message

func NewGroupMod

func NewGroupMod() *GroupMod

Create a new group mode message

func (*GroupMod) AddBucket

func (g *GroupMod) AddBucket(bkt Bucket)

Add a bucket to group mod

func (*GroupMod) Len

func (g *GroupMod) Len() (n uint16)

func (*GroupMod) MarshalBinary

func (g *GroupMod) MarshalBinary() (data []byte, err error)

func (*GroupMod) UnmarshalBinary

func (g *GroupMod) UnmarshalBinary(data []byte) error

type IcmpCodeField

type IcmpCodeField struct {
	Code uint8
}

func (*IcmpCodeField) Len

func (f *IcmpCodeField) Len() uint16

func (*IcmpCodeField) MarshalBinary

func (f *IcmpCodeField) MarshalBinary() (data []byte, err error)

func (*IcmpCodeField) UnmarshalBinary

func (f *IcmpCodeField) UnmarshalBinary(data []byte) error

type IcmpTypeField

type IcmpTypeField struct {
	Type uint8
}

func (*IcmpTypeField) Len

func (f *IcmpTypeField) Len() uint16

func (*IcmpTypeField) MarshalBinary

func (f *IcmpTypeField) MarshalBinary() (data []byte, err error)

func (*IcmpTypeField) UnmarshalBinary

func (f *IcmpTypeField) UnmarshalBinary(data []byte) error

type InPortField

type InPortField struct {
	InPort uint32
}

IN_PORT field

func (*InPortField) Len

func (m *InPortField) Len() uint16

func (*InPortField) MarshalBinary

func (m *InPortField) MarshalBinary() (data []byte, err error)

func (*InPortField) UnmarshalBinary

func (m *InPortField) UnmarshalBinary(data []byte) error

type InstrActions

type InstrActions struct {
	InstrHeader

	Actions []Action /* 0 or more actions associated with OFPIT_WRITE_ACTIONS and OFPIT_APPLY_ACTIONS */
	// contains filtered or unexported fields
}

*_ACTION instructions

func NewInstrApplyActions

func NewInstrApplyActions() *InstrActions

func NewInstrWriteActions

func NewInstrWriteActions() *InstrActions

func (*InstrActions) AddAction

func (instr *InstrActions) AddAction(act Action, prepend bool) error

func (*InstrActions) Len

func (instr *InstrActions) Len() (n uint16)

func (*InstrActions) MarshalBinary

func (instr *InstrActions) MarshalBinary() (data []byte, err error)

func (*InstrActions) UnmarshalBinary

func (instr *InstrActions) UnmarshalBinary(data []byte) error

type InstrGotoTable

type InstrGotoTable struct {
	InstrHeader
	TableId uint8
	// contains filtered or unexported fields
}

func NewInstrGotoTable

func NewInstrGotoTable(tableId uint8) *InstrGotoTable

func (*InstrGotoTable) AddAction

func (instr *InstrGotoTable) AddAction(act Action, prepend bool) error

func (*InstrGotoTable) Len

func (instr *InstrGotoTable) Len() (n uint16)

func (*InstrGotoTable) MarshalBinary

func (instr *InstrGotoTable) MarshalBinary() (data []byte, err error)

func (*InstrGotoTable) UnmarshalBinary

func (instr *InstrGotoTable) UnmarshalBinary(data []byte) error

type InstrHeader

type InstrHeader struct {
	Type   uint16
	Length uint16
}

Generic instruction header

func (*InstrHeader) Len

func (a *InstrHeader) Len() (n uint16)

func (*InstrHeader) MarshalBinary

func (a *InstrHeader) MarshalBinary() (data []byte, err error)

func (*InstrHeader) UnmarshalBinary

func (a *InstrHeader) UnmarshalBinary(data []byte) error

type InstrMeter

type InstrMeter struct {
	InstrHeader
	MeterId uint32
}

func NewInstrMeter

func NewInstrMeter(meterId uint32) *InstrMeter

func (*InstrMeter) AddAction

func (instr *InstrMeter) AddAction(act Action, prepend bool) error

func (*InstrMeter) Len

func (instr *InstrMeter) Len() (n uint16)

func (*InstrMeter) MarshalBinary

func (instr *InstrMeter) MarshalBinary() (data []byte, err error)

func (*InstrMeter) UnmarshalBinary

func (instr *InstrMeter) UnmarshalBinary(data []byte) error

type InstrWriteMetadata

type InstrWriteMetadata struct {
	InstrHeader

	Metadata     uint64 /* Metadata value to write */
	MetadataMask uint64 /* Metadata write bitmask */
	// contains filtered or unexported fields
}

func NewInstrWriteMetadata

func NewInstrWriteMetadata(metadata, metadataMask uint64) *InstrWriteMetadata

func (*InstrWriteMetadata) AddAction

func (instr *InstrWriteMetadata) AddAction(act Action, prepend bool) error

func (*InstrWriteMetadata) Len

func (instr *InstrWriteMetadata) Len() (n uint16)

FIXME: we need marshall/unmarshall/len/new functions for write metadata instr

func (*InstrWriteMetadata) MarshalBinary

func (instr *InstrWriteMetadata) MarshalBinary() (data []byte, err error)

func (*InstrWriteMetadata) UnmarshalBinary

func (instr *InstrWriteMetadata) UnmarshalBinary(data []byte) error

type Instruction

type Instruction interface {
	util.Message
	AddAction(act Action, prepend bool) error
}

func DecodeInstr

func DecodeInstr(data []byte) Instruction

type IpDscpField

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

IP_DSCP field

func (*IpDscpField) Len

func (m *IpDscpField) Len() uint16

func (*IpDscpField) MarshalBinary

func (m *IpDscpField) MarshalBinary() (data []byte, err error)

func (*IpDscpField) UnmarshalBinary

func (m *IpDscpField) UnmarshalBinary(data []byte) error

type IpProtoField

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

IP_PROTO field

func (*IpProtoField) Len

func (m *IpProtoField) Len() uint16

func (*IpProtoField) MarshalBinary

func (m *IpProtoField) MarshalBinary() (data []byte, err error)

func (*IpProtoField) UnmarshalBinary

func (m *IpProtoField) UnmarshalBinary(data []byte) error

type Ipv4DstField

type Ipv4DstField struct {
	Ipv4Dst net.IP
}

IPV4_DST field

func (*Ipv4DstField) Len

func (m *Ipv4DstField) Len() uint16

func (*Ipv4DstField) MarshalBinary

func (m *Ipv4DstField) MarshalBinary() (data []byte, err error)

func (*Ipv4DstField) UnmarshalBinary

func (m *Ipv4DstField) UnmarshalBinary(data []byte) error

type Ipv4SrcField

type Ipv4SrcField struct {
	Ipv4Src net.IP
}

IPV4_SRC field

func (*Ipv4SrcField) Len

func (m *Ipv4SrcField) Len() uint16

func (*Ipv4SrcField) MarshalBinary

func (m *Ipv4SrcField) MarshalBinary() (data []byte, err error)

func (*Ipv4SrcField) UnmarshalBinary

func (m *Ipv4SrcField) UnmarshalBinary(data []byte) error

type Ipv6DstField

type Ipv6DstField struct {
	Ipv6Dst net.IP
}

IPV6_DST field

func (*Ipv6DstField) Len

func (m *Ipv6DstField) Len() uint16

func (*Ipv6DstField) MarshalBinary

func (m *Ipv6DstField) MarshalBinary() (data []byte, err error)

func (*Ipv6DstField) UnmarshalBinary

func (m *Ipv6DstField) UnmarshalBinary(data []byte) error

type Ipv6SrcField

type Ipv6SrcField struct {
	Ipv6Src net.IP
}

IPV6_SRC field

func (*Ipv6SrcField) Len

func (m *Ipv6SrcField) Len() uint16

func (*Ipv6SrcField) MarshalBinary

func (m *Ipv6SrcField) MarshalBinary() (data []byte, err error)

func (*Ipv6SrcField) UnmarshalBinary

func (m *Ipv6SrcField) UnmarshalBinary(data []byte) error

type Match

type Match struct {
	Type   uint16
	Length uint16
	Fields []MatchField
}

ofp_match 1.3

func NewMatch

func NewMatch() *Match

func (*Match) AddField

func (m *Match) AddField(f MatchField)

func (*Match) Len

func (m *Match) Len() (n uint16)

func (*Match) MarshalBinary

func (m *Match) MarshalBinary() (data []byte, err error)

func (*Match) UnmarshalBinary

func (m *Match) UnmarshalBinary(data []byte) error

type MatchField

type MatchField struct {
	Class          uint16
	Field          uint8
	HasMask        bool
	Length         uint8
	ExperimenterID uint32
	Value          util.Message
	Mask           util.Message
}

One match field TLV

func FindFieldHeaderByName

func FindFieldHeaderByName(fieldName string, hasMask bool) (*MatchField, error)

FindFieldHeaderByName finds OXM/NXM field by name and mask.

func NewActsetOutputField

func NewActsetOutputField(actsetOutputPort uint32) *MatchField

Return a MatchField for actset_output port matching

func NewArpOperField

func NewArpOperField(arpOper uint16) *MatchField

Return a MatchField for arp operation type matching

func NewArpShaField

func NewArpShaField(arpSha net.HardwareAddr) *MatchField

func NewArpSpaField

func NewArpSpaField(arpSpa net.IP) *MatchField

func NewArpThaField

func NewArpThaField(arpTha net.HardwareAddr) *MatchField

func NewArpTpaField

func NewArpTpaField(arpTpa net.IP) *MatchField

func NewCTLabelMatchField

func NewCTLabelMatchField(label [16]byte, mask *[16]byte) *MatchField

func NewCTMarkMatchField

func NewCTMarkMatchField(mark uint32, mask *uint32) *MatchField

func NewCTStateMatchField

func NewCTStateMatchField(states *CTStates) *MatchField

func NewCTZoneMatchField

func NewCTZoneMatchField(zone uint16) *MatchField

func NewConjIDMatchField

func NewConjIDMatchField(conjID uint32) *MatchField

func NewEthDstField

func NewEthDstField(ethDst net.HardwareAddr, ethDstMask *net.HardwareAddr) *MatchField

Return a MatchField for ethernet dest addr

func NewEthSrcField

func NewEthSrcField(ethSrc net.HardwareAddr, ethSrcMask *net.HardwareAddr) *MatchField

Return a MatchField for ethernet src addr

func NewEthTypeField

func NewEthTypeField(ethType uint16) *MatchField

Return a MatchField for ethertype matching

func NewInPortField

func NewInPortField(inPort uint32) *MatchField

Return a MatchField for Input port matching

func NewIpDscpField

func NewIpDscpField(dscp uint8) *MatchField

Return a MatchField for ipv4/ipv6 dscp

func NewIpProtoField

func NewIpProtoField(protocol uint8) *MatchField

Return a MatchField for ipv4 protocol

func NewIpv4DstField

func NewIpv4DstField(ipDst net.IP, ipDstMask *net.IP) *MatchField

Return a MatchField for ipv4 dest addr

func NewIpv4SrcField

func NewIpv4SrcField(ipSrc net.IP, ipSrcMask *net.IP) *MatchField

Return a MatchField for ipv4 src addr

func NewIpv6DstField

func NewIpv6DstField(ipDst net.IP, ipDstMask *net.IP) *MatchField

Return a MatchField for ipv6 dest addr

func NewIpv6SrcField

func NewIpv6SrcField(ipSrc net.IP, ipSrcMask *net.IP) *MatchField

Return a MatchField for ipv6 src addr

func NewMetadataField

func NewMetadataField(metadata uint64, metadataMask *uint64) *MatchField

Return a MatchField for tunnel id matching

func NewMplsBosField

func NewMplsBosField(mplsBos uint8) *MatchField

Return a MatchField for mpls Bos matching

func NewMplsLabelField

func NewMplsLabelField(mplsLabel uint32) *MatchField

Return a MatchField for mpls Label matching

func NewNxARPShaMatchField

func NewNxARPShaMatchField(addr net.HardwareAddr, mask net.HardwareAddr) *MatchField

func NewNxARPSpaMatchField

func NewNxARPSpaMatchField(addr net.IP, mask net.IP) *MatchField

func NewNxARPThaMatchField

func NewNxARPThaMatchField(addr net.HardwareAddr, mask net.HardwareAddr) *MatchField

func NewNxARPTpaMatchField

func NewNxARPTpaMatchField(addr net.IP, mask net.IP) *MatchField

func NewRegMatchField

func NewRegMatchField(idx int, data uint32, dataRng *NXRange) *MatchField

func NewSctpDstField

func NewSctpDstField(port uint16) *MatchField

SCTP_DST field

func NewSctpSrcField

func NewSctpSrcField(port uint16) *MatchField

SCTP_DST field

func NewTcpDstField

func NewTcpDstField(port uint16) *MatchField

TCP_DST field

func NewTcpFlagsField

func NewTcpFlagsField(tcpFlag uint16, tcpFlagMask *uint16) *MatchField

Return a tcp flags field

func NewTcpSrcField

func NewTcpSrcField(port uint16) *MatchField

TCP_SRC field

func NewTunMetadataField

func NewTunMetadataField(idx int, data []byte, mask []byte) *MatchField

func NewTunnelIdField

func NewTunnelIdField(tunnelId uint64) *MatchField

Return a MatchField for tunel id matching

func NewTunnelIpv4DstField

func NewTunnelIpv4DstField(tunnelIpDst net.IP, tunnelIpDstMask *net.IP) *MatchField

Return a MatchField for tunnel ipv4 dst addr

func NewTunnelIpv4SrcField

func NewTunnelIpv4SrcField(tunnelIpSrc net.IP, tunnelIpSrcMask *net.IP) *MatchField

Return a MatchField for tunnel ipv4 src addr

func NewTunnelIpv6DstField

func NewTunnelIpv6DstField(tunnelIpv6Dst net.IP, tunnelIpv6DstMask *net.IP) *MatchField

Return a MatchField for tunnel ipv6 dst addr

func NewTunnelIpv6SrcField

func NewTunnelIpv6SrcField(tunnelIpv6Src net.IP, tunnelIpv6SrcMask *net.IP) *MatchField

Return a MatchField for tunnel ipv6 src addr

func NewUdpDstField

func NewUdpDstField(port uint16) *MatchField

UDP_DST field

func NewUdpSrcField

func NewUdpSrcField(port uint16) *MatchField

UDP_SRC field

func NewVlanIdField

func NewVlanIdField(vlanId uint16, vlanMask *uint16) *MatchField

Return a MatchField for vlan id matching

func (*MatchField) Len

func (m *MatchField) Len() (n uint16)

func (*MatchField) MarshalBinary

func (m *MatchField) MarshalBinary() (data []byte, err error)

func (*MatchField) MarshalHeader

func (m *MatchField) MarshalHeader() uint32

func (*MatchField) UnmarshalBinary

func (m *MatchField) UnmarshalBinary(data []byte) error

func (*MatchField) UnmarshalHeader

func (m *MatchField) UnmarshalHeader(data []byte) error

type MetadataField

type MetadataField struct {
	Metadata uint64
}

METADATA field

func (*MetadataField) Len

func (m *MetadataField) Len() uint16

func (*MetadataField) MarshalBinary

func (m *MetadataField) MarshalBinary() (data []byte, err error)

func (*MetadataField) UnmarshalBinary

func (m *MetadataField) UnmarshalBinary(data []byte) error

type MeterBandDSCP

type MeterBandDSCP struct {
	MeterBandHeader       /* Type: OFPMBT13_DSCP_REMARK. */
	PrecLevel       uint8 /* Number of drop precedence level to add. */
	// contains filtered or unexported fields
}

func (*MeterBandDSCP) Len

func (m *MeterBandDSCP) Len() (n uint16)

func (*MeterBandDSCP) MarshalBinary

func (m *MeterBandDSCP) MarshalBinary() (data []byte, err error)

func (*MeterBandDSCP) UnmarshalBinary

func (m *MeterBandDSCP) UnmarshalBinary(data []byte) error

type MeterBandDrop

type MeterBandDrop struct {
	MeterBandHeader /* Type: OFPMBT13_DROP. */
	// contains filtered or unexported fields
}

func (*MeterBandDrop) Len

func (m *MeterBandDrop) Len() (n uint16)

func (*MeterBandDrop) MarshalBinary

func (m *MeterBandDrop) MarshalBinary() (data []byte, err error)

func (*MeterBandDrop) UnmarshalBinary

func (m *MeterBandDrop) UnmarshalBinary(data []byte) error

type MeterBandExperimenter

type MeterBandExperimenter struct {
	MeterBandHeader        /* Type: OFPMBT13_EXPERIMENTER. */
	Experimenter    uint32 /* Experimenter ID which takes the same form as in struct ofp_experimenter_header. */
}

func (*MeterBandExperimenter) Len

func (m *MeterBandExperimenter) Len() (n uint16)

func (*MeterBandExperimenter) MarshalBinary

func (m *MeterBandExperimenter) MarshalBinary() (data []byte, err error)

func (*MeterBandExperimenter) UnmarshalBinary

func (m *MeterBandExperimenter) UnmarshalBinary(data []byte) error

type MeterBandHeader

type MeterBandHeader struct {
	Type      uint16 /* One of OFPMBT13_*. */
	Length    uint16 /* Length in bytes of this band. */
	Rate      uint32 /* Rate for this band. */
	BurstSize uint32 /* Size of bursts. */
}

func NewMeterBandHeader

func NewMeterBandHeader() *MeterBandHeader

func (*MeterBandHeader) Len

func (m *MeterBandHeader) Len() (n uint16)

func (*MeterBandHeader) MarshalBinary

func (m *MeterBandHeader) MarshalBinary() (data []byte, err error)

func (*MeterBandHeader) UnmarshalBinary

func (m *MeterBandHeader) UnmarshalBinary(data []byte) error

type MeterMod

type MeterMod struct {
	common.Header
	Command    uint16         /* One of OFPMC_*. */
	Flags      uint16         /* Set of OFPMF_*. */
	MeterId    uint32         /* Meter instance. */
	MeterBands []util.Message /* List of MeterBand*. */
}

MeterMod message

func NewMeterMod

func NewMeterMod() *MeterMod

Create a new meter mod message

func (*MeterMod) AddMeterBand

func (m *MeterMod) AddMeterBand(mb util.Message)

Add a meterBand to meter mod

func (*MeterMod) Len

func (m *MeterMod) Len() (n uint16)

func (*MeterMod) MarshalBinary

func (m *MeterMod) MarshalBinary() (data []byte, err error)

func (*MeterMod) UnmarshalBinary

func (m *MeterMod) UnmarshalBinary(data []byte) error

type MplsBosField

type MplsBosField struct {
	MplsBos uint8
}

MplsBos field

func (*MplsBosField) Len

func (m *MplsBosField) Len() uint16

func (*MplsBosField) MarshalBinary

func (m *MplsBosField) MarshalBinary() (data []byte, err error)

func (*MplsBosField) UnmarshalBinary

func (m *MplsBosField) UnmarshalBinary(data []byte) error

type MplsLabelField

type MplsLabelField struct {
	MplsLabel uint32
}

MplsLabel field

func (*MplsLabelField) Len

func (m *MplsLabelField) Len() uint16

func (*MplsLabelField) MarshalBinary

func (m *MplsLabelField) MarshalBinary() (data []byte, err error)

func (*MplsLabelField) UnmarshalBinary

func (m *MplsLabelField) UnmarshalBinary(data []byte) error

type MultipartReply

type MultipartReply struct {
	common.Header
	Type  uint16
	Flags uint16

	Body []util.Message
	// contains filtered or unexported fields
}

ofp_multipart_reply 1.3

func (*MultipartReply) Len

func (s *MultipartReply) Len() (n uint16)

func (*MultipartReply) MarshalBinary

func (s *MultipartReply) MarshalBinary() (data []byte, err error)

func (*MultipartReply) UnmarshalBinary

func (s *MultipartReply) UnmarshalBinary(data []byte) error

type MultipartRequest

type MultipartRequest struct {
	common.Header
	Type  uint16
	Flags uint16

	Body util.Message
	// contains filtered or unexported fields
}

ofp_multipart_request 1.3

func (*MultipartRequest) Len

func (s *MultipartRequest) Len() (n uint16)

func (*MultipartRequest) MarshalBinary

func (s *MultipartRequest) MarshalBinary() (data []byte, err error)

func (*MultipartRequest) UnmarshalBinary

func (s *MultipartRequest) UnmarshalBinary(data []byte) error

type NXActionCTNAT

type NXActionCTNAT struct {
	*NXActionHeader

	Flags uint16 // nat Flags to identify snat/dnat, and nat algorithms: random/protocolHash, connection persistent
	// contains filtered or unexported fields
}

NXActionCTNAT is NX action to set NAT in conntrack.

func NewNXActionCTNAT

func NewNXActionCTNAT() *NXActionCTNAT

func (*NXActionCTNAT) Len

func (a *NXActionCTNAT) Len() (n uint16)

func (*NXActionCTNAT) MarshalBinary

func (a *NXActionCTNAT) MarshalBinary() (data []byte, err error)

func (*NXActionCTNAT) SetDNAT

func (a *NXActionCTNAT) SetDNAT() error

func (*NXActionCTNAT) SetPersistent

func (a *NXActionCTNAT) SetPersistent() error

func (*NXActionCTNAT) SetProtoHash

func (a *NXActionCTNAT) SetProtoHash() error

func (*NXActionCTNAT) SetRandom

func (a *NXActionCTNAT) SetRandom() error

func (*NXActionCTNAT) SetRangeIPv4Max

func (a *NXActionCTNAT) SetRangeIPv4Max(ipMax net.IP)

func (*NXActionCTNAT) SetRangeIPv4Min

func (a *NXActionCTNAT) SetRangeIPv4Min(ipMin net.IP)

func (*NXActionCTNAT) SetRangeIPv6Max

func (a *NXActionCTNAT) SetRangeIPv6Max(ipMax net.IP)

func (*NXActionCTNAT) SetRangeIPv6Min

func (a *NXActionCTNAT) SetRangeIPv6Min(ipMin net.IP)

func (*NXActionCTNAT) SetRangeProtoMax

func (a *NXActionCTNAT) SetRangeProtoMax(protoMax *uint16)

func (*NXActionCTNAT) SetRangeProtoMin

func (a *NXActionCTNAT) SetRangeProtoMin(protoMin *uint16)

func (*NXActionCTNAT) SetSNAT

func (a *NXActionCTNAT) SetSNAT() error

func (*NXActionCTNAT) UnmarshalBinary

func (a *NXActionCTNAT) UnmarshalBinary(data []byte) error

type NXActionConjunction

type NXActionConjunction struct {
	*NXActionHeader
	Clause  uint8
	NClause uint8
	ID      uint32
}

NXActionConjunction is NX action to configure conjunctive match flows.

func NewNXActionConjunction

func NewNXActionConjunction(clause uint8, nclause uint8, id uint32) *NXActionConjunction

NewNXActionConjunction creates NXActionConjunction, the action in flow entry is like conjunction(ID, Clause/nclause).

func (*NXActionConjunction) Len

func (a *NXActionConjunction) Len() (n uint16)

func (*NXActionConjunction) MarshalBinary

func (a *NXActionConjunction) MarshalBinary() (data []byte, err error)

func (*NXActionConjunction) UnmarshalBinary

func (a *NXActionConjunction) UnmarshalBinary(data []byte) error

type NXActionConnTrack

type NXActionConnTrack struct {
	*NXActionHeader
	Flags        uint16
	ZoneSrc      uint32
	ZoneOfsNbits uint16
	RecircTable  uint8

	Alg uint16
	// contains filtered or unexported fields
}

NXActionConnTrack is NX action for conntrack.

func NewNXActionConnTrack

func NewNXActionConnTrack() *NXActionConnTrack

func (*NXActionConnTrack) AddAction

func (a *NXActionConnTrack) AddAction(actions ...Action) *NXActionConnTrack

func (*NXActionConnTrack) Commit

func (a *NXActionConnTrack) Commit() *NXActionConnTrack

func (*NXActionConnTrack) Force

func (*NXActionConnTrack) Len

func (a *NXActionConnTrack) Len() (n uint16)

func (*NXActionConnTrack) MarshalBinary

func (a *NXActionConnTrack) MarshalBinary() (data []byte, err error)

func (*NXActionConnTrack) Table

func (a *NXActionConnTrack) Table(tableID uint8) *NXActionConnTrack

func (*NXActionConnTrack) UnmarshalBinary

func (a *NXActionConnTrack) UnmarshalBinary(data []byte) error

func (*NXActionConnTrack) ZoneImm

func (a *NXActionConnTrack) ZoneImm(zoneID uint16) *NXActionConnTrack

func (*NXActionConnTrack) ZoneRange

func (a *NXActionConnTrack) ZoneRange(field *MatchField, rng *NXRange) *NXActionConnTrack

type NXActionController

type NXActionController struct {
	*NXActionHeader
	MaxLen       uint16
	ControllerID uint16
	Reason       uint8
	// contains filtered or unexported fields
}

NXActionController is NX action to output packet to the Controller set with a specified ID.

func NewNXActionController

func NewNXActionController(controllerID uint16) *NXActionController

func (*NXActionController) Len

func (a *NXActionController) Len() uint16

func (*NXActionController) MarshalBinary

func (a *NXActionController) MarshalBinary() (data []byte, err error)

func (*NXActionController) UnmarshalBinary

func (a *NXActionController) UnmarshalBinary(data []byte) error

type NXActionDecTTL

type NXActionDecTTL struct {
	*NXActionHeader
	// contains filtered or unexported fields
}

func NewNXActionDecTTL

func NewNXActionDecTTL() *NXActionDecTTL

func (*NXActionDecTTL) Len

func (a *NXActionDecTTL) Len() (n uint16)

func (*NXActionDecTTL) MarshalBinary

func (a *NXActionDecTTL) MarshalBinary() (data []byte, err error)

func (*NXActionDecTTL) UnmarshalBinary

func (a *NXActionDecTTL) UnmarshalBinary(data []byte) error

type NXActionDecTTLCntIDs

type NXActionDecTTLCntIDs struct {
	*NXActionHeader
	// contains filtered or unexported fields
}

func NewNXActionDecTTLCntIDs

func NewNXActionDecTTLCntIDs(controllers uint16, ids ...uint16) *NXActionDecTTLCntIDs

func (*NXActionDecTTLCntIDs) Len

func (a *NXActionDecTTLCntIDs) Len() (n uint16)

func (*NXActionDecTTLCntIDs) MarshalBinary

func (a *NXActionDecTTLCntIDs) MarshalBinary() (data []byte, err error)

func (*NXActionDecTTLCntIDs) UnmarshalBinary

func (a *NXActionDecTTLCntIDs) UnmarshalBinary(data []byte) error

type NXActionHeader

type NXActionHeader struct {
	*ActionHeader
	Vendor  uint32
	Subtype uint16
}

func NewNxActionHeader

func NewNxActionHeader(subtype uint16) *NXActionHeader

func (*NXActionHeader) Header

func (a *NXActionHeader) Header() *ActionHeader

func (*NXActionHeader) Len

func (a *NXActionHeader) Len() (n uint16)

func (*NXActionHeader) MarshalBinary

func (a *NXActionHeader) MarshalBinary() (data []byte, err error)

func (*NXActionHeader) NXHeader

func (a *NXActionHeader) NXHeader() *NXActionHeader

func (*NXActionHeader) UnmarshalBinary

func (a *NXActionHeader) UnmarshalBinary(data []byte) error

type NXActionLearn

type NXActionLearn struct {
	*NXActionHeader
	IdleTimeout uint16
	HardTimeout uint16
	Priority    uint16
	Cookie      uint64
	Flags       uint16
	TableID     uint8

	FinIdleTimeout uint16
	FinHardTimeout uint16
	LearnSpecs     []*NXLearnSpec
	// contains filtered or unexported fields
}

func NewNXActionLearn

func NewNXActionLearn() *NXActionLearn

func (*NXActionLearn) Len

func (a *NXActionLearn) Len() uint16

func (*NXActionLearn) MarshalBinary

func (a *NXActionLearn) MarshalBinary() (data []byte, err error)

func (*NXActionLearn) UnmarshalBinary

func (a *NXActionLearn) UnmarshalBinary(data []byte) error

type NXActionNote

type NXActionNote struct {
	*NXActionHeader
	Note []byte
}

func NewNXActionNote

func NewNXActionNote() *NXActionNote

func (*NXActionNote) Len

func (a *NXActionNote) Len() uint16

func (*NXActionNote) MarshalBinary

func (a *NXActionNote) MarshalBinary() (data []byte, err error)

func (*NXActionNote) UnmarshalBinary

func (a *NXActionNote) UnmarshalBinary(data []byte) error

type NXActionOutputReg

type NXActionOutputReg struct {
	*NXActionHeader
	OfsNbits uint16      // (ofs << 6 | (Nbits -1)
	SrcField *MatchField // source nxm_nx_reg
	MaxLen   uint16      // Max length to send to controller if chosen port is OFPP_CONTROLLER
	// contains filtered or unexported fields
}

NXActionOutputReg is NX action to output to a field with a specified range.

func NewOutputFromField

func NewOutputFromField(srcField *MatchField, ofsNbits uint16) *NXActionOutputReg

func NewOutputFromFieldWithMaxLen

func NewOutputFromFieldWithMaxLen(srcField *MatchField, ofsNbits uint16, maxLen uint16) *NXActionOutputReg

func (*NXActionOutputReg) Len

func (a *NXActionOutputReg) Len() (n uint16)

func (*NXActionOutputReg) MarshalBinary

func (a *NXActionOutputReg) MarshalBinary() (data []byte, err error)

func (*NXActionOutputReg) UnmarshalBinary

func (a *NXActionOutputReg) UnmarshalBinary(data []byte) error

type NXActionRegLoad

type NXActionRegLoad struct {
	*NXActionHeader
	OfsNbits uint16
	DstReg   *MatchField
	Value    uint64
}

NXActionRegLoad is NX action to load data to a specified field.

func NewNXActionRegLoad

func NewNXActionRegLoad(ofsNbits uint16, dstField *MatchField, value uint64) *NXActionRegLoad

func (*NXActionRegLoad) Len

func (a *NXActionRegLoad) Len() (n uint16)

func (*NXActionRegLoad) MarshalBinary

func (a *NXActionRegLoad) MarshalBinary() (data []byte, err error)

func (*NXActionRegLoad) UnmarshalBinary

func (a *NXActionRegLoad) UnmarshalBinary(data []byte) error

type NXActionRegLoad2

type NXActionRegLoad2 struct {
	*NXActionHeader
	DstField *MatchField
	// contains filtered or unexported fields
}

NXActionRegLoad2 is NX action to load data to a specified field.

func NewNXActionRegLoad2

func NewNXActionRegLoad2(dstField *MatchField) *NXActionRegLoad2

func (*NXActionRegLoad2) Len

func (a *NXActionRegLoad2) Len() (n uint16)

func (*NXActionRegLoad2) MarshalBinary

func (a *NXActionRegLoad2) MarshalBinary() (data []byte, err error)

func (*NXActionRegLoad2) UnmarshalBinary

func (a *NXActionRegLoad2) UnmarshalBinary(data []byte) error

type NXActionRegMove

type NXActionRegMove struct {
	*NXActionHeader
	Nbits    uint16
	SrcOfs   uint16
	DstOfs   uint16
	SrcField *MatchField
	DstField *MatchField
}

NXActionRegMove is NX action to move data from srcField to dstField.

func NewNXActionRegMove

func NewNXActionRegMove(nBits uint16, srcOfs uint16, dstOfs uint16, srcField *MatchField, dstField *MatchField) *NXActionRegMove

func (*NXActionRegMove) Len

func (a *NXActionRegMove) Len() (n uint16)

func (*NXActionRegMove) MarshalBinary

func (a *NXActionRegMove) MarshalBinary() (data []byte, err error)

func (*NXActionRegMove) UnmarshalBinary

func (a *NXActionRegMove) UnmarshalBinary(data []byte) error

type NXActionResubmit

type NXActionResubmit struct {
	*NXActionHeader
	InPort  uint16
	TableID uint8
	// contains filtered or unexported fields
}

NXActionResubmit is NX action to resubmit packet to a specified in_port.

func NewNXActionResubmit

func NewNXActionResubmit(inPort uint16) *NXActionResubmit

func (*NXActionResubmit) Len

func (a *NXActionResubmit) Len() (n uint16)

func (*NXActionResubmit) MarshalBinary

func (a *NXActionResubmit) MarshalBinary() (data []byte, err error)

func (*NXActionResubmit) UnmarshalBinary

func (a *NXActionResubmit) UnmarshalBinary(data []byte) error

type NXActionResubmitTable

type NXActionResubmitTable struct {
	*NXActionHeader
	InPort  uint16
	TableID uint8
	// contains filtered or unexported fields
}

NXActionResubmitTable is NX action to resubmit packet to a specified table and in_port.

func NewNXActionResubmitTableAction

func NewNXActionResubmitTableAction(inPort uint16, tableID uint8) *NXActionResubmitTable

func NewNXActionResubmitTableCT

func NewNXActionResubmitTableCT(inPort uint16, tableID uint8) *NXActionResubmitTable

func NewNXActionResubmitTableCTNoInPort

func NewNXActionResubmitTableCTNoInPort(tableID uint8) *NXActionResubmitTable

func (*NXActionResubmitTable) IsCT

func (a *NXActionResubmitTable) IsCT() bool

func (*NXActionResubmitTable) Len

func (a *NXActionResubmitTable) Len() (n uint16)

func (*NXActionResubmitTable) MarshalBinary

func (a *NXActionResubmitTable) MarshalBinary() (data []byte, err error)

func (*NXActionResubmitTable) UnmarshalBinary

func (a *NXActionResubmitTable) UnmarshalBinary(data []byte) error

type NXLearnSpec

type NXLearnSpec struct {
	Header   *NXLearnSpecHeader
	SrcField *NXLearnSpecField
	DstField *NXLearnSpecField
	SrcValue []byte
}

func (*NXLearnSpec) Len

func (s *NXLearnSpec) Len() uint16

func (*NXLearnSpec) MarshalBinary

func (s *NXLearnSpec) MarshalBinary() (data []byte, err error)

func (*NXLearnSpec) UnmarshalBinary

func (s *NXLearnSpec) UnmarshalBinary(data []byte) error

type NXLearnSpecField

type NXLearnSpecField struct {
	Field *MatchField
	Ofs   uint16
}

func (*NXLearnSpecField) Len

func (f *NXLearnSpecField) Len() uint16

func (*NXLearnSpecField) MarshalBinary

func (f *NXLearnSpecField) MarshalBinary() (data []byte, err error)

func (*NXLearnSpecField) UnmarshalBinary

func (f *NXLearnSpecField) UnmarshalBinary(data []byte) error

type NXLearnSpecHeader

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

func NewLearnHeaderLoadFromField

func NewLearnHeaderLoadFromField(nBits uint16) *NXLearnSpecHeader

func NewLearnHeaderLoadFromValue

func NewLearnHeaderLoadFromValue(nBits uint16) *NXLearnSpecHeader

func NewLearnHeaderMatchFromField

func NewLearnHeaderMatchFromField(nBits uint16) *NXLearnSpecHeader

func NewLearnHeaderMatchFromValue

func NewLearnHeaderMatchFromValue(nBits uint16) *NXLearnSpecHeader

func NewLearnHeaderOutputFromField

func NewLearnHeaderOutputFromField(nBits uint16) *NXLearnSpecHeader

func (*NXLearnSpecHeader) Len

func (h *NXLearnSpecHeader) Len() (n uint16)

func (*NXLearnSpecHeader) MarshalBinary

func (h *NXLearnSpecHeader) MarshalBinary() (data []byte, err error)

func (*NXLearnSpecHeader) UnmarshalBinary

func (h *NXLearnSpecHeader) UnmarshalBinary(data []byte) error

type NXRange

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

func NewNXRange

func NewNXRange(start int, end int) *NXRange

NewNXRange creates a NXRange using start and end number.

func NewNXRangeByOfsNBits

func NewNXRangeByOfsNBits(ofs int, nBits int) *NXRange

NewNXRangeByOfsNBits creates a NXRange using offshift and bit count.

func (*NXRange) GetNbits

func (n *NXRange) GetNbits() uint16

GetNbits returns the bits count from NXRange.

func (*NXRange) GetOfs

func (n *NXRange) GetOfs() uint16

GetOfs returns the offshift number from NXRange.

func (*NXRange) ToOfsBits

func (n *NXRange) ToOfsBits() uint16

ToOfsBits encodes the NXRange to a uint16 number to identify offshift and bits count.

func (*NXRange) ToUint32Mask

func (n *NXRange) ToUint32Mask() uint32

ToUint32Mask generates a uint32 number mask from NXRange.

type PacketIn

type PacketIn struct {
	common.Header
	BufferId uint32
	TotalLen uint16
	Reason   uint8
	TableId  uint8
	Cookie   uint64
	Match    Match

	Data protocol.Ethernet
	// contains filtered or unexported fields
}

ofp_packet_in 1.3

func NewPacketIn

func NewPacketIn() *PacketIn

func (*PacketIn) Len

func (p *PacketIn) Len() (n uint16)

func (*PacketIn) MarshalBinary

func (p *PacketIn) MarshalBinary() (data []byte, err error)

func (*PacketIn) UnmarshalBinary

func (p *PacketIn) UnmarshalBinary(data []byte) error

type PacketOut

type PacketOut struct {
	common.Header
	BufferId   uint32
	InPort     uint32
	ActionsLen uint16

	Actions []Action
	Data    util.Message
	// contains filtered or unexported fields
}

When the controller wishes to send a packet out through the datapath, it uses the OFPT_PACKET_OUT message: The buffer_id is the same given in the ofp_packet_in message. If the buffer_id is -1, then the packet data is included in the data array. If OFPP_TABLE is specified as the output port of an action, the in_port in the packet_out message is used in the flow table lookup.

func NewPacketOut

func NewPacketOut() *PacketOut

func (*PacketOut) AddAction

func (p *PacketOut) AddAction(act Action)

func (*PacketOut) Len

func (p *PacketOut) Len() (n uint16)

func (*PacketOut) MarshalBinary

func (p *PacketOut) MarshalBinary() (data []byte, err error)

func (*PacketOut) UnmarshalBinary

func (p *PacketOut) UnmarshalBinary(data []byte) error

type PhyPort

type PhyPort struct {
	PortNo uint32

	HWAddr net.HardwareAddr

	Name []byte // Size 16

	Config uint32
	State  uint32

	Curr       uint32
	Advertised uint32
	Supported  uint32
	Peer       uint32

	CurrSpeed uint32
	MaxSpeed  uint32
	// contains filtered or unexported fields
}

ofp_port 1.3

func NewPhyPort

func NewPhyPort() *PhyPort

func (*PhyPort) Len

func (p *PhyPort) Len() (n uint16)

func (*PhyPort) MarshalBinary

func (p *PhyPort) MarshalBinary() (data []byte, err error)

func (*PhyPort) UnmarshalBinary

func (p *PhyPort) UnmarshalBinary(data []byte) error

type PortField

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

Common struct for all port fields

func NewPortField

func NewPortField(port uint16) *PortField

func (*PortField) Len

func (m *PortField) Len() uint16

func (*PortField) MarshalBinary

func (m *PortField) MarshalBinary() (data []byte, err error)

func (*PortField) UnmarshalBinary

func (m *PortField) UnmarshalBinary(data []byte) error

type PortMod

type PortMod struct {
	common.Header
	PortNo uint32

	HWAddr []uint8

	Config    uint32
	Mask      uint32
	Advertise uint32
	// contains filtered or unexported fields
}

ofp_port_mod 1.3

func NewPortMod

func NewPortMod(port int) *PortMod

func (*PortMod) Len

func (p *PortMod) Len() (n uint16)

func (*PortMod) MarshalBinary

func (p *PortMod) MarshalBinary() (data []byte, err error)

func (*PortMod) UnmarshalBinary

func (p *PortMod) UnmarshalBinary(data []byte) error

type PortStats

type PortStats struct {
	PortNo uint16

	RxPackets  uint64
	TxPackets  uint64
	RxBytes    uint64
	TxBytes    uint64
	RxDropped  uint64
	TxDropped  uint64
	RxErrors   uint64
	TxErrors   uint64
	RxFrameErr uint64
	RxOverErr  uint64
	RxCRCErr   uint64
	Collisions uint64
	// contains filtered or unexported fields
}

ofp_port_stats 1.0

func NewPortStats

func NewPortStats() *PortStats

func (*PortStats) Len

func (s *PortStats) Len() (n uint16)

func (*PortStats) MarshalBinary

func (s *PortStats) MarshalBinary() (data []byte, err error)

func (*PortStats) UnmarshalBinary

func (s *PortStats) UnmarshalBinary(data []byte) error

type PortStatsRequest

type PortStatsRequest struct {
	PortNo uint16
	// contains filtered or unexported fields
}

ofp_port_stats_request 1.0

func NewPortStatsRequest

func NewPortStatsRequest() *PortStatsRequest

func (*PortStatsRequest) Len

func (s *PortStatsRequest) Len() (n uint16)

func (*PortStatsRequest) MarshalBinary

func (s *PortStatsRequest) MarshalBinary() (data []byte, err error)

func (*PortStatsRequest) UnmarshalBinary

func (s *PortStatsRequest) UnmarshalBinary(data []byte) error

type PortStatus

type PortStatus struct {
	common.Header
	Reason uint8

	Desc PhyPort
	// contains filtered or unexported fields
}

ofp_port_status

func NewPortStatus

func NewPortStatus() *PortStatus

func (*PortStatus) Len

func (p *PortStatus) Len() (n uint16)

func (*PortStatus) MarshalBinary

func (s *PortStatus) MarshalBinary() (data []byte, err error)

func (*PortStatus) UnmarshalBinary

func (s *PortStatus) UnmarshalBinary(data []byte) error

type QueueStats

type QueueStats struct {
	PortNo uint16

	QueueId   uint32
	TxBytes   uint64
	TxPackets uint64
	TxErrors  uint64
	// contains filtered or unexported fields
}

ofp_queue_stats 1.0

func (*QueueStats) Len

func (s *QueueStats) Len() (n uint16)

func (*QueueStats) MarshalBinary

func (s *QueueStats) MarshalBinary() (data []byte, err error)

func (*QueueStats) UnmarshalBinary

func (s *QueueStats) UnmarshalBinary(data []byte) error

type QueueStatsRequest

type QueueStatsRequest struct {
	PortNo uint16

	QueueId uint32
	// contains filtered or unexported fields
}

ofp_queue_stats_request 1.0

func NewQueueStatsRequest

func NewQueueStatsRequest() *QueueStatsRequest

func (*QueueStatsRequest) Len

func (s *QueueStatsRequest) Len() (n uint16)

func (*QueueStatsRequest) MarshalBinary

func (s *QueueStatsRequest) MarshalBinary() (data []byte, err error)

func (*QueueStatsRequest) UnmarshalBinary

func (s *QueueStatsRequest) UnmarshalBinary(data []byte) error

type SwitchConfig

type SwitchConfig struct {
	common.Header
	Flags       uint16 // OFPC_* flags
	MissSendLen uint16
}

ofp_switch_config 1.3

func NewSetConfig

func NewSetConfig() *SwitchConfig

func (*SwitchConfig) Len

func (c *SwitchConfig) Len() (n uint16)

func (*SwitchConfig) MarshalBinary

func (c *SwitchConfig) MarshalBinary() (data []byte, err error)

func (*SwitchConfig) UnmarshalBinary

func (c *SwitchConfig) UnmarshalBinary(data []byte) error

type SwitchFeatures

type SwitchFeatures struct {
	common.Header
	DPID       net.HardwareAddr // Size 8
	Buffers    uint32
	NumTables  uint8
	AuxilaryId uint8

	Capabilities uint32
	Actions      uint32

	Ports []PhyPort
	// contains filtered or unexported fields
}

func NewFeaturesReply

func NewFeaturesReply() *SwitchFeatures

FeaturesReply constructor

func (*SwitchFeatures) Len

func (s *SwitchFeatures) Len() (n uint16)

func (*SwitchFeatures) MarshalBinary

func (s *SwitchFeatures) MarshalBinary() (data []byte, err error)

func (*SwitchFeatures) UnmarshalBinary

func (s *SwitchFeatures) UnmarshalBinary(data []byte) error

type TLVTableMap

type TLVTableMap struct {
	OptClass  uint16
	OptType   uint8
	OptLength uint8
	Index     uint16
	// contains filtered or unexported fields
}

func (*TLVTableMap) Len

func (t *TLVTableMap) Len() uint16

func (*TLVTableMap) MarshalBinary

func (t *TLVTableMap) MarshalBinary() (data []byte, err error)

func (*TLVTableMap) UnmarshalBinary

func (t *TLVTableMap) UnmarshalBinary(data []byte) error

type TLVTableMod

type TLVTableMod struct {
	Command uint16

	TlvMaps []*TLVTableMap
	// contains filtered or unexported fields
}

func NewTLVTableMod

func NewTLVTableMod(command uint16, tlvMaps []*TLVTableMap) *TLVTableMod

func (*TLVTableMod) Len

func (t *TLVTableMod) Len() uint16

func (*TLVTableMod) MarshalBinary

func (t *TLVTableMod) MarshalBinary() (data []byte, err error)

func (*TLVTableMod) UnmarshalBinary

func (t *TLVTableMod) UnmarshalBinary(data []byte) error

type TLVTableReply

type TLVTableReply struct {
	MaxSpace  uint32
	MaxFields uint16

	TlvMaps []*TLVTableMap
	// contains filtered or unexported fields
}

func (*TLVTableReply) Len

func (t *TLVTableReply) Len() uint16

func (*TLVTableReply) MarshalBinary

func (t *TLVTableReply) MarshalBinary() (data []byte, err error)

func (*TLVTableReply) UnmarshalBinary

func (t *TLVTableReply) UnmarshalBinary(data []byte) error

type TableStats

type TableStats struct {
	TableId uint8

	Name         []byte // Size MAX_TABLE_NAME_LEN
	Wildcards    uint32
	MaxEntries   uint32
	ActiveCount  uint32
	LookupCount  uint64
	MatchedCount uint64
	// contains filtered or unexported fields
}

FIXME: Everything below this needs to be changed for ofp1.3 ofp_table_stats 1.0

func NewTableStats

func NewTableStats() *TableStats

func (*TableStats) Len

func (s *TableStats) Len() (n uint16)

func (*TableStats) MarshalBinary

func (s *TableStats) MarshalBinary() (data []byte, err error)

func (*TableStats) UnmarshalBinary

func (s *TableStats) UnmarshalBinary(data []byte) error

type TcpFlagsField

type TcpFlagsField struct {
	TcpFlags uint16
}

Tcp flags field

func (*TcpFlagsField) Len

func (m *TcpFlagsField) Len() uint16

func (*TcpFlagsField) MarshalBinary

func (m *TcpFlagsField) MarshalBinary() (data []byte, err error)

func (*TcpFlagsField) UnmarshalBinary

func (m *TcpFlagsField) UnmarshalBinary(data []byte) error

type TunnelIdField

type TunnelIdField struct {
	TunnelId uint64
}

TUNNEL_ID field

func (*TunnelIdField) Len

func (m *TunnelIdField) Len() uint16

func (*TunnelIdField) MarshalBinary

func (m *TunnelIdField) MarshalBinary() (data []byte, err error)

func (*TunnelIdField) UnmarshalBinary

func (m *TunnelIdField) UnmarshalBinary(data []byte) error

type TunnelIpv4DstField

type TunnelIpv4DstField struct {
	TunnelIpv4Dst net.IP
}

Tunnel IPv4 Dst field

func (*TunnelIpv4DstField) Len

func (m *TunnelIpv4DstField) Len() uint16

func (*TunnelIpv4DstField) MarshalBinary

func (m *TunnelIpv4DstField) MarshalBinary() (data []byte, err error)

func (*TunnelIpv4DstField) UnmarshalBinary

func (m *TunnelIpv4DstField) UnmarshalBinary(data []byte) error

type TunnelIpv4SrcField

type TunnelIpv4SrcField struct {
	TunnelIpv4Src net.IP
}

Tunnel IPv4 Src field

func (*TunnelIpv4SrcField) Len

func (m *TunnelIpv4SrcField) Len() uint16

func (*TunnelIpv4SrcField) MarshalBinary

func (m *TunnelIpv4SrcField) MarshalBinary() (data []byte, err error)

func (*TunnelIpv4SrcField) UnmarshalBinary

func (m *TunnelIpv4SrcField) UnmarshalBinary(data []byte) error

type Uint16Message

type Uint16Message struct {
	Data uint16
}

func (*Uint16Message) Len

func (m *Uint16Message) Len() uint16

func (*Uint16Message) MarshalBinary

func (m *Uint16Message) MarshalBinary() (data []byte, err error)

func (*Uint16Message) UnmarshalBinary

func (m *Uint16Message) UnmarshalBinary(data []byte) error

type Uint32Message

type Uint32Message struct {
	Data uint32
}

func (*Uint32Message) Len

func (m *Uint32Message) Len() uint16

func (*Uint32Message) MarshalBinary

func (m *Uint32Message) MarshalBinary() (data []byte, err error)

func (*Uint32Message) UnmarshalBinary

func (m *Uint32Message) UnmarshalBinary(data []byte) error

type VendorError

type VendorError struct {
	*ErrorMsg
	ExperimenterID uint32
}

func NewBundleError

func NewBundleError() *VendorError

func (*VendorError) Len

func (e *VendorError) Len() uint16

func (*VendorError) MarshalBinary

func (e *VendorError) MarshalBinary() (data []byte, err error)

func (*VendorError) UnmarshalBinary

func (e *VendorError) UnmarshalBinary(data []byte) error

type VendorHeader

type VendorHeader struct {
	Header           common.Header /*Type OFPT_VENDOR*/
	Vendor           uint32
	ExperimenterType uint32
	VendorData       util.Message
}

ofp_vendor 1.3

func NewBundleAdd

func NewBundleAdd(bundleAdd *BundleAdd) *VendorHeader

func NewBundleControl

func NewBundleControl(bundleControl *BundleControl) *VendorHeader

func NewNXTVendorHeader

func NewNXTVendorHeader(msgType uint32) *VendorHeader

func NewSetControllerID

func NewSetControllerID(id uint16) *VendorHeader

func NewTLVTableModMessage

func NewTLVTableModMessage(tlvMod *TLVTableMod) *VendorHeader

func NewTLVTableRequest

func NewTLVTableRequest() *VendorHeader

func (*VendorHeader) Len

func (v *VendorHeader) Len() (n uint16)

func (*VendorHeader) MarshalBinary

func (v *VendorHeader) MarshalBinary() (data []byte, err error)

func (*VendorHeader) UnmarshalBinary

func (v *VendorHeader) UnmarshalBinary(data []byte) error

type VlanIdField

type VlanIdField struct {
	VlanId uint16
}

VLAN_ID field

func (*VlanIdField) Len

func (m *VlanIdField) Len() uint16

func (*VlanIdField) MarshalBinary

func (m *VlanIdField) MarshalBinary() (data []byte, err error)

func (*VlanIdField) UnmarshalBinary

func (m *VlanIdField) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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