Lines Matching refs:pbuf
102 static u_int8_t *pbuf = NULL; /* sadb_x_policy buffer */
103 static int tlen = 0; /* total length of pbuf */
104 static int offset = 0; /* offset of pbuf */
499 if (pbuf) {
500 free(pbuf);
503 pbuf = malloc(sizeof(struct sadb_x_policy));
504 if (pbuf == NULL) {
510 memset(pbuf, 0, tlen);
511 p = ALIGNED_CAST(struct sadb_x_policy *)pbuf;
548 n = realloc(pbuf, tlen);
553 pbuf = n;
555 p = ALIGNED_CAST(struct sadb_x_ipsecrequest *)&pbuf[offset]; // Wcast-align fix - malloc'd buffer/offset 64 bit multiple
581 memcpy(&pbuf[offset], addr, sysdep_sa_len((struct sockaddr *)addr));
615 pbuf = NULL;
628 if (pbuf != NULL)
629 free(pbuf);
634 (ALIGNED_CAST(struct sadb_x_policy *)pbuf)->sadb_x_policy_len = PFKEY_UNIT64(tlen);
638 return pbuf;