func NewOfpBarrierRequest() *OfpHeader {
	barrier := NewOfpHeader(OFPT_BARRIER_REQUEST)
	return &barrier
}
**************************************************
/* BarrierRequest Message
**************************************************
package ofp13
import (
	"encoding/binary"
	"errors"
	"net"
)
func Parse(packet []byte) (msg OFMessage) {
	switch packet[1] {
	case OFPT_HELLO:
		msg = new(OfpHello)
		msg.Parse(packet)
	case OFPT_ERROR:
		msg = new(OfpErrorMsg)
		msg.Parse(packet)
	case OFPT_ECHO_REQUEST:
		msg = NewOfpEchoRequest()
		msg.Parse(packet)
	case OFPT_ECHO_REPLY:
		msg = NewOfpEchoReply()
		msg.Parse(packet)
	case OFPT_FEATURES_REPLY:
		msg = NewOfpFeaturesReply()
		msg.Parse(packet)
	case OFPT_GET_CONFIG_REPLY:
		msg = NewOfpGetConfig()
		msg.Parse(packet)
	case OFPT_PACKET_IN:
		msg = NewOfpPacketIn()
		msg.Parse(packet)
	case OFPT_FLOW_REMOVED:
		msg = NewOfpFlowRemoved()
		msg.Parse(packet)
	case OFPT_PORT_STATUS:
		msg = NewOfpPortStatus()
		msg.Parse(packet)
	case OFPT_MULTIPART_REPLY:
		msg = NewOfpMultipartReply()
		msg.Parse(packet)
	case OFPT_BARRIER_REPLY:
		msg = NewOfpBarrierReply()
		msg.Parse(packet)
	case OFPT_QUEUE_GET_CONFIG_REPLY:
		msg = NewOfpQueueGetConfigReply()
		msg.Parse(packet)
	case OFPT_ROLE_REPLY:
		msg = NewOfpRoleReply()
		msg.Parse(packet)
	case OFPT_GET_ASYNC_REPLY:
		msg = NewOfpGetAsyncReply()
		msg.Parse(packet)
	default:
	}
	return msg
}
var xid uint32 = 0
func nextXid() uint32 {
	tmp := xid
	xid += 1
	return tmp
}
func NewOfpHeader(t uint8) OfpHeader {
	h := OfpHeader{4, t, 8, nextXid()}
	return h
}
func (h *OfpHeader) Serialize() []byte {
	packet := make([]byte, 8)
	packet[0] = h.Version
	packet[1] = h.Type
	binary.BigEndian.PutUint16(packet[2:], h.Length)
	binary.BigEndian.PutUint32(packet[4:], h.Xid)
	return packet
}
func (h *OfpHeader) Parse(packet []byte) {
	h.Version = packet[0]
	h.Type = packet[1]
	h.Length = binary.BigEndian.Uint16(packet[2:])
	h.Xid = binary.BigEndian.Uint32(packet[4:])
}
func (h *OfpHeader) Size() int {
	return 8
}
func NewOfpEchoRequest() *OfpHeader {
	echo := NewOfpHeader(OFPT_ECHO_REQUEST)
	return &echo
}
func NewOfpEchoReply() *OfpHeader {
	echo := NewOfpHeader(OFPT_ECHO_REPLY)
	return &echo
}