1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/plugins/graph.api.json
7 // Package graph contains generated bindings for API file graph.api.
18 api "git.fd.io/govpp.git/api"
19 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
31 VersionCrc = 0xa0b3fd1c
34 // NodeFlag defines enum 'node_flag'.
38 NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH NodeFlag = 1
39 NODE_FLAG_IS_OUTPUT NodeFlag = 2
40 NODE_FLAG_IS_DROP NodeFlag = 4
41 NODE_FLAG_IS_PUNT NodeFlag = 8
42 NODE_FLAG_IS_HANDOFF NodeFlag = 16
43 NODE_FLAG_TRACE NodeFlag = 32
44 NODE_FLAG_SWITCH_FROM_INTERRUPT_TO_POLLING_MODE NodeFlag = 64
45 NODE_FLAG_SWITCH_FROM_POLLING_TO_INTERRUPT_MODE NodeFlag = 128
46 NODE_FLAG_TRACE_SUPPORTED NodeFlag = 256
50 NodeFlag_name = map[uint32]string{
51 1: "NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH",
52 2: "NODE_FLAG_IS_OUTPUT",
53 4: "NODE_FLAG_IS_DROP",
54 8: "NODE_FLAG_IS_PUNT",
55 16: "NODE_FLAG_IS_HANDOFF",
56 32: "NODE_FLAG_TRACE",
57 64: "NODE_FLAG_SWITCH_FROM_INTERRUPT_TO_POLLING_MODE",
58 128: "NODE_FLAG_SWITCH_FROM_POLLING_TO_INTERRUPT_MODE",
59 256: "NODE_FLAG_TRACE_SUPPORTED",
61 NodeFlag_value = map[string]uint32{
62 "NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH": 1,
63 "NODE_FLAG_IS_OUTPUT": 2,
64 "NODE_FLAG_IS_DROP": 4,
65 "NODE_FLAG_IS_PUNT": 8,
66 "NODE_FLAG_IS_HANDOFF": 16,
67 "NODE_FLAG_TRACE": 32,
68 "NODE_FLAG_SWITCH_FROM_INTERRUPT_TO_POLLING_MODE": 64,
69 "NODE_FLAG_SWITCH_FROM_POLLING_TO_INTERRUPT_MODE": 128,
70 "NODE_FLAG_TRACE_SUPPORTED": 256,
74 func (x NodeFlag) String() string {
75 s, ok := NodeFlag_name[uint32(x)]
79 return "NodeFlag(" + strconv.Itoa(int(x)) + ")"
82 // GraphNodeDetails defines message 'graph_node_details'.
83 type GraphNodeDetails struct {
84 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
85 Name string `binapi:"string[64],name=name" json:"name,omitempty"`
86 Flags NodeFlag `binapi:"node_flag,name=flags" json:"flags,omitempty"`
87 NArcs uint32 `binapi:"u32,name=n_arcs" json:"-"`
88 ArcsOut []uint32 `binapi:"u32[n_arcs],name=arcs_out" json:"arcs_out,omitempty"`
91 func (m *GraphNodeDetails) Reset() { *m = GraphNodeDetails{} }
92 func (*GraphNodeDetails) GetMessageName() string { return "graph_node_details" }
93 func (*GraphNodeDetails) GetCrcString() string { return "ac762018" }
94 func (*GraphNodeDetails) GetMessageType() api.MessageType {
95 return api.ReplyMessage
98 func (m *GraphNodeDetails) Size() (size int) {
106 size += 4 * len(m.ArcsOut) // m.ArcsOut
109 func (m *GraphNodeDetails) Marshal(b []byte) ([]byte, error) {
111 b = make([]byte, m.Size())
113 buf := codec.NewBuffer(b)
114 buf.EncodeUint32(m.Index)
115 buf.EncodeString(m.Name, 64)
116 buf.EncodeUint32(uint32(m.Flags))
117 buf.EncodeUint32(uint32(len(m.ArcsOut)))
118 for i := 0; i < len(m.ArcsOut); i++ {
120 if i < len(m.ArcsOut) {
121 x = uint32(m.ArcsOut[i])
125 return buf.Bytes(), nil
127 func (m *GraphNodeDetails) Unmarshal(b []byte) error {
128 buf := codec.NewBuffer(b)
129 m.Index = buf.DecodeUint32()
130 m.Name = buf.DecodeString(64)
131 m.Flags = NodeFlag(buf.DecodeUint32())
132 m.NArcs = buf.DecodeUint32()
133 m.ArcsOut = make([]uint32, m.NArcs)
134 for i := 0; i < len(m.ArcsOut); i++ {
135 m.ArcsOut[i] = buf.DecodeUint32()
140 // GraphNodeGet defines message 'graph_node_get'.
141 type GraphNodeGet struct {
142 Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"`
143 Index uint32 `binapi:"u32,name=index" json:"index,omitempty"`
144 Name string `binapi:"string[64],name=name" json:"name,omitempty"`
145 Flags NodeFlag `binapi:"node_flag,name=flags" json:"flags,omitempty"`
146 WantArcs bool `binapi:"bool,name=want_arcs" json:"want_arcs,omitempty"`
149 func (m *GraphNodeGet) Reset() { *m = GraphNodeGet{} }
150 func (*GraphNodeGet) GetMessageName() string { return "graph_node_get" }
151 func (*GraphNodeGet) GetCrcString() string { return "39c8792e" }
152 func (*GraphNodeGet) GetMessageType() api.MessageType {
153 return api.RequestMessage
156 func (m *GraphNodeGet) Size() (size int) {
160 size += 4 // m.Cursor
164 size += 1 // m.WantArcs
167 func (m *GraphNodeGet) Marshal(b []byte) ([]byte, error) {
169 b = make([]byte, m.Size())
171 buf := codec.NewBuffer(b)
172 buf.EncodeUint32(m.Cursor)
173 buf.EncodeUint32(m.Index)
174 buf.EncodeString(m.Name, 64)
175 buf.EncodeUint32(uint32(m.Flags))
176 buf.EncodeBool(m.WantArcs)
177 return buf.Bytes(), nil
179 func (m *GraphNodeGet) Unmarshal(b []byte) error {
180 buf := codec.NewBuffer(b)
181 m.Cursor = buf.DecodeUint32()
182 m.Index = buf.DecodeUint32()
183 m.Name = buf.DecodeString(64)
184 m.Flags = NodeFlag(buf.DecodeUint32())
185 m.WantArcs = buf.DecodeBool()
189 // GraphNodeGetReply defines message 'graph_node_get_reply'.
190 type GraphNodeGetReply struct {
191 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
192 Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"`
195 func (m *GraphNodeGetReply) Reset() { *m = GraphNodeGetReply{} }
196 func (*GraphNodeGetReply) GetMessageName() string { return "graph_node_get_reply" }
197 func (*GraphNodeGetReply) GetCrcString() string { return "53b48f5d" }
198 func (*GraphNodeGetReply) GetMessageType() api.MessageType {
199 return api.ReplyMessage
202 func (m *GraphNodeGetReply) Size() (size int) {
206 size += 4 // m.Retval
207 size += 4 // m.Cursor
210 func (m *GraphNodeGetReply) Marshal(b []byte) ([]byte, error) {
212 b = make([]byte, m.Size())
214 buf := codec.NewBuffer(b)
215 buf.EncodeInt32(m.Retval)
216 buf.EncodeUint32(m.Cursor)
217 return buf.Bytes(), nil
219 func (m *GraphNodeGetReply) Unmarshal(b []byte) error {
220 buf := codec.NewBuffer(b)
221 m.Retval = buf.DecodeInt32()
222 m.Cursor = buf.DecodeUint32()
226 func init() { file_graph_binapi_init() }
227 func file_graph_binapi_init() {
228 api.RegisterMessage((*GraphNodeDetails)(nil), "graph_node_details_ac762018")
229 api.RegisterMessage((*GraphNodeGet)(nil), "graph_node_get_39c8792e")
230 api.RegisterMessage((*GraphNodeGetReply)(nil), "graph_node_get_reply_53b48f5d")
233 // Messages returns list of all messages in this module.
234 func AllMessages() []api.Message {
235 return []api.Message{
236 (*GraphNodeDetails)(nil),
237 (*GraphNodeGet)(nil),
238 (*GraphNodeGetReply)(nil),