Add support for aliases and boolean type
[govpp.git] / examples / bin_api / af_packet / af_packet.ba.go
index 81c2b9d..93d5e58 100644 (file)
@@ -20,40 +20,65 @@ var _ = api.RegisterMessage
 var _ = struc.Pack
 var _ = bytes.NewBuffer
 
+// Services represents VPP binary API services:
+//
+//     "services": {
+//         "af_packet_dump": {
+//             "reply": "af_packet_details",
+//             "stream": true
+//         },
+//         "af_packet_set_l4_cksum_offload": {
+//             "reply": "af_packet_set_l4_cksum_offload_reply"
+//         },
+//         "af_packet_delete": {
+//             "reply": "af_packet_delete_reply"
+//         },
+//         "af_packet_create": {
+//             "reply": "af_packet_create_reply"
+//         }
+//     },
+//
+type Services interface {
+       DumpAfPacket(*AfPacketDump) ([]*AfPacketDetails, error)
+       AfPacketCreate(*AfPacketCreate) (*AfPacketCreateReply, error)
+       AfPacketDelete(*AfPacketDelete) (*AfPacketDeleteReply, error)
+       AfPacketSetL4CksumOffload(*AfPacketSetL4CksumOffload) (*AfPacketSetL4CksumOffloadReply, error)
+}
+
 /* Messages */
 
-// AfPacketCreate represents the VPP binary API message 'af_packet_create'.
+// AfPacketCreate represents VPP binary API message 'af_packet_create':
 //
