sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
pppapi.h
Go to the documentation of this file.
1/*
2 * Redistribution and use in source and binary forms, with or without modification,
3 * are permitted provided that the following conditions are met:
4 *
5 * 1. Redistributions of source code must retain the above copyright notice,
6 * this list of conditions and the following disclaimer.
7 * 2. Redistributions in binary form must reproduce the above copyright notice,
8 * this list of conditions and the following disclaimer in the documentation
9 * and/or other materials provided with the distribution.
10 * 3. The name of the author may not be used to endorse or promote products
11 * derived from this software without specific prior written permission.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
16 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
17 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
18 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
21 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
22 * OF SUCH DAMAGE.
23 *
24 * This file is part of the lwIP TCP/IP stack.
25 *
26 */
27
32#ifndef LWIP_PPPAPI_H
33#define LWIP_PPPAPI_H
34
35#include "netif/ppp/ppp_opts.h"
36
37#if LWIP_PPP_API /* don't build if not configured for use in lwipopts.h */
38
39#include "lwip/sys.h"
40#include "lwip/netif.h"
42#include "netif/ppp/ppp.h"
43#if PPPOS_SUPPORT
44#include "netif/ppp/pppos.h"
45#endif /* PPPOS_SUPPORT */
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
51struct pppapi_msg_msg {
52 ppp_pcb *ppp;
53 union {
54#if PPP_NOTIFY_PHASE
55 struct {
56 ppp_notify_phase_cb_fn notify_phase_cb;
57 } setnotifyphasecb;
58#endif /* PPP_NOTIFY_PHASE */
59#if PPPOS_SUPPORT
60 struct {
61 struct netif *pppif;
62 pppos_output_cb_fn output_cb;
63 ppp_link_status_cb_fn link_status_cb;
64 void *ctx_cb;
65 } serialcreate;
66#endif /* PPPOS_SUPPORT */
67#if PPPOE_SUPPORT
68 struct {
69 struct netif *pppif;
70 struct netif *ethif;
71 const char *service_name;
72 const char *concentrator_name;
73 ppp_link_status_cb_fn link_status_cb;
74 void *ctx_cb;
75 } ethernetcreate;
76#endif /* PPPOE_SUPPORT */
77#if PPPOL2TP_SUPPORT
78 struct {
79 struct netif *pppif;
80 struct netif *netif;
81 API_MSG_M_DEF_C(ip_addr_t, ipaddr);
82 u16_t port;
83#if PPPOL2TP_AUTH_SUPPORT
84 const u8_t *secret;
85 u8_t secret_len;
86#endif /* PPPOL2TP_AUTH_SUPPORT */
87 ppp_link_status_cb_fn link_status_cb;
88 void *ctx_cb;
89 } l2tpcreate;
90#endif /* PPPOL2TP_SUPPORT */
91 struct {
92 u16_t holdoff;
93 } connect;
94 struct {
95 u8_t nocarrier;
96 } close;
97 struct {
98 u8_t cmd;
99 void *arg;
100 } ioctl;
101 } msg;
102};
103
104struct pppapi_msg {
105 struct tcpip_api_call_data call;
106 struct pppapi_msg_msg msg;
107};
108
109/* API for application */
110err_t pppapi_set_default(ppp_pcb *pcb);
111#if PPP_NOTIFY_PHASE
112err_t pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb);
113#endif /* PPP_NOTIFY_PHASE */
114#if PPPOS_SUPPORT
115ppp_pcb *pppapi_pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
116#endif /* PPPOS_SUPPORT */
117#if PPPOE_SUPPORT
118ppp_pcb *pppapi_pppoe_create(struct netif *pppif, struct netif *ethif, const char *service_name,
119 const char *concentrator_name, ppp_link_status_cb_fn link_status_cb,
120 void *ctx_cb);
121#endif /* PPPOE_SUPPORT */
122#if PPPOL2TP_SUPPORT
123ppp_pcb *pppapi_pppol2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipaddr, u16_t port,
124 const u8_t *secret, u8_t secret_len,
125 ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
126#endif /* PPPOL2TP_SUPPORT */
127err_t pppapi_connect(ppp_pcb *pcb, u16_t holdoff);
128#if PPP_SERVER
129err_t pppapi_listen(ppp_pcb *pcb);
130#endif /* PPP_SERVER */
131err_t pppapi_close(ppp_pcb *pcb, u8_t nocarrier);
132err_t pppapi_free(ppp_pcb *pcb);
133err_t pppapi_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg);
134
135#ifdef __cplusplus
136}
137#endif
138
139#endif /* LWIP_PPP_API */
140
141#endif /* LWIP_PPPAPI_H */