Generator improvements
[govpp.git] / examples / bin_api / tap / tap.ba.go
index d4daa1d..d363146 100644 (file)
@@ -5,9 +5,8 @@
  Package tap is a generated from VPP binary API module 'tap'.
 
  It contains following objects:
-         8 messages
          4 services
-
+         8 messages
 */
 package tap
 
@@ -20,79 +19,174 @@ var _ = api.RegisterMessage
 var _ = struc.Pack
 var _ = bytes.NewBuffer
 
+// Services represents VPP binary API services:
+//
+//     "services": {
+//         "tap_delete": {
+//             "reply": "tap_delete_reply"
+//         },
+//         "sw_interface_tap_dump": {
+//             "reply": "sw_interface_tap_details",
+//             "stream": true
+//         },
+//         "tap_modify": {
+//             "reply": "tap_modify_reply"
+//         },
+//         "tap_connect": {
+//             "reply": "tap_connect_reply"
+//         }
+//     },
+//
+type Services interface {
+       DumpSwInterfaceTap(*SwInterfaceTapDump) ([]*SwInterfaceTapDetails, error)
+       TapConnect(*TapConnect) (*TapConnectReply, error)
+       TapDelete(*TapDelete) (*TapDeleteReply, error)
+       TapModify(*TapModify) (*TapModifyReply, error)
+}
+
 /* Messages */
 
-// TapConnect represents the VPP binary API message 'tap_connect'.
+// SwInterfaceTapDetails represents VPP binary API message 'sw_interface_tap_details':
+//
+//     "sw_interface_tap_details",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "u32",
+//         "sw_if_index"
+//     ],
+//     [
+//         "u8",
+//         "dev_name",
+//         64
+//     ],
+//     {
+//         "crc": "0x76229a57"
+//     }
+//
+type SwInterfaceTapDetails struct {
+       SwIfIndex uint32
+       DevName   []byte `struc:"[64]byte"`
+}
+
+func (*SwInterfaceTapDetails) GetMessageName() string {
+       return "sw_interface_tap_details"
+}
+func (*SwInterfaceTapDetails) GetCrcString() string {
+       return "76229a57"
+}
+func (*SwInterfaceTapDetails) GetMessageType() api.MessageType {
+       return api.ReplyMessage
+}
+
+// SwInterfaceTapDump represents VPP binary API message 'sw_interface_tap_dump':
+//
+//     "sw_interface_tap_dump",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "client_index"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     {
+//         "crc": "0x51077d14"
+//     }
+//
+type SwInterfaceTapDump struct{}
+
+func (*SwInterfaceTapDump) GetMessageName() string {
+       return "sw_interface_tap_dump"
+}
+func (*SwInterfaceTapDump) GetCrcString() string {
+       return "51077d14"
+}
+func (*SwInterfaceTapDump) GetMessageType() api.MessageType {
+       return api.RequestMessage
+}
+
+// TapConnect represents VPP binary API message 'tap_connect':
 //
