func NewFlowRemoved() *FlowRemoved { f := new(FlowRemoved) f.Header = ofpxx.NewOfp10Header() f.Match = *NewMatch() f.pad = make([]byte, 1) f.pad2 = make([]byte, 2) return f }
func NewPacketIn() *PacketIn { p := new(PacketIn) p.Header = ofpxx.NewOfp10Header() p.Header.Type = Type_PacketIn p.BufferId = 0xffffffff p.InPort = P_NONE p.Reason = 0 return p }
// FeaturesReply constructor func NewFeaturesReply() *SwitchFeatures { res := new(SwitchFeatures) res.Header = ofpxx.NewOfp10Header() res.Header.Type = Type_FeaturesReply res.DPID = make([]byte, 8) res.pad = make([]byte, 3) res.Ports = make([]PhyPort, 0) return res }
func NewPacketOut() *PacketOut { p := new(PacketOut) p.Header = ofpxx.NewOfp10Header() p.Header.Type = Type_PacketOut p.BufferId = 0xffffffff p.InPort = P_NONE p.ActionsLen = 0 p.Actions = make([]Action, 0) return p }
func NewFlowMod() *FlowMod { f := new(FlowMod) f.Header = ofpxx.NewOfp10Header() f.Header.Type = Type_FlowMod f.Match = *NewMatch() // Add a generator for f.Cookie here f.Cookie = 0 f.Command = FC_ADD f.IdleTimeout = 0 f.HardTimeout = 0 // Add a priority gen here f.Priority = 1000 f.BufferId = 0xffffffff f.OutPort = P_NONE f.Flags = 0 f.Actions = make([]Action, 0) return f }
func NewPortStatus() *PortStatus { p := new(PortStatus) p.Header = ofpxx.NewOfp10Header() p.pad = make([]byte, 7) return p }
// 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 NewEchoReply() *ofpxx.Header { h := ofpxx.NewOfp10Header() h.Type = Type_EchoReply return &h }
// 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() *ofpxx.Header { h := ofpxx.NewOfp10Header() h.Type = Type_EchoRequest return &h }
// FeaturesRequest constructor func NewFeaturesRequest() *ofpxx.Header { req := ofpxx.NewOfp10Header() req.Type = Type_FeaturesRequest return &req }