Lines Matching refs:id_b
3603 struct ipsecdoi_id_b *id_b; local
3612 if (iph1->id_p->l < sizeof(*id_b)) {
3619 id_b = (struct ipsecdoi_id_b *)iph1->id_p->v;
3625 if (id_b->type != IPSECDOI_ID_IPV4_ADDR
3626 && id_b->type != IPSECDOI_ID_IPV6_ADDR) {
3629 "but %s.\n", s_ipsecdoi_ident(id_b->type));
3636 switch (id_b->type) {
3643 s_ipsecdoi_ident(id_b->type));
3648 if (id_b->type == IPSECDOI_ID_IPV4_ADDR ||
3649 id_b->type == IPSECDOI_ID_IPV6_ADDR) {
3651 if (id_b->proto_id == 0 && ntohs(id_b->port) != 0) {
3655 id_b->proto_id, ntohs(id_b->port));
3658 } else if (id_b->proto_id == IPPROTO_UDP) {
3663 if (ntohs(id_b->port) != PORT_ISAKMP) {
3667 if (ntohs(id_b->port) != port) {
3670 port, ntohs(id_b->port));
3686 if (id->idtype != doi2idtype(id_b->type))
3698 ident.v = iph1->id_p->v + sizeof(*id_b);
3699 ident.l = iph1->id_p->l - sizeof(*id_b);
3705 sa2 = (caddr_t)(id_b + 1);
3708 if (iph1->id_p->l - sizeof(*id_b) != sizeof(struct in_addr))
3716 if (iph1->id_p->l - sizeof(*id_b) != sizeof(struct in6_addr))
3728 if (memcmp(ident0->v, id_b + 1, ident0->l) == 0)
3758 struct ipsecdoi_id_b id_b; local
3763 id_b.proto_id = 0;
3764 id_b.port = 0;
3769 id_b.type = IPSECDOI_ID_FQDN;
3773 id_b.type = IPSECDOI_ID_USER_FQDN;
3777 id_b.type = IPSECDOI_ID_KEY_ID;
3781 id_b.type = IPSECDOI_ID_DER_ASN1_DN;
3814 id_b.type = IPSECDOI_ID_IPV4_ADDR;
3820 id_b.type = IPSECDOI_ID_IPV6_ADDR;
3830 id_b.proto_id = IPPROTO_UDP;
3831 id_b.port = htons(PORT_ISAKMP);
3847 ret = vmalloc(sizeof(id_b) + ident->l);
3854 memcpy(ret->v, &id_b, sizeof(id_b));
3855 memcpy(ret->v + sizeof(id_b), ident->v, ident->l);
3860 "use ID type of %s\n", s_ipsecdoi_ident(id_b.type));
4270 struct ipsecdoi_id_b *id_b = (struct ipsecdoi_id_b *)buf->v; local
4280 switch (id_b->type) {
4288 (id_b->port == 0
4290 : id_b->port); /* see sockaddr2id() */
4292 buf->v + sizeof(*id_b), sizeof(struct in_addr));
4302 (id_b->port == 0
4304 : id_b->port); /* see sockaddr2id() */
4306 buf->v + sizeof(*id_b), sizeof(struct in6_addr));
4311 "unsupported ID type %d\n", id_b->type);
4316 switch (id_b->type) {
4334 switch (id_b->type) {
4380 *ul_proto = id_b->proto_id == 0
4382 : id_b->proto_id; /* see sockaddr2id() */
4399 struct ipsecdoi_id_b *id_b = (struct ipsecdoi_id_b *)id->v; local
4411 switch (id_b->type) {
4423 id->v + sizeof(*id_b), sizeof(struct in_addr));
4437 id->v + sizeof(*id_b), sizeof(struct in6_addr));
4440 ? ((struct sockaddr_in6 *)id_b)->sin6_scope_id
4446 switch (id_b->type) {
4463 switch (id_b->type) {
4521 id->v + sizeof(*id_b) + sizeof(struct in_addr),
4539 id->v + sizeof(*id_b) + sizeof(struct in6_addr),
4543 ? ((struct sockaddr_in6 *)id_b)->sin6_scope_id
4553 len = id->l - sizeof(*id_b);
4556 memcpy(buf, id->v + sizeof(*id_b), len);
4564 dat = id->v + sizeof(*id_b);
4565 len = id->l - sizeof(*id_b);
4593 "unknown ID type %d\n", id_b->type);