• Home
  • Raw
  • Download

Lines Matching refs:sel

441 void xfrm_selector_print(struct xfrm_selector *sel, __u16 family,  in xfrm_selector_print()  argument
447 f = sel->family; in xfrm_selector_print()
458 rt_addr_n2a(f, sizeof(sel->saddr), &sel->saddr, in xfrm_selector_print()
460 sel->prefixlen_s); in xfrm_selector_print()
464 rt_addr_n2a(f, sizeof(sel->daddr), &sel->daddr, in xfrm_selector_print()
466 sel->prefixlen_d); in xfrm_selector_print()
468 if (sel->proto) in xfrm_selector_print()
469 fprintf(fp, "proto %s ", strxf_proto(sel->proto)); in xfrm_selector_print()
470 switch (sel->proto) { in xfrm_selector_print()
476 if (sel->sport_mask) in xfrm_selector_print()
477 fprintf(fp, "sport %u ", ntohs(sel->sport)); in xfrm_selector_print()
478 if (sel->dport_mask) in xfrm_selector_print()
479 fprintf(fp, "dport %u ", ntohs(sel->dport)); in xfrm_selector_print()
484 if (sel->sport_mask) in xfrm_selector_print()
485 fprintf(fp, "type %u ", ntohs(sel->sport)); in xfrm_selector_print()
486 if (sel->dport_mask) in xfrm_selector_print()
487 fprintf(fp, "code %u ", ntohs(sel->dport)); in xfrm_selector_print()
490 if (sel->sport_mask || sel->dport_mask) in xfrm_selector_print()
492 (((__u32)ntohs(sel->sport)) << 16) + in xfrm_selector_print()
493 ntohs(sel->dport)); in xfrm_selector_print()
496 if (sel->sport_mask) in xfrm_selector_print()
497 fprintf(fp, "type %u ", ntohs(sel->sport)); in xfrm_selector_print()
498 if (sel->dport_mask) { in xfrm_selector_print()
500 fprintf(fp, "(dport) 0x%.4x ", sel->dport); in xfrm_selector_print()
505 if (sel->ifindex > 0) in xfrm_selector_print()
506 fprintf(fp, "dev %s ", ll_index_to_name(sel->ifindex)); in xfrm_selector_print()
509 fprintf(fp, "uid %u", sel->user); in xfrm_selector_print()
933 if (!xfrm_selector_iszero(&xsinfo->sel)) { in xfrm_state_info_print()
939 xfrm_selector_print(&xsinfo->sel, xsinfo->family, fp, sbuf); in xfrm_state_info_print()
970 xfrm_selector_print(&xpinfo->sel, preferred_family, fp, title); in xfrm_policy_info_print()
1061 xfrm_xfrma_print(tb, xpinfo->sel.family, fp, buf); in xfrm_policy_info_print()
1220 static int xfrm_selector_upspec_parse(struct xfrm_selector *sel, in xfrm_selector_upspec_parse() argument
1249 sel->proto = upspec; in xfrm_selector_upspec_parse()
1258 if (get_u16(&sel->sport, *argv, 0)) in xfrm_selector_upspec_parse()
1260 sel->sport = htons(sel->sport); in xfrm_selector_upspec_parse()
1261 if (sel->sport) in xfrm_selector_upspec_parse()
1262 sel->sport_mask = ~((__u16)0); in xfrm_selector_upspec_parse()
1271 if (get_u16(&sel->dport, *argv, 0)) in xfrm_selector_upspec_parse()
1273 sel->dport = htons(sel->dport); in xfrm_selector_upspec_parse()
1274 if (sel->dport) in xfrm_selector_upspec_parse()
1275 sel->dport_mask = ~((__u16)0); in xfrm_selector_upspec_parse()
1284 if (get_u16(&sel->sport, *argv, 0) || in xfrm_selector_upspec_parse()
1285 (sel->sport & ~((__u16)0xff))) in xfrm_selector_upspec_parse()
1287 sel->sport = htons(sel->sport); in xfrm_selector_upspec_parse()
1288 sel->sport_mask = ~((__u16)0); in xfrm_selector_upspec_parse()
1298 if (get_u16(&sel->dport, *argv, 0) || in xfrm_selector_upspec_parse()
1299 (sel->dport & ~((__u16)0xff))) in xfrm_selector_upspec_parse()
1301 sel->dport = htons(sel->dport); in xfrm_selector_upspec_parse()
1302 sel->dport_mask = ~((__u16)0); in xfrm_selector_upspec_parse()
1322 sel->sport = htons(uval >> 16); in xfrm_selector_upspec_parse()
1323 sel->dport = htons(uval & 0xffff); in xfrm_selector_upspec_parse()
1324 sel->sport_mask = ~((__u16)0); in xfrm_selector_upspec_parse()
1325 sel->dport_mask = ~((__u16)0); in xfrm_selector_upspec_parse()
1341 switch (sel->proto) { in xfrm_selector_upspec_parse()
1349 …fprintf(stderr, "\"sport\" and \"dport\" are invalid with PROTO value \"%s\"\n", strxf_proto(sel->… in xfrm_selector_upspec_parse()
1354 switch (sel->proto) { in xfrm_selector_upspec_parse()
1360 …fprintf(stderr, "\"type\" and \"code\" are invalid with PROTO value \"%s\"\n", strxf_proto(sel->pr… in xfrm_selector_upspec_parse()
1365 switch (sel->proto) { in xfrm_selector_upspec_parse()
1369 fprintf(stderr, "\"key\" is invalid with PROTO value \"%s\"\n", strxf_proto(sel->proto)); in xfrm_selector_upspec_parse()
1380 int xfrm_selector_parse(struct xfrm_selector *sel, int *argcp, char ***argvp) in xfrm_selector_parse() argument
1398 sel->family = src.family; in xfrm_selector_parse()
1400 memcpy(&sel->saddr, &src.data, sizeof(sel->saddr)); in xfrm_selector_parse()
1401 sel->prefixlen_s = src.bitlen; in xfrm_selector_parse()
1411 sel->family = dst.family; in xfrm_selector_parse()
1413 memcpy(&sel->daddr, &dst.data, sizeof(sel->daddr)); in xfrm_selector_parse()
1414 sel->prefixlen_d = dst.bitlen; in xfrm_selector_parse()
1430 sel->ifindex = ifindex; in xfrm_selector_parse()
1440 xfrm_selector_upspec_parse(sel, &argc, &argv); in xfrm_selector_parse()