Lines Matching refs:id_b
3599 struct ipsecdoi_id_b *id_b;
3608 if (iph1->id_p->l < sizeof(*id_b)) {
3615 id_b = (struct ipsecdoi_id_b *)iph1->id_p->v;
3621 if (id_b->type != IPSECDOI_ID_IPV4_ADDR
3622 && id_b->type != IPSECDOI_ID_IPV6_ADDR) {
3625 "but %s.\n", s_ipsecdoi_ident(id_b->type));
3632 switch (id_b->type) {
3639 s_ipsecdoi_ident(id_b->type));
3644 if (id_b->type == IPSECDOI_ID_IPV4_ADDR ||
3645 id_b->type == IPSECDOI_ID_IPV6_ADDR) {
3647 if (id_b->proto_id == 0 && ntohs(id_b->port) != 0) {
3651 id_b->proto_id, ntohs(id_b->port));
3654 } else if (id_b->proto_id == IPPROTO_UDP) {
3659 if (ntohs(id_b->port) != PORT_ISAKMP) {
3663 if (ntohs(id_b->port) != port) {
3666 port, ntohs(id_b->port));
3682 if (id->idtype != doi2idtype(id_b->type))
3694 ident.v = iph1->id_p->v + sizeof(*id_b);
3695 ident.l = iph1->id_p->l - sizeof(*id_b);
3701 sa2 = (caddr_t)(id_b + 1);
3704 if (iph1->id_p->l - sizeof(*id_b) != sizeof(struct in_addr))
3712 if (iph1->id_p->l - sizeof(*id_b) != sizeof(struct in6_addr))
3724 if (memcmp(ident0->v, id_b + 1, ident0->l) == 0)
3754 struct ipsecdoi_id_b id_b;
3759 id_b.proto_id = 0;
3760 id_b.port = 0;
3765 id_b.type = IPSECDOI_ID_FQDN;
3769 id_b.type = IPSECDOI_ID_USER_FQDN;
3773 id_b.type = IPSECDOI_ID_KEY_ID;
3777 id_b.type = IPSECDOI_ID_DER_ASN1_DN;
3810 id_b.type = IPSECDOI_ID_IPV4_ADDR;
3816 id_b.type = IPSECDOI_ID_IPV6_ADDR;
3826 id_b.proto_id = IPPROTO_UDP;
3827 id_b.port = htons(PORT_ISAKMP);
3843 ret = vmalloc(sizeof(id_b) + ident->l);
3850 memcpy(ret->v, &id_b, sizeof(id_b));
3851 memcpy(ret->v + sizeof(id_b), ident->v, ident->l);
3856 "use ID type of %s\n", s_ipsecdoi_ident(id_b.type));
4256 struct ipsecdoi_id_b *id_b = (struct ipsecdoi_id_b *)buf->v;
4266 switch (id_b->type) {
4274 (id_b->port == 0
4276 : id_b->port); /* see sockaddr2id() */
4278 buf->v + sizeof(*id_b), sizeof(struct in_addr));
4288 (id_b->port == 0
4290 : id_b->port); /* see sockaddr2id() */
4292 buf->v + sizeof(*id_b), sizeof(struct in6_addr));
4297 "unsupported ID type %d\n", id_b->type);
4302 switch (id_b->type) {
4320 switch (id_b->type) {
4366 *ul_proto = id_b->proto_id == 0
4368 : id_b->proto_id; /* see sockaddr2id() */
4385 struct ipsecdoi_id_b *id_b = (struct ipsecdoi_id_b *)id->v;
4397 switch (id_b->type) {
4409 id->v + sizeof(*id_b), sizeof(struct in_addr));
4423 id->v + sizeof(*id_b), sizeof(struct in6_addr));
4426 ? ((struct sockaddr_in6 *)id_b)->sin6_scope_id
4432 switch (id_b->type) {
4449 switch (id_b->type) {
4507 id->v + sizeof(*id_b) + sizeof(struct in_addr),
4525 id->v + sizeof(*id_b) + sizeof(struct in6_addr),
4529 ? ((struct sockaddr_in6 *)id_b)->sin6_scope_id
4539 len = id->l - sizeof(*id_b);
4542 memcpy(buf, id->v + sizeof(*id_b), len);
4550 dat = id->v + sizeof(*id_b);
4551 len = id->l - sizeof(*id_b);
4579 "unknown ID type %d\n", id_b->type);