# pbuf.h File Reference

`#include "net/debug.h"`
`#include "net/arch.h"`

Go to the source code of this file.

## Data Structures

struct | pbuf

## Defines

#define | PBUF_FLAG_POOL 0x02
#define | PBUF_FLAG_RAM 0x00
#define | PBUF_FLAG_ROM 0x01
#define | PBUF_IP_HLEN 20
#define | PBUF_TRANSPORT_HLEN 20

## Enumerations

enum | pbuf_flag { PBUF_RAM, PBUF_ROM, PBUF_POOL }
enum | pbuf_layer { PBUF_TRANSPORT, PBUF_IP, PBUF_LINK, PBUF_RAW }

## Functions

pbuf * | pbuf_alloc (pbuf_layer l, uInt16 size, pbuf_flag flag)
void | pbuf_chain (struct pbuf *h, struct pbuf *t)
uInt8 | pbuf_clen (struct pbuf *p)
pbuf * | pbuf_dechain (struct pbuf *p)
uInt8 | pbuf_free (struct pbuf *p)
uInt8 | pbuf_header (struct pbuf *p, Int16 header_size)
void | pbuf_init (void)
void | pbuf_realloc (struct pbuf *p, uInt16 size)
void | pbuf_ref (struct pbuf *p)

## Define Documentation

#define PBUF_FLAG_POOL 0x02

Definition at line 63 of file pbuf.h.

#define PBUF_FLAG_RAM 0x00

Definition at line 61 of file pbuf.h.

#define PBUF_FLAG_ROM 0x01

Definition at line 62 of file pbuf.h.

#define PBUF_IP_HLEN 20

Definition at line 44 of file pbuf.h.

#define PBUF_TRANSPORT_HLEN 20

Definition at line 43 of file pbuf.h.

## Enumeration Type Documentation

enum pbuf_flag

Enumerator:

  PBUF_RAM |
  PBUF_ROM |
  PBUF_POOL |

Definition at line 53 of file pbuf.h.

enum pbuf_layer

Enumerator:

  PBUF_TRANSPORT |
  PBUF_IP |
  PBUF_LINK |
  PBUF_RAW |

Definition at line 46 of file pbuf.h.

## Function Documentation

struct pbuf* pbuf_alloc | ( | pbuf_layer | l,
|  | uInt16 | size,
|  | pbuf_flag | flag |
| ) |  |  |

Referenced by arp_query(), ethernetif_output(), loopif_output(), low_level_input(), netbuf_alloc(), and netbuf_ref().

void pbuf_chain | ( | struct pbuf * | h,
|  | struct pbuf * | t |
| ) |  |  |

Referenced by ethernetif_output(), and netbuf_chain().

uInt8 pbuf_clen | ( | struct pbuf * | p | ) |

struct pbuf* pbuf_dechain | ( | struct pbuf * | p | ) |

uInt8 pbuf_free | ( | struct pbuf * | p | ) |

Referenced by arp_arp_input(), ethernetif_input(), ethernetif_output(), netbuf_alloc(), netbuf_delete(), netbuf_free(), netbuf_ref(), netconn_delete(), recv_tcp(), recv_udp(), and tcpip_input().

uInt8 pbuf_header | ( | struct pbuf * | p,
|  | Int16 | header_size |
| ) |  |  |

Referenced by ethernetif_input(), and ethernetif_output().

void pbuf_init | ( | void |  | ) |

Referenced by net_init().

void pbuf_realloc | ( | struct pbuf * | p,
|  | uInt16 | size |
| ) |  |  |

void pbuf_ref | ( | struct pbuf * | p | ) |