change PAD_ScanPads()s behaviour. the return value now contains a bitmask of the...
[libogc.git] / libdb / uIP / uip_pbuf.h
blobc3e55af3cf05d45c1b7053b3d8680c082ea73480
1 #ifndef __UIP_PBUF_H__
2 #define __UIP_PBUF_H__
4 #include "uip.h"
6 /* Definitions for the pbuf flag field. These are NOT the flags that
7 * are passed to pbuf_alloc(). */
8 #define UIP_PBUF_FLAG_RAM 0x00U /* Flags that pbuf data is stored in RAM */
9 #define UIP_PBUF_FLAG_ROM 0x01U /* Flags that pbuf data is stored in ROM */
10 #define UIP_PBUF_FLAG_POOL 0x02U /* Flags that the pbuf comes from the pbuf pool */
11 #define UIP_PBUF_FLAG_REF 0x04U /* Flags thet the pbuf payload refers to RAM */
13 typedef enum {
14 UIP_PBUF_TRANSPORT,
15 UIP_PBUF_IP,
16 UIP_PBUF_LINK,
17 UIP_PBUF_RAW
18 } uip_pbuf_layer;
20 typedef enum {
21 UIP_PBUF_POOL,
22 UIP_PBUF_RAM,
23 UIP_PBUF_ROM,
24 UIP_PBUF_REF
25 } uip_pbuf_flag;
27 struct uip_pbuf {
28 struct uip_pbuf *next;
29 void *payload;
30 u16_t tot_len;
31 u16_t len;
32 u16_t flags;
33 u16_t ref;
36 void uip_pbuf_init();
37 struct uip_pbuf* uip_pbuf_alloc(uip_pbuf_layer layer,u16_t len,uip_pbuf_flag flag);
38 u8_t uip_pbuf_free(struct uip_pbuf *p);
39 void uip_pbuf_realloc(struct uip_pbuf *p,u16_t new_len);
40 u8_t uip_pbuf_header(struct uip_pbuf *p,s16_t hdr_size_inc);
41 void uip_pbuf_cat(struct uip_pbuf *h,struct uip_pbuf *t);
42 u8_t uip_pbuf_clen(struct uip_pbuf *p);
43 void uip_pbuf_queue(struct uip_pbuf *p,struct uip_pbuf *n);
44 void uip_pbuf_ref(struct uip_pbuf *p);
45 void uip_pbuf_chain(struct uip_pbuf *h,struct uip_pbuf *t);
46 struct uip_pbuf* uip_pbuf_dequeue(struct uip_pbuf *p);
47 struct uip_pbuf* uip_pbuf_dechain(struct uip_pbuf *p);
49 #endif