sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
altcp_priv.h
Go to the documentation of this file.
1
10
11/*
12 * Copyright (c) 2017 Simon Goldschmidt
13 * All rights reserved.
14 *
15 * Redistribution and use in source and binary forms, with or without modification,
16 * are permitted provided that the following conditions are met:
17 *
18 * 1. Redistributions of source code must retain the above copyright notice,
19 * this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright notice,
21 * this list of conditions and the following disclaimer in the documentation
22 * and/or other materials provided with the distribution.
23 * 3. The name of the author may not be used to endorse or promote products
24 * derived from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
27 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
29 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
31 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
34 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
35 * OF SUCH DAMAGE.
36 *
37 * This file is part of the lwIP TCP/IP stack.
38 *
39 * Author: Simon Goldschmidt <goldsimon@gmx.de>
40 *
41 */
42#ifndef LWIP_HDR_ALTCP_PRIV_H
43#define LWIP_HDR_ALTCP_PRIV_H
44
45#include "lwip/opt.h"
46
47#if LWIP_ALTCP /* don't build if not configured for use in lwipopts.h */
48
49#include "lwip/altcp.h"
50#include "lwip/ip_addr.h"
51
52#ifdef __cplusplus
53extern "C" {
54#endif
55
56struct altcp_pcb *altcp_alloc(void);
57void altcp_free(struct altcp_pcb *conn);
58
59/* Function prototypes for application layers */
60typedef void (*altcp_set_poll_fn)(struct altcp_pcb *conn, u8_t interval);
61typedef void (*altcp_recved_fn)(struct altcp_pcb *conn, u16_t len);
62typedef err_t (*altcp_bind_fn)(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port);
63typedef err_t (*altcp_connect_fn)(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port, altcp_connected_fn connected);
64
65typedef struct altcp_pcb *(*altcp_listen_fn)(struct altcp_pcb *conn, u8_t backlog, err_t *err);
66
67typedef void (*altcp_abort_fn)(struct altcp_pcb *conn);
68typedef err_t (*altcp_close_fn)(struct altcp_pcb *conn);
69typedef err_t (*altcp_shutdown_fn)(struct altcp_pcb *conn, int shut_rx, int shut_tx);
70
71typedef err_t (*altcp_write_fn)(struct altcp_pcb *conn, const void *dataptr, u16_t len, u8_t apiflags);
72typedef err_t (*altcp_output_fn)(struct altcp_pcb *conn);
73
74typedef u16_t (*altcp_mss_fn)(struct altcp_pcb *conn);
75typedef u16_t (*altcp_sndbuf_fn)(struct altcp_pcb *conn);
76typedef u16_t (*altcp_sndqueuelen_fn)(struct altcp_pcb *conn);
77typedef void (*altcp_nagle_disable_fn)(struct altcp_pcb *conn);
78typedef void (*altcp_nagle_enable_fn)(struct altcp_pcb *conn);
79typedef int (*altcp_nagle_disabled_fn)(struct altcp_pcb *conn);
80
81typedef void (*altcp_setprio_fn)(struct altcp_pcb *conn, u8_t prio);
82
83typedef void (*altcp_dealloc_fn)(struct altcp_pcb *conn);
84
85typedef err_t (*altcp_get_tcp_addrinfo_fn)(struct altcp_pcb *conn, int local, ip_addr_t *addr, u16_t *port);
86typedef ip_addr_t *(*altcp_get_ip_fn)(struct altcp_pcb *conn, int local);
87typedef u16_t (*altcp_get_port_fn)(struct altcp_pcb *conn, int local);
88
89#if LWIP_TCP_KEEPALIVE
90typedef void (*altcp_keepalive_disable_fn)(struct altcp_pcb *conn);
91typedef void (*altcp_keepalive_enable_fn)(struct altcp_pcb *conn, u32_t idle, u32_t intvl, u32_t count);
92#endif
93
94#ifdef LWIP_DEBUG
95typedef enum tcp_state (*altcp_dbg_get_tcp_state_fn)(struct altcp_pcb *conn);
96#endif
97
98struct altcp_functions {
99 altcp_set_poll_fn set_poll;
100 altcp_recved_fn recved;
101 altcp_bind_fn bind;
102 altcp_connect_fn connect;
103 altcp_listen_fn listen;
104 altcp_abort_fn abort;
105 altcp_close_fn close;
106 altcp_shutdown_fn shutdown;
107 altcp_write_fn write;
108 altcp_output_fn output;
109 altcp_mss_fn mss;
110 altcp_sndbuf_fn sndbuf;
111 altcp_sndqueuelen_fn sndqueuelen;
112 altcp_nagle_disable_fn nagle_disable;
113 altcp_nagle_enable_fn nagle_enable;
114 altcp_nagle_disabled_fn nagle_disabled;
115 altcp_setprio_fn setprio;
116 altcp_dealloc_fn dealloc;
117 altcp_get_tcp_addrinfo_fn addrinfo;
118 altcp_get_ip_fn getip;
119 altcp_get_port_fn getport;
120#if LWIP_TCP_KEEPALIVE
121 altcp_keepalive_disable_fn keepalive_disable;
122 altcp_keepalive_enable_fn keepalive_enable;
123#endif
124#ifdef LWIP_DEBUG
125 altcp_dbg_get_tcp_state_fn dbg_get_tcp_state;
126#endif
127};
128
129void altcp_default_set_poll(struct altcp_pcb *conn, u8_t interval);
130void altcp_default_recved(struct altcp_pcb *conn, u16_t len);
131err_t altcp_default_bind(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port);
132err_t altcp_default_shutdown(struct altcp_pcb *conn, int shut_rx, int shut_tx);
133err_t altcp_default_write(struct altcp_pcb *conn, const void *dataptr, u16_t len, u8_t apiflags);
134err_t altcp_default_output(struct altcp_pcb *conn);
135u16_t altcp_default_mss(struct altcp_pcb *conn);
136u16_t altcp_default_sndbuf(struct altcp_pcb *conn);
137u16_t altcp_default_sndqueuelen(struct altcp_pcb *conn);
138void altcp_default_nagle_disable(struct altcp_pcb *conn);
139void altcp_default_nagle_enable(struct altcp_pcb *conn);
140int altcp_default_nagle_disabled(struct altcp_pcb *conn);
141void altcp_default_setprio(struct altcp_pcb *conn, u8_t prio);
142void altcp_default_dealloc(struct altcp_pcb *conn);
143err_t altcp_default_get_tcp_addrinfo(struct altcp_pcb *conn, int local, ip_addr_t *addr, u16_t *port);
144ip_addr_t *altcp_default_get_ip(struct altcp_pcb *conn, int local);
145u16_t altcp_default_get_port(struct altcp_pcb *conn, int local);
146#if LWIP_TCP_KEEPALIVE
147void altcp_default_keepalive_disable(struct altcp_pcb *conn);
148void altcp_default_keepalive_enable(struct altcp_pcb *conn, u32_t idle, u32_t intvl, u32_t count);
149#endif
150#ifdef LWIP_DEBUG
151enum tcp_state altcp_default_dbg_get_tcp_state(struct altcp_pcb *conn);
152#endif
153
154#ifdef __cplusplus
155}
156#endif
157
158#endif /* LWIP_ALTCP */
159
160#endif /* LWIP_HDR_ALTCP_PRIV_H */
int shutdown()
Definition main.c:99
u32 count
start sector of fragmented bd/file