|
| 1 | +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ |
| 2 | +/* Generated from: api/filter/ratelimit.proto */ |
| 3 | + |
| 4 | +/* Do not generate deprecated warnings for self */ |
| 5 | +#ifndef PROTOBUF_C__NO_DEPRECATED |
| 6 | +#define PROTOBUF_C__NO_DEPRECATED |
| 7 | +#endif |
| 8 | + |
| 9 | +#include "filter/ratelimit.pb-c.h" |
| 10 | +void filter__token_bucket__init |
| 11 | + (Filter__TokenBucket *message) |
| 12 | +{ |
| 13 | + static const Filter__TokenBucket init_value = FILTER__TOKEN_BUCKET__INIT; |
| 14 | + *message = init_value; |
| 15 | +} |
| 16 | +size_t filter__token_bucket__get_packed_size |
| 17 | + (const Filter__TokenBucket *message) |
| 18 | +{ |
| 19 | + assert(message->base.descriptor == &filter__token_bucket__descriptor); |
| 20 | + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); |
| 21 | +} |
| 22 | +size_t filter__token_bucket__pack |
| 23 | + (const Filter__TokenBucket *message, |
| 24 | + uint8_t *out) |
| 25 | +{ |
| 26 | + assert(message->base.descriptor == &filter__token_bucket__descriptor); |
| 27 | + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); |
| 28 | +} |
| 29 | +size_t filter__token_bucket__pack_to_buffer |
| 30 | + (const Filter__TokenBucket *message, |
| 31 | + ProtobufCBuffer *buffer) |
| 32 | +{ |
| 33 | + assert(message->base.descriptor == &filter__token_bucket__descriptor); |
| 34 | + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); |
| 35 | +} |
| 36 | +Filter__TokenBucket * |
| 37 | + filter__token_bucket__unpack |
| 38 | + (ProtobufCAllocator *allocator, |
| 39 | + size_t len, |
| 40 | + const uint8_t *data) |
| 41 | +{ |
| 42 | + return (Filter__TokenBucket *) |
| 43 | + protobuf_c_message_unpack (&filter__token_bucket__descriptor, |
| 44 | + allocator, len, data); |
| 45 | +} |
| 46 | +void filter__token_bucket__free_unpacked |
| 47 | + (Filter__TokenBucket *message, |
| 48 | + ProtobufCAllocator *allocator) |
| 49 | +{ |
| 50 | + if(!message) |
| 51 | + return; |
| 52 | + assert(message->base.descriptor == &filter__token_bucket__descriptor); |
| 53 | + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); |
| 54 | +} |
| 55 | +void filter__local_rate_limit__init |
| 56 | + (Filter__LocalRateLimit *message) |
| 57 | +{ |
| 58 | + static const Filter__LocalRateLimit init_value = FILTER__LOCAL_RATE_LIMIT__INIT; |
| 59 | + *message = init_value; |
| 60 | +} |
| 61 | +size_t filter__local_rate_limit__get_packed_size |
| 62 | + (const Filter__LocalRateLimit *message) |
| 63 | +{ |
| 64 | + assert(message->base.descriptor == &filter__local_rate_limit__descriptor); |
| 65 | + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); |
| 66 | +} |
| 67 | +size_t filter__local_rate_limit__pack |
| 68 | + (const Filter__LocalRateLimit *message, |
| 69 | + uint8_t *out) |
| 70 | +{ |
| 71 | + assert(message->base.descriptor == &filter__local_rate_limit__descriptor); |
| 72 | + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); |
| 73 | +} |
| 74 | +size_t filter__local_rate_limit__pack_to_buffer |
| 75 | + (const Filter__LocalRateLimit *message, |
| 76 | + ProtobufCBuffer *buffer) |
| 77 | +{ |
| 78 | + assert(message->base.descriptor == &filter__local_rate_limit__descriptor); |
| 79 | + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); |
| 80 | +} |
| 81 | +Filter__LocalRateLimit * |
| 82 | + filter__local_rate_limit__unpack |
| 83 | + (ProtobufCAllocator *allocator, |
| 84 | + size_t len, |
| 85 | + const uint8_t *data) |
| 86 | +{ |
| 87 | + return (Filter__LocalRateLimit *) |
| 88 | + protobuf_c_message_unpack (&filter__local_rate_limit__descriptor, |
| 89 | + allocator, len, data); |
| 90 | +} |
| 91 | +void filter__local_rate_limit__free_unpacked |
| 92 | + (Filter__LocalRateLimit *message, |
| 93 | + ProtobufCAllocator *allocator) |
| 94 | +{ |
| 95 | + if(!message) |
| 96 | + return; |
| 97 | + assert(message->base.descriptor == &filter__local_rate_limit__descriptor); |
| 98 | + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); |
| 99 | +} |
| 100 | +static const ProtobufCFieldDescriptor filter__token_bucket__field_descriptors[3] = |
| 101 | +{ |
| 102 | + { |
| 103 | + "max_tokens", |
| 104 | + 1, |
| 105 | + PROTOBUF_C_LABEL_NONE, |
| 106 | + PROTOBUF_C_TYPE_INT64, |
| 107 | + 0, /* quantifier_offset */ |
| 108 | + offsetof(Filter__TokenBucket, max_tokens), |
| 109 | + NULL, |
| 110 | + NULL, |
| 111 | + 0, /* flags */ |
| 112 | + 0,NULL,NULL /* reserved1,reserved2, etc */ |
| 113 | + }, |
| 114 | + { |
| 115 | + "tokens_per_fill", |
| 116 | + 2, |
| 117 | + PROTOBUF_C_LABEL_NONE, |
| 118 | + PROTOBUF_C_TYPE_INT64, |
| 119 | + 0, /* quantifier_offset */ |
| 120 | + offsetof(Filter__TokenBucket, tokens_per_fill), |
| 121 | + NULL, |
| 122 | + NULL, |
| 123 | + 0, /* flags */ |
| 124 | + 0,NULL,NULL /* reserved1,reserved2, etc */ |
| 125 | + }, |
| 126 | + { |
| 127 | + "fill_interval", |
| 128 | + 3, |
| 129 | + PROTOBUF_C_LABEL_NONE, |
| 130 | + PROTOBUF_C_TYPE_INT64, |
| 131 | + 0, /* quantifier_offset */ |
| 132 | + offsetof(Filter__TokenBucket, fill_interval), |
| 133 | + NULL, |
| 134 | + NULL, |
| 135 | + 0, /* flags */ |
| 136 | + 0,NULL,NULL /* reserved1,reserved2, etc */ |
| 137 | + }, |
| 138 | +}; |
| 139 | +static const unsigned filter__token_bucket__field_indices_by_name[] = { |
| 140 | + 2, /* field[2] = fill_interval */ |
| 141 | + 0, /* field[0] = max_tokens */ |
| 142 | + 1, /* field[1] = tokens_per_fill */ |
| 143 | +}; |
| 144 | +static const ProtobufCIntRange filter__token_bucket__number_ranges[1 + 1] = |
| 145 | +{ |
| 146 | + { 1, 0 }, |
| 147 | + { 0, 3 } |
| 148 | +}; |
| 149 | +const ProtobufCMessageDescriptor filter__token_bucket__descriptor = |
| 150 | +{ |
| 151 | + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, |
| 152 | + "filter.TokenBucket", |
| 153 | + "TokenBucket", |
| 154 | + "Filter__TokenBucket", |
| 155 | + "filter", |
| 156 | + sizeof(Filter__TokenBucket), |
| 157 | + 3, |
| 158 | + filter__token_bucket__field_descriptors, |
| 159 | + filter__token_bucket__field_indices_by_name, |
| 160 | + 1, filter__token_bucket__number_ranges, |
| 161 | + (ProtobufCMessageInit) filter__token_bucket__init, |
| 162 | + NULL,NULL,NULL /* reserved[123] */ |
| 163 | +}; |
| 164 | +static const ProtobufCFieldDescriptor filter__local_rate_limit__field_descriptors[1] = |
| 165 | +{ |
| 166 | + { |
| 167 | + "token_bucket", |
| 168 | + 1, |
| 169 | + PROTOBUF_C_LABEL_NONE, |
| 170 | + PROTOBUF_C_TYPE_MESSAGE, |
| 171 | + 0, /* quantifier_offset */ |
| 172 | + offsetof(Filter__LocalRateLimit, token_bucket), |
| 173 | + &filter__token_bucket__descriptor, |
| 174 | + NULL, |
| 175 | + 0, /* flags */ |
| 176 | + 0,NULL,NULL /* reserved1,reserved2, etc */ |
| 177 | + }, |
| 178 | +}; |
| 179 | +static const unsigned filter__local_rate_limit__field_indices_by_name[] = { |
| 180 | + 0, /* field[0] = token_bucket */ |
| 181 | +}; |
| 182 | +static const ProtobufCIntRange filter__local_rate_limit__number_ranges[1 + 1] = |
| 183 | +{ |
| 184 | + { 1, 0 }, |
| 185 | + { 0, 1 } |
| 186 | +}; |
| 187 | +const ProtobufCMessageDescriptor filter__local_rate_limit__descriptor = |
| 188 | +{ |
| 189 | + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, |
| 190 | + "filter.LocalRateLimit", |
| 191 | + "LocalRateLimit", |
| 192 | + "Filter__LocalRateLimit", |
| 193 | + "filter", |
| 194 | + sizeof(Filter__LocalRateLimit), |
| 195 | + 1, |
| 196 | + filter__local_rate_limit__field_descriptors, |
| 197 | + filter__local_rate_limit__field_indices_by_name, |
| 198 | + 1, filter__local_rate_limit__number_ranges, |
| 199 | + (ProtobufCMessageInit) filter__local_rate_limit__init, |
| 200 | + NULL,NULL,NULL /* reserved[123] */ |
| 201 | +}; |
0 commit comments