Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | From f840cc0da571d98beb17855c177e9986bd096b72 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 13 Apr 2017 11:46:09 -0700 |
| 4 | Subject: [PATCH] avoid naming local function as one of printf family |
| 5 | |
| 6 | Fixes build issues with clang |
| 7 | error: no member named '__builtin___snprintf_chk' in 'struct expr_ops' |
| 8 | |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 10 | --- |
| 11 | include/expr_ops.h | 2 +- |
| 12 | include/obj.h | 2 +- |
| 13 | src/buffer.c | 2 +- |
| 14 | src/expr.c | 4 ++-- |
| 15 | src/expr/bitwise.c | 2 +- |
| 16 | src/expr/byteorder.c | 2 +- |
| 17 | src/expr/cmp.c | 2 +- |
| 18 | src/expr/counter.c | 2 +- |
| 19 | src/expr/ct.c | 2 +- |
| 20 | src/expr/dup.c | 2 +- |
| 21 | src/expr/dynset.c | 2 +- |
| 22 | src/expr/exthdr.c | 2 +- |
| 23 | src/expr/fib.c | 2 +- |
| 24 | src/expr/fwd.c | 2 +- |
| 25 | src/expr/hash.c | 2 +- |
| 26 | src/expr/immediate.c | 2 +- |
| 27 | src/expr/limit.c | 2 +- |
| 28 | src/expr/log.c | 2 +- |
| 29 | src/expr/lookup.c | 2 +- |
| 30 | src/expr/masq.c | 2 +- |
| 31 | src/expr/match.c | 2 +- |
| 32 | src/expr/meta.c | 2 +- |
| 33 | src/expr/nat.c | 2 +- |
| 34 | src/expr/numgen.c | 2 +- |
| 35 | src/expr/objref.c | 2 +- |
| 36 | src/expr/payload.c | 2 +- |
| 37 | src/expr/queue.c | 2 +- |
| 38 | src/expr/quota.c | 2 +- |
| 39 | src/expr/range.c | 2 +- |
| 40 | src/expr/redir.c | 2 +- |
| 41 | src/expr/reject.c | 2 +- |
| 42 | src/expr/rt.c | 2 +- |
| 43 | src/expr/target.c | 2 +- |
| 44 | src/obj/counter.c | 2 +- |
| 45 | src/obj/ct_helper.c | 2 +- |
| 46 | src/obj/quota.c | 2 +- |
| 47 | src/object.c | 4 ++-- |
| 48 | 37 files changed, 39 insertions(+), 39 deletions(-) |
| 49 | |
| 50 | diff --git a/include/expr_ops.h b/include/expr_ops.h |
| 51 | index e639390..c4fe050 100644 |
| 52 | --- a/include/expr_ops.h |
| 53 | +++ b/include/expr_ops.h |
| 54 | @@ -18,7 +18,7 @@ struct expr_ops { |
| 55 | const void *(*get)(const struct nftnl_expr *e, uint16_t type, uint32_t *data_len); |
| 56 | int (*parse)(struct nftnl_expr *e, struct nlattr *attr); |
| 57 | void (*build)(struct nlmsghdr *nlh, const struct nftnl_expr *e); |
| 58 | - int (*snprintf)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_expr *e); |
| 59 | + int (*snprintf_)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_expr *e); |
| 60 | int (*json_parse)(struct nftnl_expr *e, json_t *data, |
| 61 | struct nftnl_parse_err *err); |
| 62 | }; |
| 63 | diff --git a/include/obj.h b/include/obj.h |
| 64 | index d90919f..772caff 100644 |
| 65 | --- a/include/obj.h |
| 66 | +++ b/include/obj.h |
| 67 | @@ -47,7 +47,7 @@ struct obj_ops { |
| 68 | const void *(*get)(const struct nftnl_obj *e, uint16_t type, uint32_t *data_len); |
| 69 | int (*parse)(struct nftnl_obj *e, struct nlattr *attr); |
| 70 | void (*build)(struct nlmsghdr *nlh, const struct nftnl_obj *e); |
| 71 | - int (*snprintf)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_obj *e); |
| 72 | + int (*snprintf_)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_obj *e); |
| 73 | int (*json_parse)(struct nftnl_obj *e, json_t *data, |
| 74 | struct nftnl_parse_err *err); |
| 75 | }; |
| 76 | diff --git a/src/buffer.c b/src/buffer.c |
| 77 | index f9d5a83..db656e2 100644 |
| 78 | --- a/src/buffer.c |
| 79 | +++ b/src/buffer.c |
| 80 | @@ -206,7 +206,7 @@ int nftnl_buf_expr(struct nftnl_buf *b, int type, uint32_t flags, |
| 81 | case NFTNL_OUTPUT_JSON: |
| 82 | nftnl_buf_put(b, "{"); |
| 83 | nftnl_buf_str(b, type, expr->ops->name, TYPE); |
| 84 | - ret = expr->ops->snprintf(b->buf + b->off, b->len, type, flags, |
| 85 | + ret = expr->ops->snprintf_(b->buf + b->off, b->len, type, flags, |
| 86 | expr); |
| 87 | if (ret > 0) |
| 88 | nftnl_buf_update(b, ret); |
| 89 | diff --git a/src/expr.c b/src/expr.c |
| 90 | index c7eb2b4..24f8f8c 100644 |
| 91 | --- a/src/expr.c |
| 92 | +++ b/src/expr.c |
| 93 | @@ -265,10 +265,10 @@ int __EXPORTED nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_ex |
| 94 | int ret; |
| 95 | unsigned int offset = 0, len = size; |
| 96 | |
| 97 | - if (!expr->ops->snprintf) |
| 98 | + if (!expr->ops->snprintf_) |
| 99 | return 0; |
| 100 | |
| 101 | - ret = expr->ops->snprintf(buf+offset, len, type, flags, expr); |
| 102 | + ret = expr->ops->snprintf_(buf+offset, len, type, flags, expr); |
| 103 | SNPRINTF_BUFFER_SIZE(ret, size, len, offset); |
| 104 | |
| 105 | return offset; |
| 106 | diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c |
| 107 | index 0febc9d..9b48e79 100644 |
| 108 | --- a/src/expr/bitwise.c |
| 109 | +++ b/src/expr/bitwise.c |
| 110 | @@ -299,6 +299,6 @@ struct expr_ops expr_ops_bitwise = { |
| 111 | .get = nftnl_expr_bitwise_get, |
| 112 | .parse = nftnl_expr_bitwise_parse, |
| 113 | .build = nftnl_expr_bitwise_build, |
| 114 | - .snprintf = nftnl_expr_bitwise_snprintf, |
| 115 | + .snprintf_ = nftnl_expr_bitwise_snprintf, |
| 116 | .json_parse = nftnl_expr_bitwise_json_parse, |
| 117 | }; |
| 118 | diff --git a/src/expr/byteorder.c b/src/expr/byteorder.c |
| 119 | index 3805307..079582f 100644 |
| 120 | --- a/src/expr/byteorder.c |
| 121 | +++ b/src/expr/byteorder.c |
| 122 | @@ -314,6 +314,6 @@ struct expr_ops expr_ops_byteorder = { |
| 123 | .get = nftnl_expr_byteorder_get, |
| 124 | .parse = nftnl_expr_byteorder_parse, |
| 125 | .build = nftnl_expr_byteorder_build, |
| 126 | - .snprintf = nftnl_expr_byteorder_snprintf, |
| 127 | + .snprintf_ = nftnl_expr_byteorder_snprintf, |
| 128 | .json_parse = nftnl_expr_byteorder_json_parse, |
| 129 | }; |
| 130 | diff --git a/src/expr/cmp.c b/src/expr/cmp.c |
| 131 | index 353e907..99b497c 100644 |
| 132 | --- a/src/expr/cmp.c |
| 133 | +++ b/src/expr/cmp.c |
| 134 | @@ -284,6 +284,6 @@ struct expr_ops expr_ops_cmp = { |
| 135 | .get = nftnl_expr_cmp_get, |
| 136 | .parse = nftnl_expr_cmp_parse, |
| 137 | .build = nftnl_expr_cmp_build, |
| 138 | - .snprintf = nftnl_expr_cmp_snprintf, |
| 139 | + .snprintf_ = nftnl_expr_cmp_snprintf, |
| 140 | .json_parse = nftnl_expr_cmp_json_parse, |
| 141 | }; |
| 142 | diff --git a/src/expr/counter.c b/src/expr/counter.c |
| 143 | index 21901e8..9fd7655 100644 |
| 144 | --- a/src/expr/counter.c |
| 145 | +++ b/src/expr/counter.c |
| 146 | @@ -200,6 +200,6 @@ struct expr_ops expr_ops_counter = { |
| 147 | .get = nftnl_expr_counter_get, |
| 148 | .parse = nftnl_expr_counter_parse, |
| 149 | .build = nftnl_expr_counter_build, |
| 150 | - .snprintf = nftnl_expr_counter_snprintf, |
| 151 | + .snprintf_ = nftnl_expr_counter_snprintf, |
| 152 | .json_parse = nftnl_expr_counter_json_parse, |
| 153 | }; |
| 154 | diff --git a/src/expr/ct.c b/src/expr/ct.c |
| 155 | index cdd08e9..6ce5478 100644 |
| 156 | --- a/src/expr/ct.c |
| 157 | +++ b/src/expr/ct.c |
| 158 | @@ -356,6 +356,6 @@ struct expr_ops expr_ops_ct = { |
| 159 | .get = nftnl_expr_ct_get, |
| 160 | .parse = nftnl_expr_ct_parse, |
| 161 | .build = nftnl_expr_ct_build, |
| 162 | - .snprintf = nftnl_expr_ct_snprintf, |
| 163 | + .snprintf_ = nftnl_expr_ct_snprintf, |
| 164 | .json_parse = nftnl_expr_ct_json_parse, |
| 165 | }; |
| 166 | diff --git a/src/expr/dup.c b/src/expr/dup.c |
| 167 | index 9aa332b..2f491d8 100644 |
| 168 | --- a/src/expr/dup.c |
| 169 | +++ b/src/expr/dup.c |
| 170 | @@ -206,6 +206,6 @@ struct expr_ops expr_ops_dup = { |
| 171 | .get = nftnl_expr_dup_get, |
| 172 | .parse = nftnl_expr_dup_parse, |
| 173 | .build = nftnl_expr_dup_build, |
| 174 | - .snprintf = nftnl_expr_dup_snprintf, |
| 175 | + .snprintf_ = nftnl_expr_dup_snprintf, |
| 176 | .json_parse = nftnl_expr_dup_json_parse, |
| 177 | }; |
| 178 | diff --git a/src/expr/dynset.c b/src/expr/dynset.c |
| 179 | index f7b99ea..758f07c 100644 |
| 180 | --- a/src/expr/dynset.c |
| 181 | +++ b/src/expr/dynset.c |
| 182 | @@ -368,6 +368,6 @@ struct expr_ops expr_ops_dynset = { |
| 183 | .get = nftnl_expr_dynset_get, |
| 184 | .parse = nftnl_expr_dynset_parse, |
| 185 | .build = nftnl_expr_dynset_build, |
| 186 | - .snprintf = nftnl_expr_dynset_snprintf, |
| 187 | + .snprintf_ = nftnl_expr_dynset_snprintf, |
| 188 | .json_parse = nftnl_expr_dynset_json_parse, |
| 189 | }; |
| 190 | diff --git a/src/expr/exthdr.c b/src/expr/exthdr.c |
| 191 | index d4f1665..a834782 100644 |
| 192 | --- a/src/expr/exthdr.c |
| 193 | +++ b/src/expr/exthdr.c |
| 194 | @@ -356,6 +356,6 @@ struct expr_ops expr_ops_exthdr = { |
| 195 | .get = nftnl_expr_exthdr_get, |
| 196 | .parse = nftnl_expr_exthdr_parse, |
| 197 | .build = nftnl_expr_exthdr_build, |
| 198 | - .snprintf = nftnl_expr_exthdr_snprintf, |
| 199 | + .snprintf_ = nftnl_expr_exthdr_snprintf, |
| 200 | .json_parse = nftnl_expr_exthdr_json_parse, |
| 201 | }; |
| 202 | diff --git a/src/expr/fib.c b/src/expr/fib.c |
| 203 | index f3be081..3c353b2 100644 |
| 204 | --- a/src/expr/fib.c |
| 205 | +++ b/src/expr/fib.c |
| 206 | @@ -272,6 +272,6 @@ struct expr_ops expr_ops_fib = { |
| 207 | .get = nftnl_expr_fib_get, |
| 208 | .parse = nftnl_expr_fib_parse, |
| 209 | .build = nftnl_expr_fib_build, |
| 210 | - .snprintf = nftnl_expr_fib_snprintf, |
| 211 | + .snprintf_ = nftnl_expr_fib_snprintf, |
| 212 | .json_parse = nftnl_expr_fib_json_parse, |
| 213 | }; |
| 214 | diff --git a/src/expr/fwd.c b/src/expr/fwd.c |
| 215 | index c30d494..f6e41f1 100644 |
| 216 | --- a/src/expr/fwd.c |
| 217 | +++ b/src/expr/fwd.c |
| 218 | @@ -180,6 +180,6 @@ struct expr_ops expr_ops_fwd = { |
| 219 | .get = nftnl_expr_fwd_get, |
| 220 | .parse = nftnl_expr_fwd_parse, |
| 221 | .build = nftnl_expr_fwd_build, |
| 222 | - .snprintf = nftnl_expr_fwd_snprintf, |
| 223 | + .snprintf_ = nftnl_expr_fwd_snprintf, |
| 224 | .json_parse = nftnl_expr_fwd_json_parse, |
| 225 | }; |
| 226 | diff --git a/src/expr/hash.c b/src/expr/hash.c |
| 227 | index d870510..5acb66a 100644 |
| 228 | --- a/src/expr/hash.c |
| 229 | +++ b/src/expr/hash.c |
| 230 | @@ -332,6 +332,6 @@ struct expr_ops expr_ops_hash = { |
| 231 | .get = nftnl_expr_hash_get, |
| 232 | .parse = nftnl_expr_hash_parse, |
| 233 | .build = nftnl_expr_hash_build, |
| 234 | - .snprintf = nftnl_expr_hash_snprintf, |
| 235 | + .snprintf_ = nftnl_expr_hash_snprintf, |
| 236 | .json_parse = nftnl_expr_hash_json_parse, |
| 237 | }; |
| 238 | diff --git a/src/expr/immediate.c b/src/expr/immediate.c |
| 239 | index 0b188cc..94bd6da 100644 |
| 240 | --- a/src/expr/immediate.c |
| 241 | +++ b/src/expr/immediate.c |
| 242 | @@ -316,6 +316,6 @@ struct expr_ops expr_ops_immediate = { |
| 243 | .get = nftnl_expr_immediate_get, |
| 244 | .parse = nftnl_expr_immediate_parse, |
| 245 | .build = nftnl_expr_immediate_build, |
| 246 | - .snprintf = nftnl_expr_immediate_snprintf, |
| 247 | + .snprintf_ = nftnl_expr_immediate_snprintf, |
| 248 | .json_parse = nftnl_expr_immediate_json_parse, |
| 249 | }; |
| 250 | diff --git a/src/expr/limit.c b/src/expr/limit.c |
| 251 | index 856ab18..e71fc2f 100644 |
| 252 | --- a/src/expr/limit.c |
| 253 | +++ b/src/expr/limit.c |
| 254 | @@ -285,6 +285,6 @@ struct expr_ops expr_ops_limit = { |
| 255 | .get = nftnl_expr_limit_get, |
| 256 | .parse = nftnl_expr_limit_parse, |
| 257 | .build = nftnl_expr_limit_build, |
| 258 | - .snprintf = nftnl_expr_limit_snprintf, |
| 259 | + .snprintf_ = nftnl_expr_limit_snprintf, |
| 260 | .json_parse = nftnl_expr_limit_json_parse, |
| 261 | }; |
| 262 | diff --git a/src/expr/log.c b/src/expr/log.c |
| 263 | index b642255..71dd83a 100644 |
| 264 | --- a/src/expr/log.c |
| 265 | +++ b/src/expr/log.c |
| 266 | @@ -352,6 +352,6 @@ struct expr_ops expr_ops_log = { |
| 267 | .get = nftnl_expr_log_get, |
| 268 | .parse = nftnl_expr_log_parse, |
| 269 | .build = nftnl_expr_log_build, |
| 270 | - .snprintf = nftnl_expr_log_snprintf, |
| 271 | + .snprintf_ = nftnl_expr_log_snprintf, |
| 272 | .json_parse = nftnl_expr_log_json_parse, |
| 273 | }; |
| 274 | diff --git a/src/expr/lookup.c b/src/expr/lookup.c |
| 275 | index 861815f..6049913 100644 |
| 276 | --- a/src/expr/lookup.c |
| 277 | +++ b/src/expr/lookup.c |
| 278 | @@ -293,6 +293,6 @@ struct expr_ops expr_ops_lookup = { |
| 279 | .get = nftnl_expr_lookup_get, |
| 280 | .parse = nftnl_expr_lookup_parse, |
| 281 | .build = nftnl_expr_lookup_build, |
| 282 | - .snprintf = nftnl_expr_lookup_snprintf, |
| 283 | + .snprintf_ = nftnl_expr_lookup_snprintf, |
| 284 | .json_parse = nftnl_expr_lookup_json_parse, |
| 285 | }; |
| 286 | diff --git a/src/expr/masq.c b/src/expr/masq.c |
| 287 | index 7c235d3..adec325 100644 |
| 288 | --- a/src/expr/masq.c |
| 289 | +++ b/src/expr/masq.c |
| 290 | @@ -228,6 +228,6 @@ struct expr_ops expr_ops_masq = { |
| 291 | .get = nftnl_expr_masq_get, |
| 292 | .parse = nftnl_expr_masq_parse, |
| 293 | .build = nftnl_expr_masq_build, |
| 294 | - .snprintf = nftnl_expr_masq_snprintf, |
| 295 | + .snprintf_ = nftnl_expr_masq_snprintf, |
| 296 | .json_parse = nftnl_expr_masq_json_parse, |
| 297 | }; |
| 298 | diff --git a/src/expr/match.c b/src/expr/match.c |
| 299 | index dd09e1e..f0d8868 100644 |
| 300 | --- a/src/expr/match.c |
| 301 | +++ b/src/expr/match.c |
| 302 | @@ -249,6 +249,6 @@ struct expr_ops expr_ops_match = { |
| 303 | .get = nftnl_expr_match_get, |
| 304 | .parse = nftnl_expr_match_parse, |
| 305 | .build = nftnl_expr_match_build, |
| 306 | - .snprintf = nftnl_expr_match_snprintf, |
| 307 | + .snprintf_ = nftnl_expr_match_snprintf, |
| 308 | .json_parse = nftnl_expr_match_json_parse, |
| 309 | }; |
| 310 | diff --git a/src/expr/meta.c b/src/expr/meta.c |
| 311 | index 2c75841..907a677 100644 |
| 312 | --- a/src/expr/meta.c |
| 313 | +++ b/src/expr/meta.c |
| 314 | @@ -290,6 +290,6 @@ struct expr_ops expr_ops_meta = { |
| 315 | .get = nftnl_expr_meta_get, |
| 316 | .parse = nftnl_expr_meta_parse, |
| 317 | .build = nftnl_expr_meta_build, |
| 318 | - .snprintf = nftnl_expr_meta_snprintf, |
| 319 | + .snprintf_ = nftnl_expr_meta_snprintf, |
| 320 | .json_parse = nftnl_expr_meta_json_parse, |
| 321 | }; |
| 322 | diff --git a/src/expr/nat.c b/src/expr/nat.c |
| 323 | index 29bc3a2..d476283 100644 |
| 324 | --- a/src/expr/nat.c |
| 325 | +++ b/src/expr/nat.c |
| 326 | @@ -383,6 +383,6 @@ struct expr_ops expr_ops_nat = { |
| 327 | .get = nftnl_expr_nat_get, |
| 328 | .parse = nftnl_expr_nat_parse, |
| 329 | .build = nftnl_expr_nat_build, |
| 330 | - .snprintf = nftnl_expr_nat_snprintf, |
| 331 | + .snprintf_ = nftnl_expr_nat_snprintf, |
| 332 | .json_parse = nftnl_expr_nat_json_parse, |
| 333 | }; |
| 334 | diff --git a/src/expr/numgen.c b/src/expr/numgen.c |
| 335 | index a15f03a..28ef741 100644 |
| 336 | --- a/src/expr/numgen.c |
| 337 | +++ b/src/expr/numgen.c |
| 338 | @@ -264,6 +264,6 @@ struct expr_ops expr_ops_ng = { |
| 339 | .get = nftnl_expr_ng_get, |
| 340 | .parse = nftnl_expr_ng_parse, |
| 341 | .build = nftnl_expr_ng_build, |
| 342 | - .snprintf = nftnl_expr_ng_snprintf, |
| 343 | + .snprintf_ = nftnl_expr_ng_snprintf, |
| 344 | .json_parse = nftnl_expr_ng_json_parse, |
| 345 | }; |
| 346 | diff --git a/src/expr/objref.c b/src/expr/objref.c |
| 347 | index 4cfa3cb..c394290 100644 |
| 348 | --- a/src/expr/objref.c |
| 349 | +++ b/src/expr/objref.c |
| 350 | @@ -278,6 +278,6 @@ struct expr_ops expr_ops_objref = { |
| 351 | .get = nftnl_expr_objref_get, |
| 352 | .parse = nftnl_expr_objref_parse, |
| 353 | .build = nftnl_expr_objref_build, |
| 354 | - .snprintf = nftnl_expr_objref_snprintf, |
| 355 | + .snprintf_ = nftnl_expr_objref_snprintf, |
| 356 | .json_parse = nftnl_expr_objref_json_parse, |
| 357 | }; |
| 358 | diff --git a/src/expr/payload.c b/src/expr/payload.c |
| 359 | index 91e1587..894ac08 100644 |
| 360 | --- a/src/expr/payload.c |
| 361 | +++ b/src/expr/payload.c |
| 362 | @@ -348,6 +348,6 @@ struct expr_ops expr_ops_payload = { |
| 363 | .get = nftnl_expr_payload_get, |
| 364 | .parse = nftnl_expr_payload_parse, |
| 365 | .build = nftnl_expr_payload_build, |
| 366 | - .snprintf = nftnl_expr_payload_snprintf, |
| 367 | + .snprintf_ = nftnl_expr_payload_snprintf, |
| 368 | .json_parse = nftnl_expr_payload_json_parse, |
| 369 | }; |
| 370 | diff --git a/src/expr/queue.c b/src/expr/queue.c |
| 371 | index 8a9deda..389af83 100644 |
| 372 | --- a/src/expr/queue.c |
| 373 | +++ b/src/expr/queue.c |
| 374 | @@ -276,6 +276,6 @@ struct expr_ops expr_ops_queue = { |
| 375 | .get = nftnl_expr_queue_get, |
| 376 | .parse = nftnl_expr_queue_parse, |
| 377 | .build = nftnl_expr_queue_build, |
| 378 | - .snprintf = nftnl_expr_queue_snprintf, |
| 379 | + .snprintf_ = nftnl_expr_queue_snprintf, |
| 380 | .json_parse = nftnl_expr_queue_json_parse, |
| 381 | }; |
| 382 | diff --git a/src/expr/quota.c b/src/expr/quota.c |
| 383 | index 667e6e1..ff5d182 100644 |
| 384 | --- a/src/expr/quota.c |
| 385 | +++ b/src/expr/quota.c |
| 386 | @@ -203,6 +203,6 @@ struct expr_ops expr_ops_quota = { |
| 387 | .get = nftnl_expr_quota_get, |
| 388 | .parse = nftnl_expr_quota_parse, |
| 389 | .build = nftnl_expr_quota_build, |
| 390 | - .snprintf = nftnl_expr_quota_snprintf, |
| 391 | + .snprintf_ = nftnl_expr_quota_snprintf, |
| 392 | .json_parse = nftnl_expr_quota_json_parse, |
| 393 | }; |
| 394 | diff --git a/src/expr/range.c b/src/expr/range.c |
| 395 | index 8c8ce12..34d422b 100644 |
| 396 | --- a/src/expr/range.c |
| 397 | +++ b/src/expr/range.c |
| 398 | @@ -283,6 +283,6 @@ struct expr_ops expr_ops_range = { |
| 399 | .get = nftnl_expr_range_get, |
| 400 | .parse = nftnl_expr_range_parse, |
| 401 | .build = nftnl_expr_range_build, |
| 402 | - .snprintf = nftnl_expr_range_snprintf, |
| 403 | + .snprintf_ = nftnl_expr_range_snprintf, |
| 404 | .json_parse = nftnl_expr_range_json_parse, |
| 405 | }; |
| 406 | diff --git a/src/expr/redir.c b/src/expr/redir.c |
| 407 | index 43538d5..8a21f93 100644 |
| 408 | --- a/src/expr/redir.c |
| 409 | +++ b/src/expr/redir.c |
| 410 | @@ -242,6 +242,6 @@ struct expr_ops expr_ops_redir = { |
| 411 | .get = nftnl_expr_redir_get, |
| 412 | .parse = nftnl_expr_redir_parse, |
| 413 | .build = nftnl_expr_redir_build, |
| 414 | - .snprintf = nftnl_expr_redir_snprintf, |
| 415 | + .snprintf_ = nftnl_expr_redir_snprintf, |
| 416 | .json_parse = nftnl_expr_redir_json_parse, |
| 417 | }; |
| 418 | diff --git a/src/expr/reject.c b/src/expr/reject.c |
| 419 | index 11d8b20..b10e729 100644 |
| 420 | --- a/src/expr/reject.c |
| 421 | +++ b/src/expr/reject.c |
| 422 | @@ -200,6 +200,6 @@ struct expr_ops expr_ops_reject = { |
| 423 | .get = nftnl_expr_reject_get, |
| 424 | .parse = nftnl_expr_reject_parse, |
| 425 | .build = nftnl_expr_reject_build, |
| 426 | - .snprintf = nftnl_expr_reject_snprintf, |
| 427 | + .snprintf_ = nftnl_expr_reject_snprintf, |
| 428 | .json_parse = nftnl_expr_reject_json_parse, |
| 429 | }; |
| 430 | diff --git a/src/expr/rt.c b/src/expr/rt.c |
| 431 | index 5088e66..9f44b29 100644 |
| 432 | --- a/src/expr/rt.c |
| 433 | +++ b/src/expr/rt.c |
| 434 | @@ -238,6 +238,6 @@ struct expr_ops expr_ops_rt = { |
| 435 | .get = nftnl_expr_rt_get, |
| 436 | .parse = nftnl_expr_rt_parse, |
| 437 | .build = nftnl_expr_rt_build, |
| 438 | - .snprintf = nftnl_expr_rt_snprintf, |
| 439 | + .snprintf_ = nftnl_expr_rt_snprintf, |
| 440 | .json_parse = nftnl_expr_rt_json_parse, |
| 441 | }; |
| 442 | diff --git a/src/expr/target.c b/src/expr/target.c |
| 443 | index ed4bf7d..2ef4078 100644 |
| 444 | --- a/src/expr/target.c |
| 445 | +++ b/src/expr/target.c |
| 446 | @@ -249,6 +249,6 @@ struct expr_ops expr_ops_target = { |
| 447 | .get = nftnl_expr_target_get, |
| 448 | .parse = nftnl_expr_target_parse, |
| 449 | .build = nftnl_expr_target_build, |
| 450 | - .snprintf = nftnl_expr_target_snprintf, |
| 451 | + .snprintf_ = nftnl_expr_target_snprintf, |
| 452 | .json_parse = nftnl_expr_target_json_parse, |
| 453 | }; |
| 454 | diff --git a/src/obj/counter.c b/src/obj/counter.c |
| 455 | index beadc93..8c4cc25 100644 |
| 456 | --- a/src/obj/counter.c |
| 457 | +++ b/src/obj/counter.c |
| 458 | @@ -179,6 +179,6 @@ struct obj_ops obj_ops_counter = { |
| 459 | .get = nftnl_obj_counter_get, |
| 460 | .parse = nftnl_obj_counter_parse, |
| 461 | .build = nftnl_obj_counter_build, |
| 462 | - .snprintf = nftnl_obj_counter_snprintf, |
| 463 | + .snprintf_ = nftnl_obj_counter_snprintf, |
| 464 | .json_parse = nftnl_obj_counter_json_parse, |
| 465 | }; |
| 466 | diff --git a/src/obj/ct_helper.c b/src/obj/ct_helper.c |
| 467 | index d6d3111..4c7c88b 100644 |
| 468 | --- a/src/obj/ct_helper.c |
| 469 | +++ b/src/obj/ct_helper.c |
| 470 | @@ -205,6 +205,6 @@ struct obj_ops obj_ops_ct_helper = { |
| 471 | .get = nftnl_obj_ct_helper_get, |
| 472 | .parse = nftnl_obj_ct_helper_parse, |
| 473 | .build = nftnl_obj_ct_helper_build, |
| 474 | - .snprintf = nftnl_obj_ct_helper_snprintf, |
| 475 | + .snprintf_ = nftnl_obj_ct_helper_snprintf, |
| 476 | .json_parse = nftnl_obj_quota_json_parse, |
| 477 | }; |
| 478 | diff --git a/src/obj/quota.c b/src/obj/quota.c |
| 479 | index d5757b2..e959ff8 100644 |
| 480 | --- a/src/obj/quota.c |
| 481 | +++ b/src/obj/quota.c |
| 482 | @@ -200,6 +200,6 @@ struct obj_ops obj_ops_quota = { |
| 483 | .get = nftnl_obj_quota_get, |
| 484 | .parse = nftnl_obj_quota_parse, |
| 485 | .build = nftnl_obj_quota_build, |
| 486 | - .snprintf = nftnl_obj_quota_snprintf, |
| 487 | + .snprintf_ = nftnl_obj_quota_snprintf, |
| 488 | .json_parse = nftnl_obj_quota_json_parse, |
| 489 | }; |
| 490 | diff --git a/src/object.c b/src/object.c |
| 491 | index d409c6d..b938c97 100644 |
| 492 | --- a/src/object.c |
| 493 | +++ b/src/object.c |
| 494 | @@ -389,7 +389,7 @@ static int nftnl_obj_export(char *buf, size_t size, |
| 495 | nftnl_buf_u32(&b, type, obj->use, USE); |
| 496 | |
| 497 | if (obj->ops) |
| 498 | - ret = obj->ops->snprintf(buf + b.len, size - b.len, type, |
| 499 | + ret = obj->ops->snprintf_(buf + b.len, size - b.len, type, |
| 500 | flags, obj); |
| 501 | |
| 502 | b.len += ret; |
| 503 | @@ -410,7 +410,7 @@ static int nftnl_obj_snprintf_dflt(char *buf, size_t size, |
| 504 | SNPRINTF_BUFFER_SIZE(ret, size, len, offset); |
| 505 | |
| 506 | if (obj->ops) { |
| 507 | - ret = obj->ops->snprintf(buf + offset, offset, type, flags, obj); |
| 508 | + ret = obj->ops->snprintf_(buf + offset, offset, type, flags, obj); |
| 509 | SNPRINTF_BUFFER_SIZE(ret, size, len, offset); |
| 510 | } |
| 511 | ret = snprintf(buf + offset, offset, "]"); |
| 512 | -- |
| 513 | 2.12.2 |
| 514 | |