RetroArch
pbuf.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without modification,
6  * are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  * 3. The name of the author may not be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
19  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
21  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
25  * OF SUCH DAMAGE.
26  *
27  * This file is part of the lwIP TCP/IP stack.
28  *
29  * Author: Adam Dunkels <[email protected]>
30  *
31  */
32 
33 #ifndef __LWIP_PBUF_H__
34 #define __LWIP_PBUF_H__
35 
36 #include "arch/cc.h"
37 
38 
39 #define PBUF_TRANSPORT_HLEN 20
40 #define PBUF_IP_HLEN 20
41 
42 typedef enum {
47 } pbuf_layer;
48 
49 typedef enum {
54 } pbuf_flag;
55 
56 /* Definitions for the pbuf flag field. These are NOT the flags that
57  * are passed to pbuf_alloc(). */
58 #define PBUF_FLAG_RAM 0x00U /* Flags that pbuf data is stored in RAM */
59 #define PBUF_FLAG_ROM 0x01U /* Flags that pbuf data is stored in ROM */
60 #define PBUF_FLAG_POOL 0x02U /* Flags that the pbuf comes from the pbuf pool */
61 #define PBUF_FLAG_REF 0x04U /* Flags thet the pbuf payload refers to RAM */
62 
64 #define PBUF_FLAG_LINK_BROADCAST 0x80U
65 
66 struct pbuf {
68  struct pbuf *next;
69 
71  void *payload;
72 
81 
84 
87 
94 
95 };
96 
97 void pbuf_init(void);
98 
100 void pbuf_realloc(struct pbuf *p, u16_t size);
101 u8_t pbuf_header(struct pbuf *p, s16_t header_size);
102 void pbuf_ref(struct pbuf *p);
103 void pbuf_ref_chain(struct pbuf *p);
104 u8_t pbuf_free(struct pbuf *p);
105 u8_t pbuf_clen(struct pbuf *p);
106 void pbuf_cat(struct pbuf *h, struct pbuf *t);
107 void pbuf_chain(struct pbuf *h, struct pbuf *t);
108 struct pbuf *pbuf_take(struct pbuf *f);
109 struct pbuf *pbuf_dechain(struct pbuf *p);
110 void pbuf_queue(struct pbuf *p, struct pbuf *n);
111 struct pbuf * pbuf_dequeue(struct pbuf *p);
112 
113 #endif /* __LWIP_PBUF_H__ */
pbuf_flag
Definition: pbuf.h:49
u16_t flags
Definition: pbuf.h:86
u8_t pbuf_free(struct pbuf *p)
Definition: pbuf.c:545
GLdouble GLdouble t
Definition: glext.h:6398
u8_t pbuf_header(struct pbuf *p, s16_t header_size)
Definition: pbuf.c:465
GLsizeiptr size
Definition: glext.h:6559
GLfloat f
Definition: glext.h:8207
Definition: pbuf.h:51
void pbuf_ref(struct pbuf *p)
Definition: pbuf.c:638
void pbuf_queue(struct pbuf *p, struct pbuf *n)
Definition: pbuf.h:50
Definition: pbuf.h:43
u16_t len
Definition: pbuf.h:83
Definition: pbuf.h:52
void pbuf_cat(struct pbuf *h, struct pbuf *t)
Definition: pbuf.c:660
struct pbuf * pbuf_alloc(pbuf_layer l, u16_t size, pbuf_flag flag)
Definition: pbuf.c:212
bool l
Definition: connect_wiiupro.c:37
u8_t pbuf_clen(struct pbuf *p)
Definition: pbuf.c:619
struct pbuf * pbuf_take(struct pbuf *f)
Definition: pbuf.c:834
Definition: pbuf.h:44
void * payload
Definition: pbuf.h:71
u16_t tot_len
Definition: pbuf.h:80
Definition: pbuf.h:45
void pbuf_realloc(struct pbuf *p, u16_t size)
Definition: pbuf.c:389
u16_t ref
Definition: pbuf.h:93
GLfloat GLfloat p
Definition: glext.h:9809
s16 s16_t
Definition: cc.h:46
struct pbuf * next
Definition: pbuf.h:68
u8 u8_t
Definition: cc.h:43
struct pbuf * pbuf_dequeue(struct pbuf *p)
void pbuf_chain(struct pbuf *h, struct pbuf *t)
Definition: pbuf.c:702
struct pbuf * pbuf_dechain(struct pbuf *p)
Definition: pbuf.c:929
Definition: pbuf.h:53
void pbuf_ref_chain(struct pbuf *p)
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:8390
Definition: pbuf.h:46
void pbuf_init(void)
Definition: pbuf.c:98
GLdouble n
Definition: glext.h:8396
pbuf_layer
Definition: pbuf.h:42
u16 u16_t
Definition: cc.h:45
Definition: pbuf.h:66