1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // source: /usr/share/vpp/api/core/af_packet.api.json
5 Package af_packet is a generated VPP binary API for 'af_packet' module.
21 api "git.fd.io/govpp.git/api"
22 struc "github.com/lunixbochs/struc"
24 ethernet_types "git.fd.io/govpp.git/examples/binapi/ethernet_types"
25 interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
29 // ModuleName is the name of this module.
30 ModuleName = "af_packet"
31 // APIVersion is the API version of this module.
33 // VersionCrc is the CRC of this module.
34 VersionCrc = 0xba745e20
37 type IfStatusFlags = interface_types.IfStatusFlags
39 type IfType = interface_types.IfType
41 type LinkDuplex = interface_types.LinkDuplex
43 type MtuProto = interface_types.MtuProto
45 type RxMode = interface_types.RxMode
47 type SubIfFlags = interface_types.SubIfFlags
49 type InterfaceIndex = interface_types.InterfaceIndex
51 type MacAddress = ethernet_types.MacAddress
53 // AfPacketCreate represents VPP binary API message 'af_packet_create'.
54 type AfPacketCreate struct {
57 HostIfName string `struc:"[64]byte"`
60 func (m *AfPacketCreate) Reset() { *m = AfPacketCreate{} }
61 func (*AfPacketCreate) GetMessageName() string { return "af_packet_create" }
62 func (*AfPacketCreate) GetCrcString() string { return "a190415f" }
63 func (*AfPacketCreate) GetMessageType() api.MessageType { return api.RequestMessage }
65 // AfPacketCreateReply represents VPP binary API message 'af_packet_create_reply'.
66 type AfPacketCreateReply struct {
68 SwIfIndex InterfaceIndex
71 func (m *AfPacketCreateReply) Reset() { *m = AfPacketCreateReply{} }
72 func (*AfPacketCreateReply) GetMessageName() string { return "af_packet_create_reply" }
73 func (*AfPacketCreateReply) GetCrcString() string { return "5383d31f" }
74 func (*AfPacketCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage }
76 // AfPacketDelete represents VPP binary API message 'af_packet_delete'.
77 type AfPacketDelete struct {
78 HostIfName string `struc:"[64]byte"`
81 func (m *AfPacketDelete) Reset() { *m = AfPacketDelete{} }
82 func (*AfPacketDelete) GetMessageName() string { return "af_packet_delete" }
83 func (*AfPacketDelete) GetCrcString() string { return "863fa648" }
84 func (*AfPacketDelete) GetMessageType() api.MessageType { return api.RequestMessage }
86 // AfPacketDeleteReply represents VPP binary API message 'af_packet_delete_reply'.
87 type AfPacketDeleteReply struct {
91 func (m *AfPacketDeleteReply) Reset() { *m = AfPacketDeleteReply{} }
92 func (*AfPacketDeleteReply) GetMessageName() string { return "af_packet_delete_reply" }
93 func (*AfPacketDeleteReply) GetCrcString() string { return "e8d4e804" }
94 func (*AfPacketDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage }
96 // AfPacketDetails represents VPP binary API message 'af_packet_details'.
97 type AfPacketDetails struct {
98 SwIfIndex InterfaceIndex
99 HostIfName string `struc:"[64]byte"`
102 func (m *AfPacketDetails) Reset() { *m = AfPacketDetails{} }
103 func (*AfPacketDetails) GetMessageName() string { return "af_packet_details" }
104 func (*AfPacketDetails) GetCrcString() string { return "58c7c042" }
105 func (*AfPacketDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
107 // AfPacketDump represents VPP binary API message 'af_packet_dump'.
108 type AfPacketDump struct{}
110 func (m *AfPacketDump) Reset() { *m = AfPacketDump{} }
111 func (*AfPacketDump) GetMessageName() string { return "af_packet_dump" }
112 func (*AfPacketDump) GetCrcString() string { return "51077d14" }
113 func (*AfPacketDump) GetMessageType() api.MessageType { return api.RequestMessage }
115 // AfPacketSetL4CksumOffload represents VPP binary API message 'af_packet_set_l4_cksum_offload'.
116 type AfPacketSetL4CksumOffload struct {
117 SwIfIndex InterfaceIndex
121 func (m *AfPacketSetL4CksumOffload) Reset() { *m = AfPacketSetL4CksumOffload{} }
122 func (*AfPacketSetL4CksumOffload) GetMessageName() string { return "af_packet_set_l4_cksum_offload" }
123 func (*AfPacketSetL4CksumOffload) GetCrcString() string { return "319cd5c8" }
124 func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType { return api.RequestMessage }
126 // AfPacketSetL4CksumOffloadReply represents VPP binary API message 'af_packet_set_l4_cksum_offload_reply'.
127 type AfPacketSetL4CksumOffloadReply struct {
131 func (m *AfPacketSetL4CksumOffloadReply) Reset() { *m = AfPacketSetL4CksumOffloadReply{} }
132 func (*AfPacketSetL4CksumOffloadReply) GetMessageName() string {
133 return "af_packet_set_l4_cksum_offload_reply"
135 func (*AfPacketSetL4CksumOffloadReply) GetCrcString() string { return "e8d4e804" }
136 func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType { return api.ReplyMessage }
139 api.RegisterMessage((*AfPacketCreate)(nil), "af_packet.AfPacketCreate")
140 api.RegisterMessage((*AfPacketCreateReply)(nil), "af_packet.AfPacketCreateReply")
141 api.RegisterMessage((*AfPacketDelete)(nil), "af_packet.AfPacketDelete")
142 api.RegisterMessage((*AfPacketDeleteReply)(nil), "af_packet.AfPacketDeleteReply")
143 api.RegisterMessage((*AfPacketDetails)(nil), "af_packet.AfPacketDetails")
144 api.RegisterMessage((*AfPacketDump)(nil), "af_packet.AfPacketDump")
145 api.RegisterMessage((*AfPacketSetL4CksumOffload)(nil), "af_packet.AfPacketSetL4CksumOffload")
146 api.RegisterMessage((*AfPacketSetL4CksumOffloadReply)(nil), "af_packet.AfPacketSetL4CksumOffloadReply")
149 // Messages returns list of all messages in this module.
150 func AllMessages() []api.Message {
151 return []api.Message{
152 (*AfPacketCreate)(nil),
153 (*AfPacketCreateReply)(nil),
154 (*AfPacketDelete)(nil),
155 (*AfPacketDeleteReply)(nil),
156 (*AfPacketDetails)(nil),
157 (*AfPacketDump)(nil),
158 (*AfPacketSetL4CksumOffload)(nil),
159 (*AfPacketSetL4CksumOffloadReply)(nil),
163 // RPCService represents RPC service API for af_packet module.
164 type RPCService interface {
165 DumpAfPacket(ctx context.Context, in *AfPacketDump) (RPCService_DumpAfPacketClient, error)
166 AfPacketCreate(ctx context.Context, in *AfPacketCreate) (*AfPacketCreateReply, error)
167 AfPacketDelete(ctx context.Context, in *AfPacketDelete) (*AfPacketDeleteReply, error)
168 AfPacketSetL4CksumOffload(ctx context.Context, in *AfPacketSetL4CksumOffload) (*AfPacketSetL4CksumOffloadReply, error)
171 type serviceClient struct {
175 func NewServiceClient(ch api.Channel) RPCService {
176 return &serviceClient{ch}
179 func (c *serviceClient) DumpAfPacket(ctx context.Context, in *AfPacketDump) (RPCService_DumpAfPacketClient, error) {
180 stream := c.ch.SendMultiRequest(in)
181 x := &serviceClient_DumpAfPacketClient{stream}
185 type RPCService_DumpAfPacketClient interface {
186 Recv() (*AfPacketDetails, error)
189 type serviceClient_DumpAfPacketClient struct {
193 func (c *serviceClient_DumpAfPacketClient) Recv() (*AfPacketDetails, error) {
194 m := new(AfPacketDetails)
195 stop, err := c.MultiRequestCtx.ReceiveReply(m)
205 func (c *serviceClient) AfPacketCreate(ctx context.Context, in *AfPacketCreate) (*AfPacketCreateReply, error) {
206 out := new(AfPacketCreateReply)
207 err := c.ch.SendRequest(in).ReceiveReply(out)
214 func (c *serviceClient) AfPacketDelete(ctx context.Context, in *AfPacketDelete) (*AfPacketDeleteReply, error) {
215 out := new(AfPacketDeleteReply)
216 err := c.ch.SendRequest(in).ReceiveReply(out)
223 func (c *serviceClient) AfPacketSetL4CksumOffload(ctx context.Context, in *AfPacketSetL4CksumOffload) (*AfPacketSetL4CksumOffloadReply, error) {
224 out := new(AfPacketSetL4CksumOffloadReply)
225 err := c.ch.SendRequest(in).ReceiveReply(out)
232 // This is a compile-time assertion to ensure that this generated file
233 // is compatible with the GoVPP api package it is being compiled against.
234 // A compilation error at this line likely means your copy of the
235 // GoVPP api package needs to be updated.
236 const _ = api.GoVppAPIPackageIsVersion1 // please upgrade the GoVPP api package
238 // Reference imports to suppress errors if they are not otherwise used.
239 var _ = api.RegisterMessage
240 var _ = bytes.NewBuffer
241 var _ = context.Background