-//            "af_packet_create",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "client_index"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "u8",
-//                "host_if_name",
-//                64
-//            ],
-//            [
-//                "u8",
-//                "hw_addr",
-//                6
-//            ],
-//            [
-//                "u8",
-//                "use_random_hw_addr"
-//            ],
-//            {
-//                "crc": "0x6d5d30d6"
-//            }
+//     "af_packet_create",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "client_index"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "u8",
+//         "host_if_name",
+//         64
+//     ],
+//     [
+//         "u8",
+//         "hw_addr",
+//         6
+//     ],
+//     [
+//         "u8",
+//         "use_random_hw_addr"
+//     ],
+//     {
+//         "crc": "0x6d5d30d6"
+//     }
 //
 type AfPacketCreate struct {
        HostIfName      []byte `struc:"[64]byte"`
@@ -71,28 +96,28 @@ func (*AfPacketCreate) GetMessageType() api.MessageType {
        return api.RequestMessage
 }
 
-// AfPacketCreateReply represents the VPP binary API message 'af_packet_create_reply'.
+// AfPacketCreateReply represents VPP binary API message 'af_packet_create_reply':
 //
-//            "af_packet_create_reply",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "i32",
-//                "retval"
-//            ],
-//            [
-//                "u32",
-//                "sw_if_index"
-//            ],
-//            {
-//                "crc": "0xfda5941f"
-//            }
+//     "af_packet_create_reply",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "i32",
+//         "retval"
+//     ],
+//     [
+//         "u32",
+//         "sw_if_index"
+//     ],
+//     {
+//         "crc": "0xfda5941f"
+//     }
 //
 type AfPacketCreateReply struct {
        Retval    int32
@@ -109,29 +134,29 @@ func (*AfPacketCreateReply) GetMessageType() api.MessageType {
        return api.ReplyMessage
 }
 
-// AfPacketDelete represents the VPP binary API message 'af_packet_delete'.
+// AfPacketDelete represents VPP binary API message 'af_packet_delete':
 //
-//            "af_packet_delete",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "client_index"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "u8",
-//                "host_if_name",
-//                64
-//            ],
-//            {
-//                "crc": "0x3efceda3"
-//            }
+//     "af_packet_delete",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "client_index"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "u8",
+//         "host_if_name",
+//         64
+//     ],
+//     {
+//         "crc": "0x3efceda3"
+//     }
 //
 type AfPacketDelete struct {
        HostIfName []byte `struc:"[64]byte"`
@@ -147,24 +172,24 @@ func (*AfPacketDelete) GetMessageType() api.MessageType {
        return api.RequestMessage
 }
 
-// AfPacketDeleteReply represents the VPP binary API message 'af_packet_delete_reply'.
+// AfPacketDeleteReply represents VPP binary API message 'af_packet_delete_reply':
 //
-//            "af_packet_delete_reply",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "i32",
-//                "retval"
-//            ],
-//            {
-//                "crc": "0xe8d4e804"
-//            }
+//     "af_packet_delete_reply",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "i32",
+//         "retval"
+//     ],
+//     {
+//         "crc": "0xe8d4e804"
+//     }
 //
 type AfPacketDeleteReply struct {
        Retval int32
@@ -180,32 +205,32 @@ func (*AfPacketDeleteReply) GetMessageType() api.MessageType {
        return api.ReplyMessage
 }
 
-// AfPacketSetL4CksumOffload represents the VPP binary API message 'af_packet_set_l4_cksum_offload'.
+// AfPacketSetL4CksumOffload represents VPP binary API message 'af_packet_set_l4_cksum_offload':
 //
-//            "af_packet_set_l4_cksum_offload",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "client_index"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "u8",
-//                "sw_if_index"
-//            ],
-//            [
-//                "u8",
-//                "set"
-//            ],
-//            {
-//                "crc": "0x86538585"
-//            }
+//     "af_packet_set_l4_cksum_offload",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "client_index"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "u8",
+//         "sw_if_index"
+//     ],
+//     [
+//         "u8",
+//         "set"
+//     ],
+//     {
+//         "crc": "0x86538585"
+//     }
 //
 type AfPacketSetL4CksumOffload struct {
        SwIfIndex uint8
@@ -222,24 +247,24 @@ func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType {
        return api.RequestMessage
 }
 
-// AfPacketSetL4CksumOffloadReply represents the VPP binary API message 'af_packet_set_l4_cksum_offload_reply'.
+// AfPacketSetL4CksumOffloadReply represents VPP binary API message 'af_packet_set_l4_cksum_offload_reply':
 //
-//            "af_packet_set_l4_cksum_offload_reply",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "i32",
-//                "retval"
-//            ],
-//            {
-//                "crc": "0xe8d4e804"
-//            }
+//     "af_packet_set_l4_cksum_offload_reply",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "i32",
+//         "retval"
+//     ],
+//     {
+//         "crc": "0xe8d4e804"
+//     }
 //
 type AfPacketSetL4CksumOffloadReply struct {
        Retval int32
@@ -255,24 +280,24 @@ func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType {
        return api.ReplyMessage
 }
 
-// AfPacketDump represents the VPP binary API message 'af_packet_dump'.
+// AfPacketDump represents VPP binary API message 'af_packet_dump':
 //
-//            "af_packet_dump",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "client_index"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            {
-//                "crc": "0x51077d14"
-//            }
+//     "af_packet_dump",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "client_index"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     {
+//         "crc": "0x51077d14"
+//     }
 //
 type AfPacketDump struct{}
 
@@ -286,29 +311,29 @@ func (*AfPacketDump) GetMessageType() api.MessageType {
        return api.RequestMessage
 }
 
-// AfPacketDetails represents the VPP binary API message 'af_packet_details'.
+// AfPacketDetails represents VPP binary API message 'af_packet_details':
 //
-//            "af_packet_details",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "u32",
-//                "sw_if_index"
-//            ],
-//            [
-//                "u8",
-//                "host_if_name",
-//                64
-//            ],
-//            {
-//                "crc": "0x057205fa"
-//            }
+//     "af_packet_details",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "u32",
+//         "sw_if_index"
+//     ],
+//     [
+//         "u8",
+//         "host_if_name",
+//         64
+//     ],
+//     {
+//         "crc": "0x057205fa"
+//     }
 //
 type AfPacketDetails struct {
        SwIfIndex  uint32
@@ -325,15 +350,6 @@ func (*AfPacketDetails) GetMessageType() api.MessageType {
        return api.ReplyMessage
 }
 
-/* Services */
-
-type Services interface {
-       DumpAfPacket(*AfPacketDump) (*AfPacketDetails, error)
-       AfPacketCreate(*AfPacketCreate) (*AfPacketCreateReply, error)
-       AfPacketDelete(*AfPacketDelete) (*AfPacketDeleteReply, error)
-       AfPacketSetL4CksumOffload(*AfPacketSetL4CksumOffload) (*AfPacketSetL4CksumOffloadReply, error)
-}
-
 func init() {
        api.RegisterMessage((*AfPacketCreate)(nil), "af_packet.AfPacketCreate")
        api.RegisterMessage((*AfPacketCreateReply)(nil), "af_packet.AfPacketCreateReply")