Ejemplo n.º 1
0
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
}
Ejemplo n.º 2
0
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
}
Ejemplo n.º 3
0
// 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
}
Ejemplo n.º 4
0
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
}
Ejemplo n.º 5
0
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
}
Ejemplo n.º 6
0
func NewPortStatus() *PortStatus {
	p := new(PortStatus)
	p.Header = ofpxx.NewOfp10Header()
	p.pad = make([]byte, 7)
	return p
}
Ejemplo n.º 7
0
// 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
}
Ejemplo n.º 8
0
// 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
}
Ejemplo n.º 9
0
// FeaturesRequest constructor
func NewFeaturesRequest() *ofpxx.Header {
	req := ofpxx.NewOfp10Header()
	req.Type = Type_FeaturesRequest
	return &req
}