github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/http_static/http_static.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.10.0-dev 4 // VPP: 23.10-rc0~170-g6f1548434 5 // source: plugins/http_static.api.json 6 7 // Package http_static contains generated bindings for API file http_static.api. 8 // 9 // Contents: 10 // - 2 messages 11 package http_static 12 13 import ( 14 api "go.fd.io/govpp/api" 15 codec "go.fd.io/govpp/codec" 16 ) 17 18 // This is a compile-time assertion to ensure that this generated file 19 // is compatible with the GoVPP api package it is being compiled against. 20 // A compilation error at this line likely means your copy of the 21 // GoVPP api package needs to be updated. 22 const _ = api.GoVppAPIPackageIsVersion2 23 24 const ( 25 APIFile = "http_static" 26 APIVersion = "2.1.0" 27 VersionCrc = 0xd29e72e9 28 ) 29 30 // Configure and enable the static http server 31 // - fifo_size - size (in bytes) of the session FIFOs 32 // - cache_size_limit - size (in bytes) of the in-memory file data cache 33 // - prealloc_fifos - number of preallocated fifos (usually 0) 34 // - private_segment_size - fifo segment size (usually 0) 35 // - www_root - html root path 36 // - uri - bind URI, defaults to "tcp://0.0.0.0/80" 37 // 38 // HTTPStaticEnable defines message 'http_static_enable'. 39 type HTTPStaticEnable struct { 40 FifoSize uint32 `binapi:"u32,name=fifo_size" json:"fifo_size,omitempty"` 41 CacheSizeLimit uint32 `binapi:"u32,name=cache_size_limit" json:"cache_size_limit,omitempty"` 42 PreallocFifos uint32 `binapi:"u32,name=prealloc_fifos" json:"prealloc_fifos,omitempty"` 43 PrivateSegmentSize uint32 `binapi:"u32,name=private_segment_size" json:"private_segment_size,omitempty"` 44 WwwRoot string `binapi:"string[256],name=www_root" json:"www_root,omitempty"` 45 URI string `binapi:"string[256],name=uri" json:"uri,omitempty"` 46 } 47 48 func (m *HTTPStaticEnable) Reset() { *m = HTTPStaticEnable{} } 49 func (*HTTPStaticEnable) GetMessageName() string { return "http_static_enable" } 50 func (*HTTPStaticEnable) GetCrcString() string { return "075f8292" } 51 func (*HTTPStaticEnable) GetMessageType() api.MessageType { 52 return api.RequestMessage 53 } 54 55 func (m *HTTPStaticEnable) Size() (size int) { 56 if m == nil { 57 return 0 58 } 59 size += 4 // m.FifoSize 60 size += 4 // m.CacheSizeLimit 61 size += 4 // m.PreallocFifos 62 size += 4 // m.PrivateSegmentSize 63 size += 256 // m.WwwRoot 64 size += 256 // m.URI 65 return size 66 } 67 func (m *HTTPStaticEnable) Marshal(b []byte) ([]byte, error) { 68 if b == nil { 69 b = make([]byte, m.Size()) 70 } 71 buf := codec.NewBuffer(b) 72 buf.EncodeUint32(m.FifoSize) 73 buf.EncodeUint32(m.CacheSizeLimit) 74 buf.EncodeUint32(m.PreallocFifos) 75 buf.EncodeUint32(m.PrivateSegmentSize) 76 buf.EncodeString(m.WwwRoot, 256) 77 buf.EncodeString(m.URI, 256) 78 return buf.Bytes(), nil 79 } 80 func (m *HTTPStaticEnable) Unmarshal(b []byte) error { 81 buf := codec.NewBuffer(b) 82 m.FifoSize = buf.DecodeUint32() 83 m.CacheSizeLimit = buf.DecodeUint32() 84 m.PreallocFifos = buf.DecodeUint32() 85 m.PrivateSegmentSize = buf.DecodeUint32() 86 m.WwwRoot = buf.DecodeString(256) 87 m.URI = buf.DecodeString(256) 88 return nil 89 } 90 91 // HTTPStaticEnableReply defines message 'http_static_enable_reply'. 92 type HTTPStaticEnableReply struct { 93 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 94 } 95 96 func (m *HTTPStaticEnableReply) Reset() { *m = HTTPStaticEnableReply{} } 97 func (*HTTPStaticEnableReply) GetMessageName() string { return "http_static_enable_reply" } 98 func (*HTTPStaticEnableReply) GetCrcString() string { return "e8d4e804" } 99 func (*HTTPStaticEnableReply) GetMessageType() api.MessageType { 100 return api.ReplyMessage 101 } 102 103 func (m *HTTPStaticEnableReply) Size() (size int) { 104 if m == nil { 105 return 0 106 } 107 size += 4 // m.Retval 108 return size 109 } 110 func (m *HTTPStaticEnableReply) Marshal(b []byte) ([]byte, error) { 111 if b == nil { 112 b = make([]byte, m.Size()) 113 } 114 buf := codec.NewBuffer(b) 115 buf.EncodeInt32(m.Retval) 116 return buf.Bytes(), nil 117 } 118 func (m *HTTPStaticEnableReply) Unmarshal(b []byte) error { 119 buf := codec.NewBuffer(b) 120 m.Retval = buf.DecodeInt32() 121 return nil 122 } 123 124 func init() { file_http_static_binapi_init() } 125 func file_http_static_binapi_init() { 126 api.RegisterMessage((*HTTPStaticEnable)(nil), "http_static_enable_075f8292") 127 api.RegisterMessage((*HTTPStaticEnableReply)(nil), "http_static_enable_reply_e8d4e804") 128 } 129 130 // Messages returns list of all messages in this module. 131 func AllMessages() []api.Message { 132 return []api.Message{ 133 (*HTTPStaticEnable)(nil), 134 (*HTTPStaticEnableReply)(nil), 135 } 136 }