Lines Matching refs:pbuf
100 static u_int8_t *pbuf = NULL; /* sadb_x_policy buffer */
101 static int tlen = 0; /* total length of pbuf */
102 static int offset = 0; /* offset of pbuf */
476 if (pbuf) {
477 free(pbuf);
480 pbuf = malloc(sizeof(struct sadb_x_policy));
481 if (pbuf == NULL) {
487 memset(pbuf, 0, tlen);
488 p = (struct sadb_x_policy *)pbuf;
525 n = realloc(pbuf, tlen);
530 pbuf = n;
532 p = (struct sadb_x_ipsecrequest *)&pbuf[offset];
558 memcpy(&pbuf[offset], addr, sysdep_sa_len(addr));
592 pbuf = NULL;
605 if (pbuf != NULL)
606 free(pbuf);
611 ((struct sadb_x_policy *)pbuf)->sadb_x_policy_len = PFKEY_UNIT64(tlen);
615 return pbuf;