Lines Matching defs:buf_p
149 struct isns_buffer_s *buf_p;
207 buf_p = (struct isns_buffer_s *)
209 if (buf_p == NULL)
211 buf_p->next = list_p->head;
212 list_p->head = buf_p;
231 struct isns_buffer_s *buf_p;
244 buf_p = list_p->head;
245 list_p->head = buf_p->next;
247 isns_free(buf_p);
283 struct isns_buffer_s *buf_p;
288 buf_p = NULL;
295 buf_p = list_p->head;
296 list_p->head = buf_p->next;
305 if (buf_p == NULL) {
306 buf_p = (struct isns_buffer_s *)isns_malloc(
311 if (buf_p != NULL)
312 ISNS_INIT_BUFFER(buf_p, buf_size, buf_type);
314 DBG("isns_new_buffer: %p (buf_size=%d, type=%d)\n", buf_p, buf_size,
317 return buf_p;
325 isns_free_buffer(struct isns_buffer_s *buf_p)
330 buf_p, (buf_p == NULL ? 0 : buf_p->buf_type),
331 (buf_p == NULL ? 0 : buf_p->alloc_len));
333 if (buf_p != NULL) {
334 switch (buf_p->buf_type) {
338 list_p = isns_lookup_buffer_list((int)buf_p->alloc_len);
340 buf_p->next = list_p->head;
341 list_p->head = buf_p;
347 isns_free(buf_p);
365 struct isns_buffer_s *buf_p;
372 buf_p = isns_new_buffer((int)sizeof(struct isns_trans_s));
373 if (buf_p == NULL) {
378 trans_p = (struct isns_trans_s *)isns_buffer_data(buf_p, 0);
388 trans_p->get_tlv_info.buf_p = NULL;
392 buf_p->cur_len = sizeof(struct isns_trans_s);
412 isns_free_buffer(buf_p);
432 struct isns_buffer_s *buf_p, *free_buf_p;
462 buf_p = trans_p->get_tlv_info.extra_buf_list;
463 while (buf_p != NULL) {
464 free_buf_p = buf_p;
465 buf_p = buf_p->next;
470 buf_p = ((struct isns_buffer_s *)(void *)(trans_p))-1;
471 isns_free_buffer(buf_p);
679 info_p->buf_p = isns_get_pdu_head_buffer(pdu_p);
777 struct isns_buffer_s *buf_p;
784 buf_p = isns_new_buffer(/* CONSTCOND */(int)MAX(ISNS_BUF_SIZE,
786 if (buf_p == NULL) {
791 return isns_init_pdu(buf_p, cfg_p, trans_id, func_id, flags);
801 struct isns_buffer_s *buf_p, *free_buf_p;
807 buf_p = pdu_p->payload_p;
808 while (buf_p != NULL) {
809 free_buf_p = buf_p;
810 buf_p = buf_p->next;
817 buf_p = ((struct isns_buffer_s *)(void *)(pdu_p))-1 ;
818 isns_free_buffer(buf_p);
879 isns_init_pdu(struct isns_buffer_s *buf_p, struct isns_config_s *cfg_p,
886 assert(buf_p != NULL);
889 pdu_p = isns_buffer_data(buf_p, 0);
890 buf_p->cur_len = sizeof(struct isns_pdu_s);
910 isns_buffer_data(buf_p, buf_p->cur_len);
911 ISNS_INIT_BUFFER(pdu_p->payload_p, (unsigned)(buf_p->alloc_len -
929 struct isns_buffer_s *buf_p, *new_buf_p;
940 buf_p = isns_get_pdu_active_buffer(pdu_p);
944 dst_p = isns_buffer_data(buf_p, buf_p->cur_len);
960 buf_p = pdu_p->payload_p;
961 dst_p = isns_buffer_data(buf_p, 0);
964 if (buf_p->cur_len == buf_p->alloc_len) {
965 if (buf_p->next != NULL)
966 buf_p = buf_p->next;
971 buf_p->next = new_buf_p;
972 buf_p = new_buf_p;
974 dst_p = isns_buffer_data(buf_p, 0);
977 buf_p->cur_len++;
987 buf_p->cur_len += pad_bytes;
1003 if ((info_p->buf_p != NULL) &&
1004 (info_p->buf_ofs == (int)info_p->buf_p->cur_len)) {
1005 info_p->buf_p = info_p->buf_p->next;
1009 if ((info_p->buf_p == NULL) && (info_p->pdu_p->next != NULL)) {
1011 info_p->buf_p = isns_get_pdu_head_buffer(info_p->pdu_p);
1028 if ((info_p->buf_p == NULL) ||
1029 ((info_p->buf_ofs + 4) > (int)info_p->buf_p->cur_len)) {
1034 *uint32_p = ntohl(*(uint32_t *)isns_buffer_data(info_p->buf_p,
1062 if (info_p->buf_p == NULL) {
1068 data_p = isns_buffer_data(info_p->buf_p, info_p->buf_ofs);
1071 if ((info_p->buf_ofs + data_len) <= (int)info_p->buf_p->cur_len) {
1106 if (gti.buf_p == NULL) {
1111 data_p = isns_buffer_data(gti.buf_p, gti.buf_ofs);
1113 cbytes = MIN(bytes_remaining, ((int)gti.buf_p->cur_len - gti.buf_ofs));
1217 struct isns_buffer_s *buf_p;
1219 buf_p = pdu_p->payload_p;
1220 if (buf_p != NULL)
1221 while (buf_p->next != NULL) buf_p = buf_p->next;
1223 return buf_p;
1235 struct isns_buffer_s *buf_p;
1237 buf_p = pdu_p->payload_p;
1238 while ((buf_p->next != NULL) && (buf_p->cur_len == buf_p->alloc_len)) {
1239 buf_p = buf_p->next;
1242 return buf_p;
1266 struct isns_buffer_s *buf_p;
1299 buf_p = pdu_p->payload_p;
1300 while (buf_p != NULL) {
1302 buf_p, buf_p->alloc_len, buf_p->cur_len);
1303 buf_p = buf_p->next;
1307 buf_p = pdu_p->payload_p;
1308 if (buf_p == NULL) {
1315 while (buf_p != NULL) {
1316 p = isns_buffer_data(buf_p, 0);
1317 for (n = 0; n < buf_p->cur_len; n++) {
1329 buf_p = buf_p->next;