Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more lwIP physical interfaces #6680

Merged
merged 118 commits into from
Dec 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
04bcb88
Extracts dhcp server from lwip2 and add it to the core.
d-a-v Oct 1, 2019
1793b27
ethernet wip
d-a-v Oct 3, 2019
cb198b4
Merge branch 'master' into ethernet
d-a-v Oct 3, 2019
de4a287
ethernet wip
d-a-v Oct 3, 2019
d279c66
ethernet wip
d-a-v Oct 4, 2019
9229ca5
Merge branch 'master' into ethernet
d-a-v Oct 4, 2019
05d5b68
ethernet wip
d-a-v Oct 5, 2019
9a3df51
ethernet wip
d-a-v Oct 5, 2019
c5c921e
ethernet wip: dhcpserver in a class wip
d-a-v Oct 5, 2019
04b5ed7
ethernet wip
d-a-v Oct 6, 2019
cc2c2ce
now needed: void preinit(){ESP8266WiFiClass::preinitWiFiOff();}
d-a-v Oct 6, 2019
f893c32
ethernet wip
d-a-v Oct 6, 2019
7df15f3
ethernet wip
d-a-v Oct 6, 2019
19146a6
lwip2: no more dhcp inside
d-a-v Oct 7, 2019
e89f352
Merge branch 'master' into ethernet
d-a-v Oct 7, 2019
5898985
ethernet wip
d-a-v Oct 7, 2019
833d3af
Merge branch 'master' into ethernet
d-a-v Oct 7, 2019
deebbcb
ethernet wip
d-a-v Oct 8, 2019
a3b1d91
ethernet wip: dhcp server working for legacy AP on boot, and external…
d-a-v Oct 10, 2019
b8485d1
Merge branch 'master' into ethernet
d-a-v Oct 10, 2019
919839d
ethernet wip
d-a-v Oct 12, 2019
16ddd26
Merge branch 'master' into ethernet
d-a-v Oct 24, 2019
574be13
ppp server updates
d-a-v Oct 26, 2019
8d10e91
restyle
d-a-v Oct 26, 2019
756ce0c
PPPServer: example
d-a-v Oct 26, 2019
5b38c0d
astyle
d-a-v Oct 26, 2019
b79d841
comments
d-a-v Oct 28, 2019
3fec74a
argument reorder common function for ::config()
d-a-v Oct 28, 2019
f15a93c
Merge branch 'ethernet' of github.com:d-a-v/Arduino into ethernet
d-a-v Oct 28, 2019
6ac98da
fix upstream url
d-a-v Oct 28, 2019
f35f712
Merge branch 'master' into ethernet
d-a-v Oct 28, 2019
a8e231b
sync with lwip2
d-a-v Oct 28, 2019
6be2382
Merge branch 'ethernet' of github.com:d-a-v/Arduino into ethernet
d-a-v Oct 28, 2019
c6c3805
sync with lwip2
d-a-v Oct 28, 2019
7bdadd4
missing file
d-a-v Oct 29, 2019
3282a3f
fix dhcp server on AP
d-a-v Oct 30, 2019
370bd62
Merge branch 'master' into ethernet
d-a-v Oct 30, 2019
fc6fb1d
fix example
d-a-v Oct 30, 2019
900c594
fix former declaration of dhcp server, and its current use
d-a-v Oct 30, 2019
4b5a2c4
fix dhcp server when ipv6 is enabled
d-a-v Oct 30, 2019
4ebd5c8
fixes for lwip1
d-a-v Oct 30, 2019
1366903
fi macro arithmetic
d-a-v Oct 30, 2019
d09d62e
fix example
d-a-v Oct 30, 2019
d9d9339
add missing files (ppp)
d-a-v Oct 30, 2019
5816590
fix emulation on host
d-a-v Oct 30, 2019
04d02c3
fix example warnings
d-a-v Oct 30, 2019
6ee5df9
Merge branch 'master' into ethernet
devyte Nov 5, 2019
8f57757
Merge branch 'master' into ethernet
d-a-v Nov 14, 2019
9eb9dee
Merge branch 'ethernet' of github.com:d-a-v/Arduino into ethernet
d-a-v Nov 23, 2019
6b27eaa
Merge branch 'master' into ethernet
d-a-v Nov 23, 2019
bd8b32a
move hostname() from STA to generic interface
d-a-v Nov 23, 2019
55b874c
Merge branch 'master' into ethernet
d-a-v Nov 24, 2019
21694be
Merge branch 'master' into ethernet
d-a-v Nov 28, 2019
9d77d1d
Merge branch 'ethernet' of github.com:d-a-v/Arduino into ethernet
d-a-v Nov 28, 2019
a81d110
Merge branch 'master' into ethernet
d-a-v Dec 4, 2019
b3acf27
Merge branch 'master' into ethernet
d-a-v Dec 6, 2019
df04b3c
Merge branch 'ethernet' of github.com:d-a-v/Arduino into ethernet
d-a-v Dec 21, 2019
51aca37
Merge branch 'master' into ethernet
d-a-v Dec 21, 2019
6e12d9e
Merge branch 'ethernet' of github.com:d-a-v/Arduino into ethernet
d-a-v Feb 18, 2020
540e446
sync with lwip2
d-a-v Feb 18, 2020
29d3de7
Merge branch 'master' into ethernet
d-a-v Feb 25, 2020
50fec05
Merge branch 'master' into ethernet
d-a-v Feb 25, 2020
488ae3e
Merge branch 'ethernet' of github.com:d-a-v/Arduino into ethernet
d-a-v Feb 27, 2020
21ffcfe
Merge branch 'master' into ethernet
d-a-v Feb 27, 2020
0b4689b
style
d-a-v Feb 27, 2020
043d32c
fix using softserial API
d-a-v Feb 27, 2020
cc2be53
fix warning with macro
d-a-v Feb 27, 2020
0dcfc84
fix include file with lwip1.4
d-a-v Feb 27, 2020
967c349
lwIP-1.4 include fix
d-a-v Feb 27, 2020
0f133cc
lwIP-1.4 include fix
d-a-v Feb 27, 2020
3c15b76
+ comments
d-a-v Apr 30, 2020
e0e7cdb
remove non readable characters from comments
d-a-v Apr 30, 2020
af93802
magic_cookie is part of bootp rfc
d-a-v Apr 30, 2020
639ef04
more comments
d-a-v Apr 30, 2020
a60ffaa
rebuild lwip lib
d-a-v Apr 30, 2020
0673d0d
Merge branch 'master' into ethernet
d-a-v Apr 30, 2020
44a680d
rebuild lwip libs
d-a-v Apr 30, 2020
147f5a9
rebuild lwip libs
d-a-v Apr 30, 2020
b18ec7b
fix copy from pointer
d-a-v May 1, 2020
e258e16
Merge branch 'ethernet' of github.com:d-a-v/Arduino into ethernet
d-a-v Jun 2, 2020
fef264e
Merge branch 'master' into ethernet
d-a-v Jun 2, 2020
59fe44e
Merge branch 'ethernet' of github.com:d-a-v/Arduino into ethernet
d-a-v Jun 2, 2020
d80cd31
do not filter mac address from within driver (https://github.com/d-a-…
d-a-v Jun 2, 2020
50d9e83
fix compilation problem with IPv6
d-a-v Jun 2, 2020
8b81709
per https://github.com/d-a-v/W5500lwIP/issues/17#issuecomment-638229509
d-a-v Jun 3, 2020
08dca76
Merge branch 'master' into ethernet
d-a-v Jun 3, 2020
03b0670
update
d-a-v Jul 16, 2020
24f0e9a
Merge branch 'ethernet' of github.com:d-a-v/Arduino into ethernet
d-a-v Jul 16, 2020
90da681
Merge branch 'master' into ethernet
d-a-v Jul 16, 2020
f8c7f10
fix compilation without local lwip1.4
d-a-v Jul 16, 2020
63354f2
merge with master
d-a-v Jul 16, 2020
5af7382
recompile lwip2
d-a-v Jul 16, 2020
49068fd
fix example
d-a-v Jul 16, 2020
96eb899
Merge branch 'master' into ethernet
d-a-v Jul 30, 2020
8be6533
ppp server: release resource on fail
d-a-v Aug 1, 2020
30a2aa7
reorder members
d-a-v Aug 1, 2020
a0239ac
per review and fixes
d-a-v Aug 1, 2020
b2dac9b
Merge branch 'master' into ethernet
d-a-v Aug 15, 2020
5928211
Merge branch 'master' into ethernet
d-a-v Aug 16, 2020
55ef5ef
Merge branch 'master' into ethernet
d-a-v Aug 21, 2020
27ff946
Merge branch 'ethernet' of github.com:d-a-v/Arduino into ethernet
d-a-v Sep 5, 2020
94fb55e
Merge branch 'master' into ethernet
d-a-v Sep 5, 2020
97ad7ab
Merge branch 'master' into ethernet
d-a-v Sep 21, 2020
509999b
Merge branch 'master' into ethernet
d-a-v Sep 27, 2020
0a0f8a5
lwip2: recompiled PPP branch after sync w/ master
d-a-v Sep 27, 2020
788928c
fix file name case confusion after merging from master
d-a-v Sep 27, 2020
38fbe41
fix include file name, remove private constructor
d-a-v Sep 27, 2020
a3aaa49
fix emulatio on host too
d-a-v Sep 27, 2020
29a3e29
Merge branch 'master' into ethernet
d-a-v Oct 15, 2020
dbc55c0
Merge branch 'master' into ethernet
d-a-v Oct 24, 2020
723bed1
Merge branch 'master' into ethernet
earlephilhower Oct 26, 2020
ee5acfe
add lwip_hook_dhcp_parse_option()
d-a-v Nov 9, 2020
8094f2d
Merge branch 'ethernet' of github.com:d-a-v/Arduino into ethernet
d-a-v Nov 9, 2020
823a245
Merge branch 'master' into ethernet
d-a-v Dec 6, 2020
e67e830
Merge branch 'master' into ethernet
d-a-v Dec 22, 2020
3d459da
lwIP recompilation
d-a-v Dec 22, 2020
c5461f6
+ethernet tcp client example in w5500 library examples
d-a-v Dec 22, 2020
90f434f
add cores/esp8266/Lwip* files under AllmanStyle control
d-a-v Dec 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add missing files (ppp)
  • Loading branch information
d-a-v committed Oct 30, 2019
commit d9d93390d7044e52fcd14376c2515270aeb2ad3f
182 changes: 182 additions & 0 deletions tools/sdk/lwip2/include/netif/ppp/fsm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
/*
* fsm.h - {Link, IP} Control Protocol Finite State Machine definitions.
*
* Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The name "Carnegie Mellon University" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For permission or any legal
* details, please contact
* Office of Technology Transfer
* Carnegie Mellon University
* 5000 Forbes Avenue
* Pittsburgh, PA 15213-3890
* (412) 268-4387, fax: (412) 268-7395
* [email protected]
*
* 4. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Computing Services
* at Carnegie Mellon University (https://www.cmu.edu/computing/)."
*
* CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Id: fsm.h,v 1.10 2004/11/13 02:28:15 paulus Exp $
*/

#include "netif/ppp/ppp_opts.h"
#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */

#ifndef FSM_H
#define FSM_H

#include "ppp.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
* Packet header = Code, id, length.
*/
#define HEADERLEN 4


/*
* CP (LCP, IPCP, etc.) codes.
*/
#define CONFREQ 1 /* Configuration Request */
#define CONFACK 2 /* Configuration Ack */
#define CONFNAK 3 /* Configuration Nak */
#define CONFREJ 4 /* Configuration Reject */
#define TERMREQ 5 /* Termination Request */
#define TERMACK 6 /* Termination Ack */
#define CODEREJ 7 /* Code Reject */


/*
* Each FSM is described by an fsm structure and fsm callbacks.
*/
typedef struct fsm {
ppp_pcb *pcb; /* PPP Interface */
const struct fsm_callbacks *callbacks; /* Callback routines */
const char *term_reason; /* Reason for closing protocol */
u8_t seen_ack; /* Have received valid Ack/Nak/Rej to Req */
/* -- This is our only flag, we might use u_int :1 if we have more flags */
u16_t protocol; /* Data Link Layer Protocol field value */
u8_t state; /* State */
u8_t flags; /* Contains option bits */
u8_t id; /* Current id */
u8_t reqid; /* Current request id */
u8_t retransmits; /* Number of retransmissions left */
u8_t nakloops; /* Number of nak loops since last ack */
u8_t rnakloops; /* Number of naks received */
u8_t maxnakloops; /* Maximum number of nak loops tolerated
(necessary because IPCP require a custom large max nak loops value) */
u8_t term_reason_len; /* Length of term_reason */
} fsm;


typedef struct fsm_callbacks {
void (*resetci) /* Reset our Configuration Information */
(fsm *);
int (*cilen) /* Length of our Configuration Information */
(fsm *);
void (*addci) /* Add our Configuration Information */
(fsm *, u_char *, int *);
int (*ackci) /* ACK our Configuration Information */
(fsm *, u_char *, int);
int (*nakci) /* NAK our Configuration Information */
(fsm *, u_char *, int, int);
int (*rejci) /* Reject our Configuration Information */
(fsm *, u_char *, int);
int (*reqci) /* Request peer's Configuration Information */
(fsm *, u_char *, int *, int);
void (*up) /* Called when fsm reaches PPP_FSM_OPENED state */
(fsm *);
void (*down) /* Called when fsm leaves PPP_FSM_OPENED state */
(fsm *);
void (*starting) /* Called when we want the lower layer */
(fsm *);
void (*finished) /* Called when we don't want the lower layer */
(fsm *);
void (*protreject) /* Called when Protocol-Reject received */
(int);
void (*retransmit) /* Retransmission is necessary */
(fsm *);
int (*extcode) /* Called when unknown code received */
(fsm *, int, int, u_char *, int);
const char *proto_name; /* String name for protocol (for messages) */
} fsm_callbacks;


/*
* Link states.
*/
#define PPP_FSM_INITIAL 0 /* Down, hasn't been opened */
#define PPP_FSM_STARTING 1 /* Down, been opened */
#define PPP_FSM_CLOSED 2 /* Up, hasn't been opened */
#define PPP_FSM_STOPPED 3 /* Open, waiting for down event */
#define PPP_FSM_CLOSING 4 /* Terminating the connection, not open */
#define PPP_FSM_STOPPING 5 /* Terminating, but open */
#define PPP_FSM_REQSENT 6 /* We've sent a Config Request */
#define PPP_FSM_ACKRCVD 7 /* We've received a Config Ack */
#define PPP_FSM_ACKSENT 8 /* We've sent a Config Ack */
#define PPP_FSM_OPENED 9 /* Connection available */


/*
* Flags - indicate options controlling FSM operation
*/
#define OPT_PASSIVE 1 /* Don't die if we don't get a response */
#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */
#define OPT_SILENT 4 /* Wait for peer to speak first */


/*
* Timeouts.
*/
#if 0 /* moved to ppp_opts.h */
#define DEFTIMEOUT 3 /* Timeout time in seconds */
#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */
#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */
#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */
#endif /* moved to ppp_opts.h */


/*
* Prototypes
*/
void fsm_init(fsm *f);
void fsm_lowerup(fsm *f);
void fsm_lowerdown(fsm *f);
void fsm_open(fsm *f);
void fsm_close(fsm *f, const char *reason);
void fsm_input(fsm *f, u_char *inpacket, int l);
void fsm_protreject(fsm *f);
void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen);

