Parse port and update context. */
| 11239 | |
| 11240 | /** Parse port and update context. */ |
| 11241 | static int |
| 11242 | parse_port(struct context *ctx, const struct token *token, |
| 11243 | const char *str, unsigned int len, |
| 11244 | void *buf, unsigned int size) |
| 11245 | { |
| 11246 | struct buffer *out = &(struct buffer){ .port = 0 }; |
| 11247 | int ret; |
| 11248 | |
| 11249 | if (buf) |
| 11250 | out = buf; |
| 11251 | else { |
| 11252 | ctx->objdata = 0; |
| 11253 | ctx->object = out; |
| 11254 | ctx->objmask = NULL; |
| 11255 | size = sizeof(*out); |
| 11256 | } |
| 11257 | ret = parse_int(ctx, token, str, len, out, size); |
| 11258 | if (ret >= 0) |
| 11259 | ctx->port = out->port; |
| 11260 | if (!buf) |
| 11261 | ctx->object = NULL; |
| 11262 | return ret; |
| 11263 | } |
| 11264 | |
| 11265 | /** Parse tokens for shared indirect actions. */ |
| 11266 | static int |
nothing calls this directly
no test coverage detected