Lines Matching defs:len

338 	int len;
369 len = sizeof(struct sadb_msg)
378 len += sizeof(struct sadb_spirange);
381 if ((newmsg = CALLOC(len, struct sadb_msg *)) == NULL) {
385 ep = ((caddr_t)newmsg) + len;
388 len, satype, seq, getpid());
441 len = pfkey_send(so, newmsg, len);
444 if (len < 0)
448 return len;
465 int len;
466 if ((len = pfkey_send_x1(so, SADB_UPDATE, satype, mode, src, dst, spi,
472 return len;
489 int len;
490 if ((len = pfkey_send_x1(so, SADB_ADD, satype, mode, src, dst, spi,
496 return len;
509 int len;
510 if ((len = pfkey_send_x2(so, SADB_DELETE, satype, mode, src, dst, spi)) < 0)
513 return len;
530 int len;
557 len = sizeof(struct sadb_msg)
563 if ((newmsg = CALLOC(len, struct sadb_msg *)) == NULL) {
567 ep = ((caddr_t)newmsg) + len;
569 p = pfkey_setsadbmsg((caddr_t)newmsg, ep, SADB_DELETE, len, satype, 0,
589 len = pfkey_send(so, newmsg, len);
592 if (len < 0)
596 return len;
609 int len;
610 if ((len = pfkey_send_x2(so, SADB_GET, satype, mode, src, dst, spi)) < 0)
613 return len;
625 int len, algno;
649 if ((len = pfkey_send_x3(so, SADB_REGISTER, satype)) < 0)
652 return len;
766 int len;
768 if ((len = pfkey_send_x3(so, SADB_FLUSH, satype)) < 0)
771 return len;
783 int len;
785 if ((len = pfkey_send_x3(so, SADB_DUMP, satype)) < 0)
788 return len;
806 int len;
808 if ((len = pfkey_send_x3(so, SADB_X_PROMISC, (flag ? 1 : 0))) < 0)
811 return len;
825 int len;
827 if ((len = pfkey_send_x4(so, SADB_X_SPDADD,
833 return len;
847 int len;
849 if ((len = pfkey_send_x4(so, SADB_X_SPDADD,
855 return len;
869 int len;
871 if ((len = pfkey_send_x4(so, SADB_X_SPDUPDATE,
877 return len;
891 int len;
893 if ((len = pfkey_send_x4(so, SADB_X_SPDUPDATE,
899 return len;
913 int len;
920 if ((len = pfkey_send_x4(so, SADB_X_SPDDELETE,
926 return len;
938 int len;
940 if ((len = pfkey_send_x5(so, SADB_X_SPDDELETE2, spid)) < 0)
943 return len;
955 int len;
957 if ((len = pfkey_send_x5(so, SADB_X_SPDGET, spid)) < 0)
960 return len;
974 int len;
981 if ((len = pfkey_send_x4(so, SADB_X_SPDSETIDX,
987 return len;
999 int len;
1001 if ((len = pfkey_send_x3(so, SADB_X_SPDFLUSH, SADB_SATYPE_UNSPEC)) < 0)
1004 return len;
1016 int len;
1018 if ((len = pfkey_send_x3(so, SADB_X_SPDDUMP, SADB_SATYPE_UNSPEC)) < 0)
1021 return len;
1033 int len;
1102 len = sizeof(struct sadb_msg)
1117 len += sizeof(struct sadb_x_sa_replay);
1120 len += (sizeof(struct sadb_key) + PFKEY_ALIGN8(e_keylen));
1122 len += (sizeof(struct sadb_key) + PFKEY_ALIGN8(a_keylen));
1124 if ((newmsg = CALLOC(len, struct sadb_msg *)) == NULL) {
1128 ep = ((caddr_t)newmsg) + len;
1130 p = pfkey_setsadbmsg((caddr_t)newmsg, ep, type, len,
1198 len = pfkey_send(so, newmsg, len);
1201 if (len < 0)
1205 return len;
1214 int len;
1241 len = sizeof(struct sadb_msg)
1248 if ((newmsg = CALLOC(len, struct sadb_msg *)) == NULL) {
1252 ep = ((caddr_t)newmsg) + len;
1254 p = pfkey_setsadbmsg((caddr_t)newmsg, ep, type, len, satype, 0,
1279 len = pfkey_send(so, newmsg, len);
1282 if (len < 0)
1286 return len;
1297 int len;
1324 len = sizeof(struct sadb_msg);
1326 if ((newmsg = CALLOC(len, struct sadb_msg *)) == NULL) {
1330 ep = ((caddr_t)newmsg) + len;
1332 p = pfkey_setsadbmsg((caddr_t)newmsg, ep, type, len, satype, 0,
1340 len = pfkey_send(so, newmsg, len);
1343 if (len < 0)
1347 return len;
1357 int len;
1389 len = sizeof(struct sadb_msg)
1397 if ((newmsg = CALLOC(len, struct sadb_msg *)) == NULL) {
1401 ep = ((caddr_t)newmsg) + len;
1403 p = pfkey_setsadbmsg((caddr_t)newmsg, ep, type, len,
1428 len = pfkey_send(so, newmsg, len);
1431 if (len < 0)
1435 return len;
1444 int len;
1449 len = sizeof(struct sadb_msg)
1452 if ((newmsg = CALLOC(len, struct sadb_msg *)) == NULL) {
1456 ep = ((caddr_t)newmsg) + len;
1458 p = pfkey_setsadbmsg((caddr_t)newmsg, ep, type, len,
1476 len = pfkey_send(so, newmsg, len);
1479 if (len < 0)
1483 return len;
1498 socklen_t len;
1511 len = sizeof(bufsiz_current);
1513 &bufsiz_current, &len);
1520 len = sizeof(bufsiz_current);
1522 &bufsiz_current, &len);
1564 int len, reallen;
1566 while ((len = recv(so, (caddr_t)&buf, sizeof(buf), MSG_PEEK)) < 0) {
1573 if (len < sizeof(buf)) {
1586 while ((len = recv(so, (caddr_t)newmsg, reallen, 0)) < 0) {
1594 if (len != reallen) {
1601 if (PFKEY_UNUNIT64(newmsg->sadb_msg_len) != len) {
1618 pfkey_send(int so, struct sadb_msg *msg, int len)
1620 if ((len = send(so, (caddr_t)msg, len, 0)) < 0) {
1626 return len;
1866 u_int len;
1869 len = sizeof(struct sadb_msg);
1871 if (buf + len > lim)
1874 memset(p, 0, len);
1884 return(buf + len);
1896 u_int len;
1899 len = sizeof(struct sadb_sa);
1901 if (buf + len > lim)
1904 memset(p, 0, len);
1905 p->sadb_sa_len = PFKEY_UNIT64(len);
1914 return(buf + len);
1925 u_int len;
1928 len = sizeof(struct sadb_x_sa_replay);
1930 if (buf + len > lim)
1933 memset(p, 0, len);
1934 p->sadb_x_sa_replay_len = PFKEY_UNIT64(len);
1939 return (buf + len);
1952 u_int len;
1955 len = sizeof(struct sadb_address) + PFKEY_ALIGN8(saddr->sa_len);
1957 if (buf + len > lim)
1960 memset(p, 0, len);
1961 p->sadb_address_len = PFKEY_UNIT64(len);
1969 return(buf + len);
1974 * OUT: the pointer of buf + len.
1980 u_int len;
1983 len = sizeof(struct sadb_key) + PFKEY_ALIGN8(keylen);
1985 if (buf + len > lim)
1988 memset(p, 0, len);
1989 p->sadb_key_len = PFKEY_UNIT64(len);
1996 return buf + len;
2001 * OUT: the pointer of buf + len.
2008 u_int len;
2011 len = sizeof(struct sadb_lifetime);
2013 if (buf + len > lim)
2016 memset(p, 0, len);
2017 p->sadb_lifetime_len = PFKEY_UNIT64(len);
2039 return buf + len;
2051 u_int len;
2054 len = sizeof(struct sadb_x_sa2);
2056 if (buf + len > lim)
2059 memset(p, 0, len);
2060 p->sadb_x_sa2_len = PFKEY_UNIT64(len);
2065 return(buf + len);