github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/fib/fib.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.4.0-dev 4 // VPP: 23.02-rc0~189-g57127b32a 5 // source: /usr/share/vpp/api/core/fib.api.json 6 7 // Package fib contains generated bindings for API file fib.api. 8 // 9 // Contents: 10 // 1 struct 11 // 4 messages 12 // 13 package fib 14 15 import ( 16 api "git.fd.io/govpp.git/api" 17 codec "git.fd.io/govpp.git/codec" 18 _ "github.com/edwarnicke/govpp/binapi/fib_types" 19 _ "github.com/edwarnicke/govpp/binapi/ip_types" 20 ) 21 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 27 28 const ( 29 APIFile = "fib" 30 APIVersion = "1.0.0" 31 VersionCrc = 0x4ef4abc1 32 ) 33 34 // FibSource defines type 'fib_source'. 35 type FibSource struct { 36 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"` 37 ID uint8 `binapi:"u8,name=id" json:"id,omitempty"` 38 Name string `binapi:"string[64],name=name" json:"name,omitempty"` 39 } 40 41 // FibSourceAdd defines message 'fib_source_add'. 42 type FibSourceAdd struct { 43 Src FibSource `binapi:"fib_source,name=src" json:"src,omitempty"` 44 } 45 46 func (m *FibSourceAdd) Reset() { *m = FibSourceAdd{} } 47 func (*FibSourceAdd) GetMessageName() string { return "fib_source_add" } 48 func (*FibSourceAdd) GetCrcString() string { return "b3ac2aec" } 49 func (*FibSourceAdd) GetMessageType() api.MessageType { 50 return api.RequestMessage 51 } 52 53 func (m *FibSourceAdd) Size() (size int) { 54 if m == nil { 55 return 0 56 } 57 size += 1 // m.Src.Priority 58 size += 1 // m.Src.ID 59 size += 64 // m.Src.Name 60 return size 61 } 62 func (m *FibSourceAdd) Marshal(b []byte) ([]byte, error) { 63 if b == nil { 64 b = make([]byte, m.Size()) 65 } 66 buf := codec.NewBuffer(b) 67 buf.EncodeUint8(m.Src.Priority) 68 buf.EncodeUint8(m.Src.ID) 69 buf.EncodeString(m.Src.Name, 64) 70 return buf.Bytes(), nil 71 } 72 func (m *FibSourceAdd) Unmarshal(b []byte) error { 73 buf := codec.NewBuffer(b) 74 m.Src.Priority = buf.DecodeUint8() 75 m.Src.ID = buf.DecodeUint8() 76 m.Src.Name = buf.DecodeString(64) 77 return nil 78 } 79 80 // FibSourceAddReply defines message 'fib_source_add_reply'. 81 type FibSourceAddReply struct { 82 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 83 ID uint8 `binapi:"u8,name=id" json:"id,omitempty"` 84 } 85 86 func (m *FibSourceAddReply) Reset() { *m = FibSourceAddReply{} } 87 func (*FibSourceAddReply) GetMessageName() string { return "fib_source_add_reply" } 88 func (*FibSourceAddReply) GetCrcString() string { return "604fd6f1" } 89 func (*FibSourceAddReply) GetMessageType() api.MessageType { 90 return api.ReplyMessage 91 } 92 93 func (m *FibSourceAddReply) Size() (size int) { 94 if m == nil { 95 return 0 96 } 97 size += 4 // m.Retval 98 size += 1 // m.ID 99 return size 100 } 101 func (m *FibSourceAddReply) Marshal(b []byte) ([]byte, error) { 102 if b == nil { 103 b = make([]byte, m.Size()) 104 } 105 buf := codec.NewBuffer(b) 106 buf.EncodeInt32(m.Retval) 107 buf.EncodeUint8(m.ID) 108 return buf.Bytes(), nil 109 } 110 func (m *FibSourceAddReply) Unmarshal(b []byte) error { 111 buf := codec.NewBuffer(b) 112 m.Retval = buf.DecodeInt32() 113 m.ID = buf.DecodeUint8() 114 return nil 115 } 116 117 // FibSourceDetails defines message 'fib_source_details'. 118 type FibSourceDetails struct { 119 Src FibSource `binapi:"fib_source,name=src" json:"src,omitempty"` 120 } 121 122 func (m *FibSourceDetails) Reset() { *m = FibSourceDetails{} } 123 func (*FibSourceDetails) GetMessageName() string { return "fib_source_details" } 124 func (*FibSourceDetails) GetCrcString() string { return "8668acdb" } 125 func (*FibSourceDetails) GetMessageType() api.MessageType { 126 return api.ReplyMessage 127 } 128 129 func (m *FibSourceDetails) Size() (size int) { 130 if m == nil { 131 return 0 132 } 133 size += 1 // m.Src.Priority 134 size += 1 // m.Src.ID 135 size += 64 // m.Src.Name 136 return size 137 } 138 func (m *FibSourceDetails) Marshal(b []byte) ([]byte, error) { 139 if b == nil { 140 b = make([]byte, m.Size()) 141 } 142 buf := codec.NewBuffer(b) 143 buf.EncodeUint8(m.Src.Priority) 144 buf.EncodeUint8(m.Src.ID) 145 buf.EncodeString(m.Src.Name, 64) 146 return buf.Bytes(), nil 147 } 148 func (m *FibSourceDetails) Unmarshal(b []byte) error { 149 buf := codec.NewBuffer(b) 150 m.Src.Priority = buf.DecodeUint8() 151 m.Src.ID = buf.DecodeUint8() 152 m.Src.Name = buf.DecodeString(64) 153 return nil 154 } 155 156 // FibSourceDump defines message 'fib_source_dump'. 157 type FibSourceDump struct{} 158 159 func (m *FibSourceDump) Reset() { *m = FibSourceDump{} } 160 func (*FibSourceDump) GetMessageName() string { return "fib_source_dump" } 161 func (*FibSourceDump) GetCrcString() string { return "51077d14" } 162 func (*FibSourceDump) GetMessageType() api.MessageType { 163 return api.RequestMessage 164 } 165 166 func (m *FibSourceDump) Size() (size int) { 167 if m == nil { 168 return 0 169 } 170 return size 171 } 172 func (m *FibSourceDump) Marshal(b []byte) ([]byte, error) { 173 if b == nil { 174 b = make([]byte, m.Size()) 175 } 176 buf := codec.NewBuffer(b) 177 return buf.Bytes(), nil 178 } 179 func (m *FibSourceDump) Unmarshal(b []byte) error { 180 return nil 181 } 182 183 func init() { file_fib_binapi_init() } 184 func file_fib_binapi_init() { 185 api.RegisterMessage((*FibSourceAdd)(nil), "fib_source_add_b3ac2aec") 186 api.RegisterMessage((*FibSourceAddReply)(nil), "fib_source_add_reply_604fd6f1") 187 api.RegisterMessage((*FibSourceDetails)(nil), "fib_source_details_8668acdb") 188 api.RegisterMessage((*FibSourceDump)(nil), "fib_source_dump_51077d14") 189 } 190 191 // Messages returns list of all messages in this module. 192 func AllMessages() []api.Message { 193 return []api.Message{ 194 (*FibSourceAdd)(nil), 195 (*FibSourceAddReply)(nil), 196 (*FibSourceDetails)(nil), 197 (*FibSourceDump)(nil), 198 } 199 }