#ifdef __cplusplus
}
#endif

#endif /* FSM_H */
#endif /* PPP_SUPPORT */
134 changes: 134 additions & 0 deletions tools/sdk/lwip2/include/netif/ppp/ipcp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*
* ipcp.h - IP Control Protocol definitions.
*
* Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The name "Carnegie Mellon University" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For permission or any legal
* details, please contact
* Office of Technology Transfer
* Carnegie Mellon University
* 5000 Forbes Avenue
* Pittsburgh, PA 15213-3890
* (412) 268-4387, fax: (412) 268-7395
* [email protected]
*
* 4. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Computing Services
* at Carnegie Mellon University (https://www.cmu.edu/computing/)."
*
* CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $Id: ipcp.h,v 1.14 2002/12/04 23:03:32 paulus Exp $
*/

#include "netif/ppp/ppp_opts.h"
#if PPP_SUPPORT && PPP_IPV4_SUPPORT /* don't build if not configured for use in lwipopts.h */

#ifndef IPCP_H
#define IPCP_H

#ifdef __cplusplus
extern "C" {
#endif

/*
* Options.
*/
#define CI_ADDRS 1 /* IP Addresses */
#if VJ_SUPPORT
#define CI_COMPRESSTYPE 2 /* Compression Type */
#endif /* VJ_SUPPORT */
#define CI_ADDR 3

#if LWIP_DNS
#define CI_MS_DNS1 129 /* Primary DNS value */
#define CI_MS_DNS2 131 /* Secondary DNS value */
#endif /* LWIP_DNS */
#if 0 /* UNUSED - WINS */
#define CI_MS_WINS1 130 /* Primary WINS value */
#define CI_MS_WINS2 132 /* Secondary WINS value */
#endif /* UNUSED - WINS */

#if VJ_SUPPORT
#define MAX_STATES 16 /* from slcompress.h */

#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */
#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */
#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */
/* maxslot and slot number compression) */

#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/
#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */
/* compression option*/
#endif /* VJ_SUPPORT */

typedef struct ipcp_options {
unsigned int neg_addr :1; /* Negotiate IP Address? */
unsigned int old_addrs :1; /* Use old (IP-Addresses) option? */
unsigned int req_addr :1; /* Ask peer to send IP address? */
#if 0 /* UNUSED */
unsigned int default_route :1; /* Assign default route through interface? */
unsigned int replace_default_route :1; /* Replace default route through interface? */
#endif /* UNUSED */
#if 0 /* UNUSED - PROXY ARP */
unsigned int proxy_arp :1; /* Make proxy ARP entry for peer? */
#endif /* UNUSED - PROXY ARP */
#if VJ_SUPPORT
unsigned int neg_vj :1; /* Van Jacobson Compression? */
unsigned int old_vj :1; /* use old (short) form of VJ option? */
unsigned int cflag :1;
#endif /* VJ_SUPPORT */
unsigned int accept_local :1; /* accept peer's value for ouraddr */
unsigned int accept_remote :1; /* accept peer's value for hisaddr */
#if LWIP_DNS
unsigned int req_dns1 :1; /* Ask peer to send primary DNS address? */
unsigned int req_dns2 :1; /* Ask peer to send secondary DNS address? */
#endif /* LWIP_DNS */

u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
#if LWIP_DNS
u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */
#endif /* LWIP_DNS */
#if 0 /* UNUSED - WINS */
u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */
#endif /* UNUSED - WINS */

#if VJ_SUPPORT
u16_t vj_protocol; /* protocol value to use in VJ option */
u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */
#endif /* VJ_SUPPORT */
} ipcp_options;

#if 0 /* UNUSED, already defined by lwIP */
char *ip_ntoa (u32_t);
#endif /* UNUSED, already defined by lwIP */

extern const struct protent ipcp_protent;

#ifdef __cplusplus
}
#endif

#endif /* IPCP_H */
#endif /* PPP_SUPPORT && PPP_IPV4_SUPPORT */
Loading