Lines Matching refs:sinfo
189 parse_state(const char *state, size_t len, struct xt_conntrack_info *sinfo)
192 sinfo->statemask |= XT_CONNTRACK_STATE_INVALID;
194 sinfo->statemask |= XT_CONNTRACK_STATE_BIT(IP_CT_NEW);
196 sinfo->statemask |= XT_CONNTRACK_STATE_BIT(IP_CT_ESTABLISHED);
198 sinfo->statemask |= XT_CONNTRACK_STATE_BIT(IP_CT_RELATED);
200 sinfo->statemask |= XT_CONNTRACK_STATE_UNTRACKED;
202 sinfo->statemask |= XT_CONNTRACK_STATE_SNAT;
204 sinfo->statemask |= XT_CONNTRACK_STATE_DNAT;
211 parse_states(const char *arg, struct xt_conntrack_info *sinfo)
216 if (comma == arg || !parse_state(arg, comma-arg, sinfo))
224 if (strlen(arg) == 0 || !parse_state(arg, strlen(arg), sinfo))
268 parse_status(const char *status, size_t len, struct xt_conntrack_info *sinfo)
271 sinfo->statusmask |= 0;
273 sinfo->statusmask |= IPS_EXPECTED;
275 sinfo->statusmask |= IPS_SEEN_REPLY;
277 sinfo->statusmask |= IPS_ASSURED;
280 sinfo->statusmask |= IPS_CONFIRMED;
288 parse_statuses(const char *arg, struct xt_conntrack_info *sinfo)
293 if (comma == arg || !parse_status(arg, comma-arg, sinfo))
298 if (strlen(arg) == 0 || !parse_status(arg, strlen(arg), sinfo))
339 struct xt_conntrack_info *sinfo = cb->data;
344 parse_states(cb->arg, sinfo);
346 sinfo->invflags |= XT_CONNTRACK_STATE;
349 sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.protonum = cb->val.protocol;
351 sinfo->invflags |= XT_CONNTRACK_PROTO;
352 if (sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.protonum == 0
353 && (sinfo->invflags & XT_INV_PROTO))
357 sinfo->flags |= XT_CONNTRACK_PROTO;
361 sinfo->invflags |= XT_CONNTRACK_ORIGSRC;
362 sinfo->tuple[IP_CT_DIR_ORIGINAL].src.ip = cb->val.haddr.ip;
363 sinfo->flags |= XT_CONNTRACK_ORIGSRC;
367 sinfo->invflags |= XT_CONNTRACK_ORIGDST;
368 sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.ip = cb->val.haddr.ip;
369 sinfo->flags |= XT_CONNTRACK_ORIGDST;
373 sinfo->invflags |= XT_CONNTRACK_REPLSRC;
374 sinfo->tuple[IP_CT_DIR_REPLY].src.ip = cb->val.haddr.ip;
375 sinfo->flags |= XT_CONNTRACK_REPLSRC;
379 sinfo->invflags |= XT_CONNTRACK_REPLDST;
380 sinfo->tuple[IP_CT_DIR_REPLY].dst.ip = cb->val.haddr.ip;
381 sinfo->flags |= XT_CONNTRACK_REPLDST;
384 parse_statuses(cb->arg, sinfo);
386 sinfo->invflags |= XT_CONNTRACK_STATUS;
387 sinfo->flags |= XT_CONNTRACK_STATUS;
390 sinfo->expires_min = cb->val.u32_range[0];
391 sinfo->expires_max = cb->val.u32_range[0];
393 sinfo->expires_max = cb->val.u32_range[1];
395 sinfo->invflags |= XT_CONNTRACK_EXPIRES;
396 sinfo->flags |= XT_CONNTRACK_EXPIRES;
696 const struct xt_conntrack_info *sinfo = (const void *)match->data;
698 if(sinfo->flags & XT_CONNTRACK_STATE) {
699 if (sinfo->invflags & XT_CONNTRACK_STATE)
702 print_state(sinfo->statemask);
705 if(sinfo->flags & XT_CONNTRACK_PROTO) {
706 if (sinfo->invflags & XT_CONNTRACK_PROTO)
709 printf(" %u", sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.protonum);
712 if(sinfo->flags & XT_CONNTRACK_ORIGSRC) {
713 if (sinfo->invflags & XT_CONNTRACK_ORIGSRC)
718 (struct in_addr *)&sinfo->tuple[IP_CT_DIR_ORIGINAL].src.ip,
719 &sinfo->sipmsk[IP_CT_DIR_ORIGINAL],
724 if(sinfo->flags & XT_CONNTRACK_ORIGDST) {
725 if (sinfo->invflags & XT_CONNTRACK_ORIGDST)
730 (struct in_addr *)&sinfo->tuple[IP_CT_DIR_ORIGINAL].dst.ip,
731 &sinfo->dipmsk[IP_CT_DIR_ORIGINAL],
736 if(sinfo->flags & XT_CONNTRACK_REPLSRC) {
737 if (sinfo->invflags & XT_CONNTRACK_REPLSRC)
742 (struct in_addr *)&sinfo->tuple[IP_CT_DIR_REPLY].src.ip,
743 &sinfo->sipmsk[IP_CT_DIR_REPLY],
748 if(sinfo->flags & XT_CONNTRACK_REPLDST) {
749 if (sinfo->invflags & XT_CONNTRACK_REPLDST)
754 (struct in_addr *)&sinfo->tuple[IP_CT_DIR_REPLY].dst.ip,
755 &sinfo->dipmsk[IP_CT_DIR_REPLY],
760 if(sinfo->flags & XT_CONNTRACK_STATUS) {
761 if (sinfo->invflags & XT_CONNTRACK_STATUS)
764 print_status(sinfo->statusmask);
767 if(sinfo->flags & XT_CONNTRACK_EXPIRES) {
768 if (sinfo->invflags & XT_CONNTRACK_EXPIRES)
772 if (sinfo->expires_max == sinfo->expires_min)
773 printf("%lu", sinfo->expires_min);
775 printf("%lu:%lu", sinfo->expires_min, sinfo->expires_max);
778 if (sinfo->flags & XT_CONNTRACK_DIRECTION) {
779 if (sinfo->invflags & XT_CONNTRACK_DIRECTION)
1084 struct xt_state_info *sinfo = cb->data;
1087 sinfo->statemask = state_parse_states(cb->arg);
1089 sinfo->statemask = ~sinfo->statemask;
1094 struct xt_conntrack_mtinfo1 *sinfo = cb->data;
1097 sinfo->match_flags = XT_CONNTRACK_STATE | XT_CONNTRACK_STATE_ALIAS;
1098 sinfo->state_mask = state_parse_states(cb->arg);
1100 sinfo->invert_flags |= XT_CONNTRACK_STATE;
1105 struct xt_conntrack_mtinfo3 *sinfo
1108 sinfo->match_flags = XT_CONNTRACK_STATE | XT_CONNTRACK_STATE_ALIAS;
1109 sinfo->state_mask = state_parse_states(cb->arg);
1111 sinfo->invert_flags |= XT_CONNTRACK_STATE;
1145 const struct xt_state_info *sinfo = (const void *)match->data;
1148 state_print_state(sinfo->statemask);
1153 const struct xt_state_info *sinfo = (const void *)match->data;
1156 state_print_state(sinfo->statemask);
1188 const struct xt_conntrack_mtinfo3 *sinfo =
1191 xt_xlate_add(xl, "ct state %s", sinfo->invert_flags & XT_CONNTRACK_STATE ?
1193 state_xlate_print(xl, sinfo->state_mask);
1238 const struct xt_conntrack_mtinfo3 *sinfo =
1242 if (sinfo->match_flags & XT_CONNTRACK_DIRECTION) {
1244 sinfo->invert_flags & XT_CONNTRACK_DIRECTION ?
1249 if (sinfo->match_flags & XT_CONNTRACK_PROTO) {
1251 sinfo->invert_flags & XT_CONNTRACK_DIRECTION ?
1253 sinfo->invert_flags & XT_CONNTRACK_PROTO ?
1255 sinfo->l4proto);
1259 if (sinfo->match_flags & XT_CONNTRACK_STATE) {
1261 sinfo->invert_flags & XT_CONNTRACK_STATE ?
1263 state_xlate_print(xl, sinfo->state_mask);
1267 if (sinfo->match_flags & XT_CONNTRACK_STATUS) {
1268 if (sinfo->status_mask == 1)
1271 sinfo->invert_flags & XT_CONNTRACK_STATUS ?
1273 status_xlate_print(xl, sinfo->status_mask);
1277 if (sinfo->match_flags & XT_CONNTRACK_EXPIRES) {
1279 sinfo->invert_flags & XT_CONNTRACK_EXPIRES ?
1281 if (sinfo->expires_max == sinfo->expires_min)
1282 xt_xlate_add(xl, "%lu", sinfo->expires_min);
1284 xt_xlate_add(xl, "%lu-%lu", sinfo->expires_min,
1285 sinfo->expires_max);
1289 if (sinfo->match_flags & XT_CONNTRACK_ORIGSRC) {
1290 if (&sinfo->origsrc_addr == 0L)
1294 sinfo->invert_flags & XT_CONNTRACK_ORIGSRC ?
1296 addr_xlate_print(xl, &sinfo->origsrc_addr,
1297 &sinfo->origsrc_mask, family);
1301 if (sinfo->match_flags & XT_CONNTRACK_ORIGDST) {
1302 if (&sinfo->origdst_addr == 0L)
1306 sinfo->invert_flags & XT_CONNTRACK_ORIGDST ?
1308 addr_xlate_print(xl, &sinfo->origdst_addr,
1309 &sinfo->origdst_mask, family);
1313 if (sinfo->match_flags & XT_CONNTRACK_REPLSRC) {
1314 if (&sinfo->replsrc_addr == 0L)
1318 sinfo->invert_flags & XT_CONNTRACK_REPLSRC ?
1320 addr_xlate_print(xl, &sinfo->replsrc_addr,
1321 &sinfo->replsrc_mask, family);
1325 if (sinfo->match_flags & XT_CONNTRACK_REPLDST) {
1326 if (&sinfo->repldst_addr == 0L)
1330 sinfo->invert_flags & XT_CONNTRACK_REPLDST ?
1332 addr_xlate_print(xl, &sinfo->repldst_addr,
1333 &sinfo->repldst_mask, family);
1337 if (sinfo->match_flags & XT_CONNTRACK_ORIGSRC_PORT) {
1339 sinfo->invert_flags & XT_CONNTRACK_ORIGSRC_PORT ?
1341 if (sinfo->origsrc_port == sinfo->origsrc_port_high)
1342 xt_xlate_add(xl, "%u", sinfo->origsrc_port);
1344 xt_xlate_add(xl, "%u-%u", sinfo->origsrc_port,
1345 sinfo->origsrc_port_high);
1349 if (sinfo->match_flags & XT_CONNTRACK_ORIGDST_PORT) {
1351 sinfo->invert_flags & XT_CONNTRACK_ORIGDST_PORT ?
1353 if (sinfo->origdst_port == sinfo->origdst_port_high)
1354 xt_xlate_add(xl, "%u", sinfo->origdst_port);
1356 xt_xlate_add(xl, "%u-%u", sinfo->origdst_port,
1357 sinfo->origdst_port_high);
1361 if (sinfo->match_flags & XT_CONNTRACK_REPLSRC_PORT) {
1363 sinfo->invert_flags & XT_CONNTRACK_REPLSRC_PORT ?
1365 if (sinfo->replsrc_port == sinfo->replsrc_port_high)
1366 xt_xlate_add(xl, "%u", sinfo->replsrc_port);
1368 xt_xlate_add(xl, "%u-%u", sinfo->replsrc_port,
1369 sinfo->replsrc_port_high);
1373 if (sinfo->match_flags & XT_CONNTRACK_REPLDST_PORT) {
1375 sinfo->invert_flags & XT_CONNTRACK_REPLDST_PORT ?
1376 "!= " : "", sinfo->repldst_port);
1377 if (sinfo->repldst_port == sinfo->repldst_port_high)
1378 xt_xlate_add(xl, "%u", sinfo->repldst_port);
1380 xt_xlate_add(xl, "%u-%u", sinfo->repldst_port,
1381 sinfo->repldst_port_high);