Lines Matching defs:so_pref
262 from_union_to_cidr(const union sockunion *so_pref)
264 const struct sockaddr_in *sin = (const struct sockaddr_in*) so_pref;
401 delete_route(union sockunion * so_dest, union sockunion * so_pref, int freeso)
416 if (so_pref)
427 if (so_pref) {
428 union sockunion *so_pref_temp = so_pref;
431 so_pref_temp = calloc(1, so_pref->sa.sa_len);
434 memcpy(so_pref_temp, so_pref, so_pref->sa.sa_len);
445 if (so_pref)
446 free(so_pref);
449 if(so_pref) {
451 strlcpy(spreftmp, inet_ntoa(so_pref->sin.sin_addr),
467 * If exact_match is set it compares also the so_dest and so_pref
472 const union sockunion * so_pref, int exact_match)
502 if (so_pref) {
503 union sockunion *so_pref_temp = calloc(1, so_pref->sa.sa_len);
508 memcpy(so_pref_temp, so_pref, so_pref->sa.sa_len);
581 union sockunion *so_dest = NULL, *so_gate = NULL, *so_pref = NULL;
635 GETNEXT(so_pref, so_gate);
637 GETNEXT(so_pref, so_dest);
640 if (so_pref)
641 prefixlen = from_union_to_cidr(so_pref);
644 if ((so_pref = from_cidr_to_union(32)) == NULL)
649 so_pref->sa.sa_family = AF_INET;
650 so_pref->sa.sa_len = sizeof(struct sockaddr_in);
651 so_pref->sin.sin_port = 0;
652 memset(&so_pref->sin.sin_zero, 0, sizeof(so_pref->sin.sin_zero));
659 lab = label_get(so_dest, so_pref);
675 if (label_get(so_dest, so_pref) == NULL) {
678 label_add(so_dest, so_pref, NULL,
687 lab = label_add(so_dest, so_pref,
695 label_add(so_dest, so_pref, so_gate,
708 lab = label_get(so_dest, so_pref);
720 free(so_pref);
728 if (so_pref)
767 free(so_pref);
829 union sockunion *so_dst, *so_pref, *so_gate;
855 so_gate = so_pref = NULL;
894 if ((so_pref = from_cidr_to_union(32)) == NULL)
897 GETNEXT(so_pref, so_gate);
899 GETNEXT(so_pref, so_dst);
901 so_pref->sa.sa_family = AF_INET;
902 so_pref->sa.sa_len = sizeof(struct sockaddr_in);
903 so_pref->sin.sin_port = 0;
904 memset(&so_pref->sin.sin_zero, 0, 8);
912 rtmes->rtm_flags & RTF_HOST ? NULL : so_pref,
915 free(so_pref);
923 label_add(so_dst, so_pref, so_gate,
928 free(so_pref);
942 union sockunion *so_dst, *so_pref, *so_gate;
968 so_pref = NULL;
987 GETNEXT(so_pref, so_gate);
993 delete_route(so_dst, so_pref, NO_FREESO);