본문 바로가기
컴퓨터/네트워크

lwIP의 pbuf 변수

by Begi 2022. 10. 6.
반응형

lwIP의 pbuf 변수는 송수신되는 데이터 정보가 저장되는 변수로  pbuf.h에 정의되어 있다.

 

payload는 송수신 데이터 변수가 할당된 포이터이다.

 

/** Main packet buffer struct */
struct pbuf {
  /** next pbuf in singly linked pbuf chain */
  struct pbuf *next;

  /** pointer to the actual data in the buffer */
  void *payload;

  /**
   * total length of this buffer and all next buffers in chain
   * belonging to the same packet.
   *
   * For non-queue packet chains this is the invariant:
   * p->tot_len == p->len + (p->next? p->next->tot_len: 0)
   */
  u16_t tot_len;

  /** length of this buffer */
  u16_t len;

  /** pbuf_type as u8_t instead of enum to save space */
  u8_t /*pbuf_type*/ type;

  /** misc flags */
  u8_t flags;

  /**
   * the reference count always equals the number of pointers
   * that refer to this pbuf. This can be pointers from an application,
   * the stack itself, or pbuf->next pointers from a chain.
   */
  u16_t ref;
};

 

pbuf 변수

 

 

반응형

'컴퓨터 > 네트워크' 카테고리의 다른 글

MII와 RMII 차이  (0) 2022.10.09
lwIP 메인 함수 (STM32)  (0) 2022.10.08
lwIP의 tcp_pcb 변수  (0) 2022.10.06
OSI 7 계층 모델  (1) 2022.10.06
인터넷 프로토콜 종류  (0) 2022.10.06

댓글