sdk-core
v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Toggle main menu visibility
Loading...
Searching...
No Matches
raw.h
Go to the documentation of this file.
1
7
8
/*
9
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
10
* All rights reserved.
11
*
12
* Redistribution and use in source and binary forms, with or without modification,
13
* are permitted provided that the following conditions are met:
14
*
15
* 1. Redistributions of source code must retain the above copyright notice,
16
* this list of conditions and the following disclaimer.
17
* 2. Redistributions in binary form must reproduce the above copyright notice,
18
* this list of conditions and the following disclaimer in the documentation
19
* and/or other materials provided with the distribution.
20
* 3. The name of the author may not be used to endorse or promote products
21
* derived from this software without specific prior written permission.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
24
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
26
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
28
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
31
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
32
* OF SUCH DAMAGE.
33
*
34
* This file is part of the lwIP TCP/IP stack.
35
*
36
* Author: Adam Dunkels <adam@sics.se>
37
*
38
*/
39
#ifndef LWIP_HDR_RAW_H
40
#define LWIP_HDR_RAW_H
41
42
#include "
lwip/opt.h
"
43
44
#if LWIP_RAW
/* don't build if not configured for use in lwipopts.h */
45
46
#include "
lwip/pbuf.h
"
47
#include "
lwip/def.h
"
48
#include "
lwip/ip.h
"
49
#include "
lwip/ip_addr.h
"
50
#include "
lwip/ip6_addr.h
"
51
52
#ifdef __cplusplus
53
extern
"C"
{
54
#endif
55
56
#define RAW_FLAGS_CONNECTED 0x01U
57
#define RAW_FLAGS_HDRINCL 0x02U
58
#define RAW_FLAGS_MULTICAST_LOOP 0x04U
59
60
struct
raw_pcb;
61
72
typedef
u8_t (*raw_recv_fn)(
void
*arg,
struct
raw_pcb *pcb,
struct
pbuf
*p,
73
const
ip_addr_t *addr);
74
76
struct
raw_pcb {
77
/* Common members of all PCB types */
78
IP_PCB
;
79
80
struct
raw_pcb *next;
81
82
u8_t protocol;
83
u8_t flags;
84
85
#if LWIP_MULTICAST_TX_OPTIONS
87
u8_t mcast_ifindex;
89
u8_t mcast_ttl;
90
#endif
/* LWIP_MULTICAST_TX_OPTIONS */
91
93
raw_recv_fn recv;
94
/* user-supplied argument for the recv callback */
95
void
*recv_arg;
96
#if LWIP_IPV6
97
/* fields for handling checksum computations as per RFC3542. */
98
u16_t chksum_offset;
99
u8_t chksum_reqd;
100
#endif
101
};
102
103
/* The following functions is the application layer interface to the
104
RAW code. */
105
struct
raw_pcb * raw_new (u8_t proto);
106
struct
raw_pcb * raw_new_ip_type(u8_t type, u8_t proto);
107
void
raw_remove (
struct
raw_pcb *pcb);
108
err_t raw_bind (
struct
raw_pcb *pcb,
const
ip_addr_t *ipaddr);
109
void
raw_bind_netif (
struct
raw_pcb *pcb,
const
struct
netif
*
netif
);
110
err_t raw_connect (
struct
raw_pcb *pcb,
const
ip_addr_t *ipaddr);
111
void
raw_disconnect (
struct
raw_pcb *pcb);
112
113
err_t raw_sendto (
struct
raw_pcb *pcb,
struct
pbuf
*p,
const
ip_addr_t *ipaddr);
114
err_t raw_sendto_if_src(
struct
raw_pcb *pcb,
struct
pbuf
*p,
const
ip_addr_t *dst_ip,
struct
netif
*
netif
,
const
ip_addr_t *src_ip);
115
err_t raw_send (
struct
raw_pcb *pcb,
struct
pbuf
*p);
116
117
void
raw_recv (
struct
raw_pcb *pcb, raw_recv_fn recv,
void
*recv_arg);
118
119
#define raw_flags(pcb) ((pcb)->flags)
120
#define raw_setflags(pcb,f) ((pcb)->flags = (f))
121
122
#define raw_set_flags(pcb, set_flags) do { (pcb)->flags = (u8_t)((pcb)->flags | (set_flags)); } while(0)
123
#define raw_clear_flags(pcb, clr_flags) do { (pcb)->flags = (u8_t)((pcb)->flags & (u8_t)(~(clr_flags) & 0xff)); } while(0)
124
#define raw_is_flag_set(pcb, flag) (((pcb)->flags & (flag)) != 0)
125
126
#define raw_init()
/* Compatibility define, no init needed. */
127
128
/* for compatibility with older implementation */
129
#define raw_new_ip6(proto) raw_new_ip_type(IPADDR_TYPE_V6, proto)
130
131
#if LWIP_MULTICAST_TX_OPTIONS
132
#define raw_set_multicast_netif_index(pcb, idx) ((pcb)->mcast_ifindex = (idx))
133
#define raw_get_multicast_netif_index(pcb) ((pcb)->mcast_ifindex)
134
#define raw_set_multicast_ttl(pcb, value) ((pcb)->mcast_ttl = (value))
135
#define raw_get_multicast_ttl(pcb) ((pcb)->mcast_ttl)
136
#endif
/* LWIP_MULTICAST_TX_OPTIONS */
137
138
#ifdef __cplusplus
139
}
140
#endif
141
142
#endif
/* LWIP_RAW */
143
144
#endif
/* LWIP_HDR_RAW_H */
def.h
ip6_addr.h
ip.h
IP_PCB
#define IP_PCB
Definition
ip.h:76
ip_addr.h
opt.h
pbuf.h
netif
Definition
tcpip.h:1271
pbuf
Definition
tcpip.h:234
core
ps2ip
include
lwip_include
lwip
raw.h
Generated by
1.18.0