-//            "tap_connect",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "client_index"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "u8",
-//                "use_random_mac"
-//            ],
-//            [
-//                "u8",
-//                "tap_name",
-//                64
-//            ],
-//            [
-//                "u8",
-//                "mac_address",
-//                6
-//            ],
-//            [
-//                "u8",
-//                "renumber"
-//            ],
-//            [
-//                "u32",
-//                "custom_dev_instance"
-//            ],
-//            [
-//                "u8",
-//                "ip4_address_set"
-//            ],
-//            [
-//                "u8",
-//                "ip4_address",
-//                4
-//            ],
-//            [
-//                "u8",
-//                "ip4_mask_width"
-//            ],
-//            [
-//                "u8",
-//                "ip6_address_set"
-//            ],
-//            [
-//                "u8",
-//                "ip6_address",
-//                16
-//            ],
-//            [
-//                "u8",
-//                "ip6_mask_width"
-//            ],
-//            [
-//                "u8",
-//                "tag",
-//                64
-//            ],
-//            {
-//                "crc": "0x9b9c396f"
-//            }
+//     "tap_connect",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "client_index"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "u8",
+//         "use_random_mac"
+//     ],
+//     [
+//         "u8",
+//         "tap_name",
+//         64
+//     ],
+//     [
+//         "u8",
+//         "mac_address",
+//         6
+//     ],
+//     [
+//         "u8",
+//         "renumber"
+//     ],
+//     [
+//         "u32",
+//         "custom_dev_instance"
+//     ],
+//     [
+//         "u8",
+//         "ip4_address_set"
+//     ],
+//     [
+//         "u8",
+//         "ip4_address",
+//         4
+//     ],
+//     [
+//         "u8",
+//         "ip4_mask_width"
+//     ],
+//     [
+//         "u8",
+//         "ip6_address_set"
+//     ],
+//     [
+//         "u8",
+//         "ip6_address",
+//         16
+//     ],
+//     [
+//         "u8",
+//         "ip6_mask_width"
+//     ],
+//     [
+//         "u8",
+//         "tag",
+//         64
+//     ],
+//     {
+//         "crc": "0x9b9c396f"
+//     }
 //
 type TapConnect struct {
        UseRandomMac      uint8
@@ -119,28 +213,28 @@ func (*TapConnect) GetMessageType() api.MessageType {
        return api.RequestMessage
 }
 
-// TapConnectReply represents the VPP binary API message 'tap_connect_reply'.
+// TapConnectReply represents VPP binary API message 'tap_connect_reply':
 //
-//            "tap_connect_reply",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "i32",
-//                "retval"
-//            ],
-//            [
-//                "u32",
-//                "sw_if_index"
-//            ],
-//            {
-//                "crc": "0xfda5941f"
-//            }
+//     "tap_connect_reply",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "i32",
+//         "retval"
+//     ],
+//     [
+//         "u32",
+//         "sw_if_index"
+//     ],
+//     {
+//         "crc": "0xfda5941f"
+//     }
 //
 type TapConnectReply struct {
        Retval    int32
@@ -157,130 +251,28 @@ func (*TapConnectReply) GetMessageType() api.MessageType {
        return api.ReplyMessage
 }
 
-// TapModify represents the VPP binary API message 'tap_modify'.
-//
-//            "tap_modify",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "client_index"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "u32",
-//                "sw_if_index"
-//            ],
-//            [
-//                "u8",
-//                "use_random_mac"
-//            ],
-//            [
-//                "u8",
-//                "tap_name",
-//                64
-//            ],
-//            [
-//                "u8",
-//                "mac_address",
-//                6
-//            ],
-//            [
-//                "u8",
-//                "renumber"
-//            ],
-//            [
-//                "u32",
-//                "custom_dev_instance"
-//            ],
-//            {
-//                "crc": "0x8047ae5c"
-//            }
-//
-type TapModify struct {
-       SwIfIndex         uint32
-       UseRandomMac      uint8
-       TapName           []byte `struc:"[64]byte"`
-       MacAddress        []byte `struc:"[6]byte"`
-       Renumber          uint8
-       CustomDevInstance uint32
-}
-
-func (*TapModify) GetMessageName() string {
-       return "tap_modify"
-}
-func (*TapModify) GetCrcString() string {
-       return "8047ae5c"
-}
-func (*TapModify) GetMessageType() api.MessageType {
-       return api.RequestMessage
-}
-
-// TapModifyReply represents the VPP binary API message 'tap_modify_reply'.
-//
-//            "tap_modify_reply",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "i32",
-//                "retval"
-//            ],
-//            [
-//                "u32",
-//                "sw_if_index"
-//            ],
-//            {
-//                "crc": "0xfda5941f"
-//            }
-//
-type TapModifyReply struct {
-       Retval    int32
-       SwIfIndex uint32
-}
-
-func (*TapModifyReply) GetMessageName() string {
-       return "tap_modify_reply"
-}
-func (*TapModifyReply) GetCrcString() string {
-       return "fda5941f"
-}
-func (*TapModifyReply) GetMessageType() api.MessageType {
-       return api.ReplyMessage
-}
-
-// TapDelete represents the VPP binary API message 'tap_delete'.
+// TapDelete represents VPP binary API message 'tap_delete':
 //
-//            "tap_delete",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "client_index"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "u32",
-//                "sw_if_index"
-//            ],
-//            {
-//                "crc": "0x529cb13f"
-//            }
+//     "tap_delete",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "client_index"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "u32",
+//         "sw_if_index"
+//     ],
+//     {
+//         "crc": "0x529cb13f"
+//     }
 //
 type TapDelete struct {
        SwIfIndex uint32
@@ -296,24 +288,24 @@ func (*TapDelete) GetMessageType() api.MessageType {
        return api.RequestMessage
 }
 
-// TapDeleteReply represents the VPP binary API message 'tap_delete_reply'.
+// TapDeleteReply represents VPP binary API message 'tap_delete_reply':
 //
-//            "tap_delete_reply",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "i32",
-//                "retval"
-//            ],
-//            {
-//                "crc": "0xe8d4e804"
-//            }
+//     "tap_delete_reply",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "i32",
+//         "retval"
+//     ],
+//     {
+//         "crc": "0xe8d4e804"
+//     }
 //
 type TapDeleteReply struct {
        Retval int32
@@ -329,92 +321,115 @@ func (*TapDeleteReply) GetMessageType() api.MessageType {
        return api.ReplyMessage
 }
 
-// SwInterfaceTapDump represents the VPP binary API message 'sw_interface_tap_dump'.
+// TapModify represents VPP binary API message 'tap_modify':
 //
-//            "sw_interface_tap_dump",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "client_index"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            {
-//                "crc": "0x51077d14"
-//            }
+//     "tap_modify",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "client_index"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "u32",
+//         "sw_if_index"
+//     ],
+//     [
+//         "u8",
+//         "use_random_mac"
+//     ],
+//     [
+//         "u8",
+//         "tap_name",
+//         64
+//     ],
+//     [
+//         "u8",
+//         "mac_address",
+//         6
+//     ],
+//     [
+//         "u8",
+//         "renumber"
+//     ],
+//     [
+//         "u32",
+//         "custom_dev_instance"
+//     ],
+//     {
+//         "crc": "0x8047ae5c"
+//     }
 //
-type SwInterfaceTapDump struct{}
+type TapModify struct {
+       SwIfIndex         uint32
+       UseRandomMac      uint8
+       TapName           []byte `struc:"[64]byte"`
+       MacAddress        []byte `struc:"[6]byte"`
+       Renumber          uint8
+       CustomDevInstance uint32
+}
 
-func (*SwInterfaceTapDump) GetMessageName() string {
-       return "sw_interface_tap_dump"
+func (*TapModify) GetMessageName() string {
+       return "tap_modify"
 }
-func (*SwInterfaceTapDump) GetCrcString() string {
-       return "51077d14"
+func (*TapModify) GetCrcString() string {
+       return "8047ae5c"
 }
-func (*SwInterfaceTapDump) GetMessageType() api.MessageType {
+func (*TapModify) GetMessageType() api.MessageType {
        return api.RequestMessage
 }
 
-// SwInterfaceTapDetails represents the VPP binary API message 'sw_interface_tap_details'.
+// TapModifyReply represents VPP binary API message 'tap_modify_reply':
 //
-//            "sw_interface_tap_details",
-//            [
-//                "u16",
-//                "_vl_msg_id"
-//            ],
-//            [
-//                "u32",
-//                "context"
-//            ],
-//            [
-//                "u32",
-//                "sw_if_index"
-//            ],
-//            [
-//                "u8",
-//                "dev_name",
-//                64
-//            ],
-//            {
-//                "crc": "0x76229a57"
-//            }
+//     "tap_modify_reply",
+//     [
+//         "u16",
+//         "_vl_msg_id"
+//     ],
+//     [
+//         "u32",
+//         "context"
+//     ],
+//     [
+//         "i32",
+//         "retval"
+//     ],
+//     [
+//         "u32",
+//         "sw_if_index"
+//     ],
+//     {
+//         "crc": "0xfda5941f"
+//     }
 //
-type SwInterfaceTapDetails struct {
+type TapModifyReply struct {
+       Retval    int32
        SwIfIndex uint32
-       DevName   []byte `struc:"[64]byte"`
 }
 
-func (*SwInterfaceTapDetails) GetMessageName() string {
-       return "sw_interface_tap_details"
+func (*TapModifyReply) GetMessageName() string {
+       return "tap_modify_reply"
 }
-func (*SwInterfaceTapDetails) GetCrcString() string {
-       return "76229a57"
+func (*TapModifyReply) GetCrcString() string {
+       return "fda5941f"
 }
-func (*SwInterfaceTapDetails) GetMessageType() api.MessageType {
+func (*TapModifyReply) GetMessageType() api.MessageType {
        return api.ReplyMessage
 }
 
-/* Services */
-
-type Services interface {
-       DumpSwInterfaceTap(*SwInterfaceTapDump) (*SwInterfaceTapDetails, error)
-       TapConnect(*TapConnect) (*TapConnectReply, error)
-       TapDelete(*TapDelete) (*TapDeleteReply, error)
-       TapModify(*TapModify) (*TapModifyReply, error)
-}
-
 func init() {
+       api.RegisterMessage((*SwInterfaceTapDetails)(nil), "tap.SwInterfaceTapDetails")
+       api.RegisterMessage((*SwInterfaceTapDump)(nil), "tap.SwInterfaceTapDump")
        api.RegisterMessage((*TapConnect)(nil), "tap.TapConnect")
        api.RegisterMessage((*TapConnectReply)(nil), "tap.TapConnectReply")
-       api.RegisterMessage((*TapModify)(nil), "tap.TapModify")
-       api.RegisterMessage((*TapModifyReply)(nil), "tap.TapModifyReply")
        api.RegisterMessage((*TapDelete)(nil), "tap.TapDelete")
        api.RegisterMessage((*TapDeleteReply)(nil), "tap.TapDeleteReply")
-       api.RegisterMessage((*SwInterfaceTapDump)(nil), "tap.SwInterfaceTapDump")
-       api.RegisterMessage((*SwInterfaceTapDetails)(nil), "tap.SwInterfaceTapDetails")
+       api.RegisterMessage((*TapModify)(nil), "tap.TapModify")
+       api.RegisterMessage((*TapModifyReply)(nil), "tap.TapModifyReply")
 }