Home | History | Annotate | Download | only in libipsec

Lines Matching full:len

385 	int len;
416 len = sizeof(struct sadb_msg)
425 len += sizeof(struct sadb_spirange);
428 if ((newmsg = CALLOC((size_t)len, struct sadb_msg *)) == NULL) {
432 ep = ((caddr_t)(void *)newmsg) + len;
435 (u_int)len, satype, seq, getpid());
488 len = pfkey_send(so, newmsg, len);
491 if (len < 0)
495 return len;
509 int len;
513 if ((len = pfkey_send_x1(sa_parms)) < 0)
516 return len;
530 int len;
533 if ((len = pfkey_send_x1(sa_parms)) < 0)
536 return len;
552 int len;
553 if ((len = pfkey_send_x2(so, SADB_DELETE, satype, mode, src, dst, spi)) < 0)
556 return len;
576 int len;
603 len = sizeof(struct sadb_msg)
609 if ((newmsg = CALLOC((size_t)len, struct sadb_msg *)) == NULL) {
613 ep = ((caddr_t)(void *)newmsg) + len;
615 p = pfkey_setsadbmsg((void *)newmsg, ep, SADB_DELETE, (u_int)len,
635 len = pfkey_send(so, newmsg, len);
638 if (len < 0)
642 return len;
658 int len;
659 if ((len = pfkey_send_x2(so, SADB_GET, satype, mode, src, dst, spi)) < 0)
662 return len;
676 int len, algno;
700 if ((len = pfkey_send_x3(so, SADB_REGISTER, satype)) < 0)
703 return len;
822 int len;
824 if ((len = pfkey_send_x3(so, SADB_FLUSH, satype)) < 0)
827 return len;
841 int len;
843 if ((len = pfkey_send_x3(so, SADB_DUMP, satype)) < 0)
846 return len;
866 int len;
868 if ((len = pfkey_send_x3(so, SADB_X_PROMISC,
872 return len;
890 int len;
892 if ((len = pfkey_send_x4(so, SADB_X_SPDADD,
898 return len;
918 int len;
920 if ((len = pfkey_send_x4(so, SADB_X_SPDADD,
926 return len;
944 int len;
946 if ((len = pfkey_send_x4(so, SADB_X_SPDUPDATE,
952 return len;
972 int len;
974 if ((len = pfkey_send_x4(so, SADB_X_SPDUPDATE,
980 return len;
998 int len;
1005 if ((len = pfkey_send_x4(so, SADB_X_SPDDELETE,
1011 return len;
1025 int len;
1027 if ((len = pfkey_send_x5(so, SADB_X_SPDDELETE2, spid)) < 0)
1030 return len;
1044 int len;
1046 if ((len = pfkey_send_x5(so, SADB_X_SPDGET, spid)) < 0)
1049 return len;
1067 int len;
1074 if ((len = pfkey_send_x4(so, SADB_X_SPDSETIDX,
1080 return len;
1093 int len;
1095 if ((len = pfkey_send_x3(so, SADB_X_SPDFLUSH, SADB_SATYPE_UNSPEC)) < 0)
1098 return len;
1111 int len;
1113 if ((len = pfkey_send_x3(so, SADB_X_SPDDUMP, SADB_SATYPE_UNSPEC)) < 0)
1116 return len;
1137 int len;
1169 len = sizeof(struct sadb_msg)
1176 if ((newmsg = CALLOC(len, struct sadb_msg *)) == NULL) {
1180 ep = ((caddr_t)newmsg) + len;
1182 p = pfkey_setsadbmsg((caddr_t)newmsg, ep, SADB_X_MIGRATE, (u_int)len,
1201 len = pfkey_send(so, newmsg, len);
1204 if (len < 0)
1208 return len;
1219 int len;
1290 len = sizeof(struct sadb_msg)
1302 len += (sizeof(struct sadb_key) +
1305 len += (sizeof(struct sadb_key) +
1310 len += (sizeof(struct sadb_x_sec_ctx)
1326 len += sizeof(struct sadb_x_nat_t_type);
1327 len += sizeof(struct sadb_x_nat_t_port);
1328 len += sizeof(struct sadb_x_nat_t_port);
1330 len += sizeof(struct sadb_address) +
1334 len += sizeof(struct sadb_x_nat_t_frag);
1339 if ((newmsg = CALLOC((size_t)len, struct sadb_msg *)) == NULL) {
1343 ep = ((caddr_t)(void *)newmsg) + len;
1345 p = pfkey_setsadbmsg((void *)newmsg, ep, sa_parms->type, (u_int)len,
1476 len = pfkey_send(sa_parms->so, newmsg, len);
1479 if (len < 0)
1483 return len;
1496 int len;
1523 len = sizeof(struct sadb_msg)
1530 if ((newmsg = CALLOC((size_t)len, struct sadb_msg *)) == NULL) {
1534 ep = ((caddr_t)(void *)newmsg) + len;
1536 p = pfkey_setsadbmsg((void *)newmsg, ep, type, (u_int)len, satype, 0,
1561 len = pfkey_send(so, newmsg, len);
1564 if (len < 0)
1568 return len;
1581 int len;
1610 len = sizeof(struct sadb_msg);
1612 if ((newmsg = CALLOC((size_t)len, struct sadb_msg *)) == NULL) {
1616 ep = ((caddr_t)(void *)newmsg) + len;
1618 p = pfkey_setsadbmsg((void *)newmsg, ep, type, (u_int)len, satype, 0,
1626 len = pfkey_send(so, newmsg, len);
1629 if (len < 0)
1633 return len;
1649 int len;
1681 len = sizeof(struct sadb_msg)
1689 if ((newmsg = CALLOC((size_t)len, struct sadb_msg *)) == NULL) {
1693 ep = ((caddr_t)(void *)newmsg) + len;
1695 p = pfkey_setsadbmsg((void *)newmsg, ep, type, (u_int)len,
1720 len = pfkey_send(so, newmsg, len);
1723 if (len < 0)
1727 return len;
1739 int len;
1744 len = sizeof(struct sadb_msg)
1747 if ((newmsg = CALLOC((size_t)len, struct sadb_msg *)) == NULL) {
1751 ep = ((caddr_t)(void *)newmsg) + len;
1753 p = pfkey_setsadbmsg((void *)newmsg, ep, type, (u_int)len,
1771 len = pfkey_send(so, newmsg, len);
1774 if (len < 0)
1778 return len;
1844 int len, reallen;
1846 while ((len = recv(so, (void *)&buf, sizeof(buf), MSG_PEEK)) < 0) {
1853 if (len < sizeof(buf)) {
1866 while ((len = recv(so, (void *)newmsg, (socklen_t)reallen, 0)) < 0) {
1874 if (len != reallen) {
1881 if (PFKEY_UNUNIT64(newmsg->sadb_msg_len) != len) {
1898 pfkey_send(so, msg, len)
1901 int len;
1903 if ((len = send(so, (void *)msg, (socklen_t)len, 0)) < 0) {
1909 return len;
2171 u_int len;
2174 len = sizeof(struct sadb_msg);
2176 if (buf + len > lim)
2179 memset(p, 0, len);
2189 return(buf + len);
2204 u_int len;
2207 len = sizeof(struct sadb_sa);
2209 if (buf + len > lim)
2212 memset(p, 0, len);
2213 p->sadb_sa_len = PFKEY_UNIT64(len);
2222 return(buf + len);
2240 u_int len;
2243 len = sizeof(struct sadb_address) + PFKEY_ALIGN8(sysdep_sa_len(saddr));
2245 if (buf + len > lim)
2248 memset(p, 0, len);
2249 p->sadb_address_len = PFKEY_UNIT64(len);
2257 return(buf + len);
2262 * OUT: the pointer of buf + len.
2272 u_int len;
2275 len = sizeof(struct sadb_key) + PFKEY_ALIGN8(keylen);
2277 if (buf + len > lim)
2280 len);
2281 p->sadb_key_len = PFKEY_UNIT64(len);
2288 return buf + len;
2293 * OUT: the pointer of buf + len.
2303 u_int len;
2306 len = sizeof(struct sadb_lifetime);
2308 if (buf + len > lim)
2311 memset(p, 0, len);
2312 p->sadb_lifetime_len = PFKEY_UNIT64(len);
2334 return buf + len;
2350 u_int len;
2353 len = sizeof(struct sadb_x_sa2);
2355 if (buf + len > lim)
2358 memset(p, 0, len);
2359 p->sadb_x_sa2_len = PFKEY_UNIT64(len);
2364 return(buf + len);
2376 u_int len;
2379 len = sizeof(struct sadb_x_nat_t_type);
2381 if (buf + len > lim)
2384 memset(p, 0, len);
2385 p->sadb_x_nat_t_type_len = PFKEY_UNIT64(len);
2389 return(buf + len);
2400 u_int len;
2403 len = sizeof(struct sadb_x_nat_t_port);
2405 if (buf + len > lim)
2408 memset(p, 0, len);
2409 p->sadb_x_nat_t_port_len = PFKEY_UNIT64(len);
2413 return(buf + len);
2426 u_int len;
2429 len = sizeof(struct sadb_x_nat_t_frag);
2431 if (buf + len > lim)
2434 memset(p, 0, len);
2435 p->sadb_x_nat_t_frag_len = PFKEY_UNIT64(len);
2439 return(buf + len);
2454 u_int len;
2457 len = sizeof(struct sadb_x_sec_ctx) + PFKEY_ALIGN8(sec_ctxlen);
2459 if (buf + len > lim)
2462 memset(p, 0, len);
2463 p->sadb_x_sec_len = PFKEY_UNIT64(len);
2471 return buf + len;