Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
d77666c0
Commit
d77666c0
authored
Feb 17, 2019
by
sergio
Committed by
Terry Ellison
Feb 17, 2019
Browse files
trailing spaces cleanup (#2659)
parent
d7583040
Changes
380
Hide whitespace changes
Inline
Side-by-side
app/fatfs/ffunicode.c
View file @
d77666c0
This source diff could not be displayed because it is too large. You can
view the blob
instead.
app/http/Makefile
View file @
d77666c0
...
@@ -24,7 +24,7 @@ STD_CFLAGS=-std=gnu11 -Wimplicit
...
@@ -24,7 +24,7 @@ STD_CFLAGS=-std=gnu11 -Wimplicit
# makefile at its root level - these are then overridden
# makefile at its root level - these are then overridden
# for a subtree within the makefile rooted therein
# for a subtree within the makefile rooted therein
#
#
#DEFINES +=
#DEFINES +=
#############################################################
#############################################################
# Recursion Magic - Don't touch this!!
# Recursion Magic - Don't touch this!!
...
...
app/http/httpclient.c
View file @
d77666c0
...
@@ -171,7 +171,7 @@ static void ICACHE_FLASH_ATTR http_send_callback( void * arg )
...
@@ -171,7 +171,7 @@ static void ICACHE_FLASH_ATTR http_send_callback( void * arg )
{
{
HTTPCLIENT_DEBUG
(
"All sent"
);
HTTPCLIENT_DEBUG
(
"All sent"
);
}
}
else
else
{
{
/* The headers were sent, now send the contents. */
/* The headers were sent, now send the contents. */
HTTPCLIENT_DEBUG
(
"Sending request body"
);
HTTPCLIENT_DEBUG
(
"Sending request body"
);
...
@@ -324,7 +324,7 @@ static void ICACHE_FLASH_ATTR http_disconnect_callback( void * arg )
...
@@ -324,7 +324,7 @@ static void ICACHE_FLASH_ATTR http_disconnect_callback( void * arg )
{
{
HTTPCLIENT_ERR
(
"Invalid version in %s"
,
req
->
buffer
);
HTTPCLIENT_ERR
(
"Invalid version in %s"
,
req
->
buffer
);
}
}
else
else
{
{
http_status
=
atoi
(
req
->
buffer
+
strlen
(
version_1_0
)
);
http_status
=
atoi
(
req
->
buffer
+
strlen
(
version_1_0
)
);
...
@@ -470,7 +470,7 @@ static void ICACHE_FLASH_ATTR http_timeout_callback( void *arg )
...
@@ -470,7 +470,7 @@ static void ICACHE_FLASH_ATTR http_timeout_callback( void *arg )
else
else
#endif
#endif
result
=
espconn_disconnect
(
conn
);
result
=
espconn_disconnect
(
conn
);
if
(
result
==
ESPCONN_OK
||
result
==
ESPCONN_INPROGRESS
)
if
(
result
==
ESPCONN_OK
||
result
==
ESPCONN_INPROGRESS
)
return
;
return
;
else
else
...
@@ -478,7 +478,7 @@ static void ICACHE_FLASH_ATTR http_timeout_callback( void *arg )
...
@@ -478,7 +478,7 @@ static void ICACHE_FLASH_ATTR http_timeout_callback( void *arg )
/* not connected; execute the callback ourselves. */
/* not connected; execute the callback ourselves. */
HTTPCLIENT_DEBUG
(
"manually Calling disconnect callback due to error %d"
,
result
);
HTTPCLIENT_DEBUG
(
"manually Calling disconnect callback due to error %d"
,
result
);
http_disconnect_callback
(
arg
);
http_disconnect_callback
(
arg
);
}
}
}
}
...
@@ -502,7 +502,7 @@ static void ICACHE_FLASH_ATTR http_dns_callback( const char * hostname, ip_addr_
...
@@ -502,7 +502,7 @@ static void ICACHE_FLASH_ATTR http_dns_callback( const char * hostname, ip_addr_
}
}
http_free_req
(
req
);
http_free_req
(
req
);
}
}
else
else
{
{
HTTPCLIENT_DEBUG
(
"DNS found %s "
IPSTR
,
hostname
,
IP2STR
(
addr
)
);
HTTPCLIENT_DEBUG
(
"DNS found %s "
IPSTR
,
hostname
,
IP2STR
(
addr
)
);
...
@@ -531,8 +531,8 @@ static void ICACHE_FLASH_ATTR http_dns_callback( const char * hostname, ip_addr_
...
@@ -531,8 +531,8 @@ static void ICACHE_FLASH_ATTR http_dns_callback( const char * hostname, ip_addr_
if
(
req
->
secure
)
if
(
req
->
secure
)
{
{
espconn_secure_connect
(
conn
);
espconn_secure_connect
(
conn
);
}
}
else
else
#endif
#endif
{
{
espconn_connect
(
conn
);
espconn_connect
(
conn
);
...
@@ -575,7 +575,7 @@ void ICACHE_FLASH_ATTR http_raw_request( const char * hostname, int port, bool s
...
@@ -575,7 +575,7 @@ void ICACHE_FLASH_ATTR http_raw_request( const char * hostname, int port, bool s
/* Already in the local names table (or hostname was an IP address), execute the callback ourselves. */
/* Already in the local names table (or hostname was an IP address), execute the callback ourselves. */
http_dns_callback
(
hostname
,
&
addr
,
req
);
http_dns_callback
(
hostname
,
&
addr
,
req
);
}
}
else
else
{
{
if
(
error
==
ESPCONN_ARG
)
if
(
error
==
ESPCONN_ARG
)
{
{
...
@@ -614,8 +614,8 @@ void ICACHE_FLASH_ATTR http_request( const char * url, const char * method, cons
...
@@ -614,8 +614,8 @@ void ICACHE_FLASH_ATTR http_request( const char * url, const char * method, cons
port
=
443
;
port
=
443
;
secure
=
true
;
secure
=
true
;
url
+=
strlen
(
"https://"
);
/* Get rid of the protocol. */
url
+=
strlen
(
"https://"
);
/* Get rid of the protocol. */
}
}
else
else
{
{
HTTPCLIENT_ERR
(
"URL is not HTTP or HTTPS %s"
,
url
);
HTTPCLIENT_ERR
(
"URL is not HTTP or HTTPS %s"
,
url
);
return
;
return
;
...
@@ -643,7 +643,7 @@ void ICACHE_FLASH_ATTR http_request( const char * url, const char * method, cons
...
@@ -643,7 +643,7 @@ void ICACHE_FLASH_ATTR http_request( const char * url, const char * method, cons
os_memcpy
(
hostname
,
url
,
path
-
url
);
os_memcpy
(
hostname
,
url
,
path
-
url
);
hostname
[
path
-
url
]
=
'\0'
;
hostname
[
path
-
url
]
=
'\0'
;
}
}
else
else
{
{
port
=
atoi
(
colon
+
1
);
port
=
atoi
(
colon
+
1
);
if
(
port
==
0
)
if
(
port
==
0
)
...
...
app/include/arch/cc.h
View file @
d77666c0
/*
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* modification, are permitted provided that the following conditions
* are met:
* are met:
* 1. Redistributions of source code must retain the above copyright
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* SUCH DAMAGE.
*
*
* This file is part of the lwIP TCP/IP stack.
* This file is part of the lwIP TCP/IP stack.
*
*
* Author: Adam Dunkels <adam@sics.se>
* Author: Adam Dunkels <adam@sics.se>
*
*
*/
*/
...
...
app/include/arch/perf.h
View file @
d77666c0
/*
/*
* Copyright (c) 2001, Swedish Institute of Computer Science.
* Copyright (c) 2001, Swedish Institute of Computer Science.
* All rights reserved.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* modification, are permitted provided that the following conditions
* are met:
* are met:
* 1. Redistributions of source code must retain the above copyright
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* SUCH DAMAGE.
*
*
* This file is part of the lwIP TCP/IP stack.
* This file is part of the lwIP TCP/IP stack.
*
*
* Author: Adam Dunkels <adam@sics.se>
* Author: Adam Dunkels <adam@sics.se>
*
*
*/
*/
...
...
app/include/driver/spi.h
View file @
d77666c0
...
@@ -47,7 +47,7 @@ void spi_byte_read_espslave(uint8 spi_no,uint8 *data);
...
@@ -47,7 +47,7 @@ void spi_byte_read_espslave(uint8 spi_no,uint8 *data);
void
spi_slave_init
(
uint8
spi_no
);
void
spi_slave_init
(
uint8
spi_no
);
//esp8266 slave isr handle funtion,tiggered when any transmission is finished.
//esp8266 slave isr handle funtion,tiggered when any transmission is finished.
//the function is registered in spi_slave_init.
//the function is registered in spi_slave_init.
void
spi_slave_isr_handler
(
void
*
para
);
void
spi_slave_isr_handler
(
void
*
para
);
//hspi test function, used to test esp8266 spi slave
//hspi test function, used to test esp8266 spi slave
...
...
app/include/driver/uart.h
View file @
d77666c0
...
@@ -106,7 +106,7 @@ typedef struct {
...
@@ -106,7 +106,7 @@ typedef struct {
UartBautRate
baut_rate
;
UartBautRate
baut_rate
;
UartBitsNum4Char
data_bits
;
UartBitsNum4Char
data_bits
;
UartExistParity
exist_parity
;
UartExistParity
exist_parity
;
UartParityMode
parity
;
UartParityMode
parity
;
UartStopBitsNum
stop_bits
;
UartStopBitsNum
stop_bits
;
}
UartConfig
;
}
UartConfig
;
...
...
app/include/lwip/api.h
View file @
d77666c0
/*
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright notice,
...
@@ -11,21 +11,21 @@
...
@@ -11,21 +11,21 @@
* this list of conditions and the following disclaimer in the documentation
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* derived from this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
* OF SUCH DAMAGE.
*
*
* This file is part of the lwIP TCP/IP stack.
* This file is part of the lwIP TCP/IP stack.
*
*
* Author: Adam Dunkels <adam@sics.se>
* Author: Adam Dunkels <adam@sics.se>
*
*
*/
*/
...
...
app/include/lwip/api_msg.h
View file @
d77666c0
/*
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright notice,
...
@@ -11,21 +11,21 @@
...
@@ -11,21 +11,21 @@
* this list of conditions and the following disclaimer in the documentation
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* derived from this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
* OF SUCH DAMAGE.
*
*
* This file is part of the lwIP TCP/IP stack.
* This file is part of the lwIP TCP/IP stack.
*
*
* Author: Adam Dunkels <adam@sics.se>
* Author: Adam Dunkels <adam@sics.se>
*
*
*/
*/
...
...
app/include/lwip/app/dhcpserver.h
View file @
d77666c0
#ifndef __DHCPS_H__
#ifndef __DHCPS_H__
#define __DHCPS_H__
#define __DHCPS_H__
#include "lwipopts.h"
#include "lwipopts.h"
#define USE_DNS
#define USE_DNS
typedef
struct
dhcps_state
{
typedef
struct
dhcps_state
{
sint16_t
state
;
sint16_t
state
;
}
dhcps_state
;
}
dhcps_state
;
// ����dhcpclient�Զ����һ��DHCP msg�ṹ��
// ����dhcpclient�Զ����һ��DHCP msg�ṹ��
typedef
struct
dhcps_msg
{
typedef
struct
dhcps_msg
{
uint8_t
op
,
htype
,
hlen
,
hops
;
uint8_t
op
,
htype
,
hlen
,
hops
;
uint8_t
xid
[
4
];
uint8_t
xid
[
4
];
uint16_t
secs
,
flags
;
uint16_t
secs
,
flags
;
uint8_t
ciaddr
[
4
];
uint8_t
ciaddr
[
4
];
uint8_t
yiaddr
[
4
];
uint8_t
yiaddr
[
4
];
uint8_t
siaddr
[
4
];
uint8_t
siaddr
[
4
];
uint8_t
giaddr
[
4
];
uint8_t
giaddr
[
4
];
uint8_t
chaddr
[
16
];
uint8_t
chaddr
[
16
];
uint8_t
sname
[
64
];
uint8_t
sname
[
64
];
uint8_t
file
[
128
];
uint8_t
file
[
128
];
uint8_t
options
[
312
];
uint8_t
options
[
312
];
}
dhcps_msg
;
}
dhcps_msg
;
#ifndef LWIP_OPEN_SRC
#ifndef LWIP_OPEN_SRC
struct
dhcps_lease
{
struct
dhcps_lease
{
bool
enable
;
bool
enable
;
struct
ip_addr
start_ip
;
struct
ip_addr
start_ip
;
struct
ip_addr
end_ip
;
struct
ip_addr
end_ip
;
};
};
enum
dhcps_offer_option
{
enum
dhcps_offer_option
{
OFFER_START
=
0x00
,
OFFER_START
=
0x00
,
OFFER_ROUTER
=
0x01
,
OFFER_ROUTER
=
0x01
,
OFFER_END
OFFER_END
};
};
#endif
#endif
typedef
enum
{
typedef
enum
{
DHCPS_TYPE_DYNAMIC
,
DHCPS_TYPE_DYNAMIC
,
DHCPS_TYPE_STATIC
DHCPS_TYPE_STATIC
}
dhcps_type_t
;
}
dhcps_type_t
;
typedef
enum
{
typedef
enum
{
DHCPS_STATE_ONLINE
,
DHCPS_STATE_ONLINE
,
DHCPS_STATE_OFFLINE
DHCPS_STATE_OFFLINE
}
dhcps_state_t
;
}
dhcps_state_t
;
struct
dhcps_pool
{
struct
dhcps_pool
{
struct
ip_addr
ip
;
struct
ip_addr
ip
;
uint8
mac
[
6
];
uint8
mac
[
6
];
uint32
lease_timer
;
uint32
lease_timer
;
dhcps_type_t
type
;
dhcps_type_t
type
;
dhcps_state_t
state
;
dhcps_state_t
state
;
};
};
typedef
struct
_list_node
{
typedef
struct
_list_node
{
void
*
pnode
;
void
*
pnode
;
struct
_list_node
*
pnext
;
struct
_list_node
*
pnext
;
}
list_node
;
}
list_node
;
extern
uint32
dhcps_lease_time
;
extern
uint32
dhcps_lease_time
;
#define DHCPS_LEASE_TIMER dhcps_lease_time //0x05A0
#define DHCPS_LEASE_TIMER dhcps_lease_time //0x05A0
#define DHCPS_MAX_LEASE 0x64
#define DHCPS_MAX_LEASE 0x64
#define BOOTP_BROADCAST 0x8000
#define BOOTP_BROADCAST 0x8000
#define DHCP_REQUEST 1
#define DHCP_REQUEST 1
#define DHCP_REPLY 2
#define DHCP_REPLY 2
#define DHCP_HTYPE_ETHERNET 1
#define DHCP_HTYPE_ETHERNET 1
#define DHCP_HLEN_ETHERNET 6
#define DHCP_HLEN_ETHERNET 6
#define DHCP_MSG_LEN 236
#define DHCP_MSG_LEN 236
#define DHCPS_SERVER_PORT 67
#define DHCPS_SERVER_PORT 67
#define DHCPS_CLIENT_PORT 68
#define DHCPS_CLIENT_PORT 68
#define DHCPDISCOVER 1
#define DHCPDISCOVER 1
#define DHCPOFFER 2
#define DHCPOFFER 2
#define DHCPREQUEST 3
#define DHCPREQUEST 3
#define DHCPDECLINE 4
#define DHCPDECLINE 4
#define DHCPACK 5
#define DHCPACK 5
#define DHCPNAK 6
#define DHCPNAK 6
#define DHCPRELEASE 7
#define DHCPRELEASE 7
#define DHCP_OPTION_SUBNET_MASK 1
#define DHCP_OPTION_SUBNET_MASK 1
#define DHCP_OPTION_ROUTER 3
#define DHCP_OPTION_ROUTER 3
#define DHCP_OPTION_DNS_SERVER 6
#define DHCP_OPTION_DNS_SERVER 6
#define DHCP_OPTION_REQ_IPADDR 50
#define DHCP_OPTION_REQ_IPADDR 50
#define DHCP_OPTION_LEASE_TIME 51
#define DHCP_OPTION_LEASE_TIME 51
#define DHCP_OPTION_MSG_TYPE 53
#define DHCP_OPTION_MSG_TYPE 53
#define DHCP_OPTION_SERVER_ID 54
#define DHCP_OPTION_SERVER_ID 54
#define DHCP_OPTION_INTERFACE_MTU 26
#define DHCP_OPTION_INTERFACE_MTU 26
#define DHCP_OPTION_PERFORM_ROUTER_DISCOVERY 31
#define DHCP_OPTION_PERFORM_ROUTER_DISCOVERY 31
#define DHCP_OPTION_BROADCAST_ADDRESS 28
#define DHCP_OPTION_BROADCAST_ADDRESS 28
#define DHCP_OPTION_REQ_LIST 55
#define DHCP_OPTION_REQ_LIST 55
#define DHCP_OPTION_END 255
#define DHCP_OPTION_END 255
//#define USE_CLASS_B_NET 1
//#define USE_CLASS_B_NET 1
#define DHCPS_DEBUG 0
#define DHCPS_DEBUG 0
#define MAX_STATION_NUM 8
#define MAX_STATION_NUM 8
#define DHCPS_STATE_OFFER 1
#define DHCPS_STATE_OFFER 1
#define DHCPS_STATE_DECLINE 2
#define DHCPS_STATE_DECLINE 2
#define DHCPS_STATE_ACK 3
#define DHCPS_STATE_ACK 3
#define DHCPS_STATE_NAK 4
#define DHCPS_STATE_NAK 4
#define DHCPS_STATE_IDLE 5
#define DHCPS_STATE_IDLE 5
#define DHCPS_STATE_RELEASE 6
#define DHCPS_STATE_RELEASE 6
#define dhcps_router_enabled(offer) ((offer & OFFER_ROUTER) != 0)
#define dhcps_router_enabled(offer) ((offer & OFFER_ROUTER) != 0)
void
dhcps_start
(
struct
ip_info
*
info
);
void
dhcps_start
(
struct
ip_info
*
info
);
void
dhcps_stop
(
void
);
void
dhcps_stop
(
void
);
#endif
#endif
app/include/lwip/app/espconn.h
View file @
d77666c0
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
#if 0
#if 0
#define espconn_printf(fmt, args...) os_printf(fmt,## args)
#define espconn_printf(fmt, args...) os_printf(fmt,## args)
#else
#else
#define espconn_printf(fmt, args...)
#define espconn_printf(fmt, args...)
#endif
#endif
...
@@ -468,7 +468,7 @@ extern sint8 espconn_regist_time(struct espconn *espconn, uint32 interval, uint8
...
@@ -468,7 +468,7 @@ extern sint8 espconn_regist_time(struct espconn *espconn, uint32 interval, uint8
* Description : Used to specify the function that should be called when data
* Description : Used to specify the function that should be called when data
* has been successfully delivered to the remote host.
* has been successfully delivered to the remote host.
* Parameters : struct espconn *espconn -- espconn to set the sent callback
* Parameters : struct espconn *espconn -- espconn to set the sent callback
* espconn_sent_callback sent_cb -- sent callback function to
* espconn_sent_callback sent_cb -- sent callback function to
* call for this espconn when data is successfully sent
* call for this espconn when data is successfully sent
* Returns : none
* Returns : none
*******************************************************************************/
*******************************************************************************/
...
@@ -510,10 +510,10 @@ extern sint8 espconn_sent(struct espconn *espconn, uint8 *psent, uint16 length);
...
@@ -510,10 +510,10 @@ extern sint8 espconn_sent(struct espconn *espconn, uint8 *psent, uint16 length);
/******************************************************************************
/******************************************************************************
* FunctionName : espconn_regist_connectcb
* FunctionName : espconn_regist_connectcb
* Description : used to specify the function that should be called when
* Description : used to specify the function that should be called when
* connects to host.
* connects to host.
* Parameters : espconn -- espconn to set the connect callback
* Parameters : espconn -- espconn to set the connect callback
* connect_cb -- connected callback function to call when connected
* connect_cb -- connected callback function to call when connected
* Returns : none
* Returns : none
*******************************************************************************/
*******************************************************************************/
...
@@ -521,9 +521,9 @@ extern sint8 espconn_regist_connectcb(struct espconn *espconn, espconn_connect_c
...
@@ -521,9 +521,9 @@ extern sint8 espconn_regist_connectcb(struct espconn *espconn, espconn_connect_c
/******************************************************************************
/******************************************************************************
* FunctionName : espconn_regist_recvcb
* FunctionName : espconn_regist_recvcb
* Description : used to specify the function that should be called when recv
* Description : used to specify the function that should be called when recv
* data from host.
* data from host.
* Parameters : espconn -- espconn to set the recv callback
* Parameters : espconn -- espconn to set the recv callback
* recv_cb -- recv callback function to call when recv data
* recv_cb -- recv callback function to call when recv data
* Returns : none
* Returns : none
*******************************************************************************/
*******************************************************************************/
...
@@ -532,10 +532,10 @@ extern sint8 espconn_regist_recvcb(struct espconn *espconn, espconn_recv_callbac
...
@@ -532,10 +532,10 @@ extern sint8 espconn_regist_recvcb(struct espconn *espconn, espconn_recv_callbac
/******************************************************************************
/******************************************************************************
* FunctionName : espconn_regist_reconcb
* FunctionName : espconn_regist_reconcb
* Description : used to specify the function that should be called when connection
* Description : used to specify the function that should be called when connection
* because of err disconnect.
* because of err disconnect.
* Parameters : espconn -- espconn to set the err callback
* Parameters : espconn -- espconn to set the err callback
* recon_cb -- err callback function to call when err
* recon_cb -- err callback function to call when err
* Returns : none
* Returns : none
*******************************************************************************/
*******************************************************************************/
...
@@ -596,7 +596,7 @@ extern sint8 espconn_get_keepalive(struct espconn *espconn, uint8 level, void *o
...
@@ -596,7 +596,7 @@ extern sint8 espconn_get_keepalive(struct espconn *espconn, uint8 level, void *o
* Description : Resolve a hostname (string) into an IP address.
* Description : Resolve a hostname (string) into an IP address.
* Parameters : pespconn -- espconn to resolve a hostname
* Parameters : pespconn -- espconn to resolve a hostname
* hostname -- the hostname that is to be queried
* hostname -- the hostname that is to be queried
* addr -- pointer to a ip_addr_t where to store the address if
* addr -- pointer to a ip_addr_t where to store the address if
* it is already cached in the dns_table (only valid if
* it is already cached in the dns_table (only valid if
* ESPCONN_OK is returned!)
* ESPCONN_OK is returned!)
* found -- a callback function to be called on success, failure
* found -- a callback function to be called on success, failure
...
...
app/include/lwip/app/espconn_tcp.h
View file @
d77666c0
#ifndef __ESPCONN_TCP_H__
#ifndef __ESPCONN_TCP_H__
#define __ESPCONN_TCP_H__
#define __ESPCONN_TCP_H__
#ifndef ESPCONN_TCP_DEBUG
#ifndef ESPCONN_TCP_DEBUG
#define ESPCONN_TCP_DEBUG LWIP_DBG_OFF
#define ESPCONN_TCP_DEBUG LWIP_DBG_OFF
#endif
#endif
#include "lwip/app/espconn.h"
#include "lwip/app/espconn.h"
#ifndef ESPCONN_TCP_TIMER
#ifndef ESPCONN_TCP_TIMER
#define ESPCONN_TCP_TIMER 40
#define ESPCONN_TCP_TIMER 40
#endif
#endif
#define espconn_keepalive_enable(pcb) ((pcb)->so_options |= SOF_KEEPALIVE)
#define espconn_keepalive_enable(pcb) ((pcb)->so_options |= SOF_KEEPALIVE)
#define espconn_keepalive_disable(pcb) ((pcb)->so_options &= ~SOF_KEEPALIVE)
#define espconn_keepalive_disable(pcb) ((pcb)->so_options &= ~SOF_KEEPALIVE)
#define espconn_manual_recv_disabled(espconn) (((espconn)->pcommon.espconn_opt & ESPCONN_MANUALRECV) != 0)
#define espconn_manual_recv_disabled(espconn) (((espconn)->pcommon.espconn_opt & ESPCONN_MANUALRECV) != 0)
#define espconn_manual_recv_enabled(espconn) (((espconn)->pcommon.espconn_opt & ESPCONN_MANUALRECV) == 0)
#define espconn_manual_recv_enabled(espconn) (((espconn)->pcommon.espconn_opt & ESPCONN_MANUALRECV) == 0)
/******************************************************************************
/******************************************************************************
* FunctionName : espconn_kill_oldest_pcb
* FunctionName : espconn_kill_oldest_pcb
* Description : A oldest incoming connection has been killed.
* Description : A oldest incoming connection has been killed.
* Parameters : none
* Parameters : none
* Returns : none
* Returns : none
*******************************************************************************/
*******************************************************************************/
extern
void
espconn_kill_oldest_pcb
(
void
);
extern
void
espconn_kill_oldest_pcb
(
void
);
/******************************************************************************
/******************************************************************************
* FunctionName : espconn_tcp_disconnect
* FunctionName : espconn_tcp_disconnect
* Description : A new incoming connection has been disconnected.
* Description : A new incoming connection has been disconnected.
* Parameters : espconn -- the espconn used to disconnect with host
* Parameters : espconn -- the espconn used to disconnect with host
* Returns : none
* Returns : none
*******************************************************************************/
*******************************************************************************/
extern
void
espconn_tcp_disconnect
(
espconn_msg
*
pdiscon
,
u8
type
);
extern
void
espconn_tcp_disconnect
(
espconn_msg
*
pdiscon
,
u8
type
);
/******************************************************************************
/******************************************************************************
* FunctionName : espconn_tcp_client
* FunctionName : espconn_tcp_client
* Description : Initialize the client: set up a connect PCB and bind it to
* Description : Initialize the client: set up a connect PCB and bind it to
* the defined port
* the defined port
* Parameters : espconn -- the espconn used to build client
* Parameters : espconn -- the espconn used to build client
* Returns : none
* Returns : none
*******************************************************************************/
*******************************************************************************/
extern
sint8
espconn_tcp_client
(
struct
espconn
*
espconn
);
extern
sint8
espconn_tcp_client
(
struct
espconn
*
espconn
);
/******************************************************************************
/******************************************************************************
* FunctionName : espconn_tcp_server
* FunctionName : espconn_tcp_server
* Description : Initialize the server: set up a listening PCB and bind it to
* Description : Initialize the server: set up a listening PCB and bind it to
* the defined port
* the defined port
* Parameters : espconn -- the espconn used to build server
* Parameters : espconn -- the espconn used to build server
* Returns : none
* Returns : none
*******************************************************************************/
*******************************************************************************/
extern
sint8
espconn_tcp_server
(
struct
espconn
*
espconn
);
extern
sint8
espconn_tcp_server
(
struct
espconn
*
espconn
);
#endif
/* __CLIENT_TCP_H__ */
#endif
/* __CLIENT_TCP_H__ */
app/include/lwip/app/espconn_udp.h
View file @
d77666c0
#ifndef __ESPCONN_UDP_H__
#ifndef __ESPCONN_UDP_H__
#define __ESPCONN_UDP_H__
#define __ESPCONN_UDP_H__
#ifndef ESPCONN_UDP_DEBUG
#ifndef ESPCONN_UDP_DEBUG
#define ESPCONN_UDP_DEBUG LWIP_DBG_OFF
#define ESPCONN_UDP_DEBUG LWIP_DBG_OFF
#endif
#endif
#include "lwip/app/espconn.h"
#include "lwip/app/espconn.h"
/******************************************************************************
/******************************************************************************
* FunctionName : espconn_udp_client
* FunctionName : espconn_udp_client
* Description : Initialize the client: set up a PCB and bind it to the port
* Description : Initialize the client: set up a PCB and bind it to the port
* Parameters : pespconn -- the espconn used to build client
* Parameters : pespconn -- the espconn used to build client
* Returns : none
* Returns : none
*******************************************************************************/
*******************************************************************************/
extern
sint8
espconn_udp_client
(
struct
espconn
*
pespconn
);
extern
sint8
espconn_udp_client
(
struct
espconn
*
pespconn
);
/******************************************************************************
/******************************************************************************
* FunctionName : espconn_udp_disconnect
* FunctionName : espconn_udp_disconnect
* Description : A new incoming connection has been disconnected.
* Description : A new incoming connection has been disconnected.
* Parameters : espconn -- the espconn used to disconnect with host
* Parameters : espconn -- the espconn used to disconnect with host
* Returns : none
* Returns : none
*******************************************************************************/
*******************************************************************************/
extern
void
espconn_udp_disconnect
(
espconn_msg
*
pdiscon
);
extern
void
espconn_udp_disconnect
(
espconn_msg
*
pdiscon
);
/******************************************************************************
/******************************************************************************
* FunctionName : espconn_udp_server
* FunctionName : espconn_udp_server
* Description : Initialize the server: set up a PCB and bind it to the port
* Description : Initialize the server: set up a PCB and bind it to the port
* Parameters : pespconn -- the espconn used to build server
* Parameters : pespconn -- the espconn used to build server
* Returns : none
* Returns : none
*******************************************************************************/
*******************************************************************************/
extern
sint8
espconn_udp_server
(
struct
espconn
*
espconn
);
extern
sint8
espconn_udp_server
(
struct
espconn
*
espconn
);
/******************************************************************************
/******************************************************************************
* FunctionName : espconn_udp_sent
* FunctionName : espconn_udp_sent
* Description : sent data for client or server
* Description : sent data for client or server
* Parameters : void *arg -- client or server to send
* Parameters : void *arg -- client or server to send
* uint8* psent -- Data to send
* uint8* psent -- Data to send
* uint16 length -- Length of data to send
* uint16 length -- Length of data to send
* Returns : none
* Returns : none
*******************************************************************************/
*******************************************************************************/
extern
err_t
espconn_udp_sent
(
void
*
arg
,
uint8
*
psent
,
uint16
length
);
extern
err_t
espconn_udp_sent
(
void
*
arg
,
uint8
*
psent
,
uint16
length
);
/******************************************************************************
/******************************************************************************
* FunctionName : espconn_udp_sendto
* FunctionName : espconn_udp_sendto
* Description : sent data for UDP
* Description : sent data for UDP
* Parameters : void *arg -- UDP to send
* Parameters : void *arg -- UDP to send
* uint8* psent -- Data to send
* uint8* psent -- Data to send
* uint16 length -- Length of data to send
* uint16 length -- Length of data to send
* Returns : return espconn error code.
* Returns : return espconn error code.
* - ESPCONN_OK. Successful. No error occured.
* - ESPCONN_OK. Successful. No error occured.
* - ESPCONN_MEM. Out of memory.
* - ESPCONN_MEM. Out of memory.
* - ESPCONN_RTE. Could not find route to destination address.
* - ESPCONN_RTE. Could not find route to destination address.
* - More errors could be returned by lower protocol layers.
* - More errors could be returned by lower protocol layers.
*******************************************************************************/
*******************************************************************************/
extern
err_t
espconn_udp_sendto
(
void
*
arg
,
uint8
*
psent
,
uint16
length
);
extern
err_t
espconn_udp_sendto
(
void
*
arg
,
uint8
*
psent
,
uint16
length
);
#endif
/* __ESPCONN_UDP_H__ */
#endif
/* __ESPCONN_UDP_H__ */
app/include/lwip/arch.h
View file @
d77666c0
/*
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright notice,
...
@@ -11,21 +11,21 @@
...
@@ -11,21 +11,21 @@
* this list of conditions and the following disclaimer in the documentation
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* derived from this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
* OF SUCH DAMAGE.
*
*
* This file is part of the lwIP TCP/IP stack.
* This file is part of the lwIP TCP/IP stack.
*
*
* Author: Adam Dunkels <adam@sics.se>
* Author: Adam Dunkels <adam@sics.se>
*
*
*/
*/
...
@@ -71,7 +71,7 @@ extern "C" {
...
@@ -71,7 +71,7 @@ extern "C" {
#ifndef LWIP_UNUSED_ARG
#ifndef LWIP_UNUSED_ARG
#define LWIP_UNUSED_ARG(x) (void)x
#define LWIP_UNUSED_ARG(x) (void)x
#endif
/* LWIP_UNUSED_ARG */
#endif
/* LWIP_UNUSED_ARG */
#ifdef LWIP_PROVIDE_ERRNO
#ifdef LWIP_PROVIDE_ERRNO
...
...
app/include/lwip/autoip.h
View file @
d77666c0
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
* Please coordinate changes and requests with Dominik Spies
* Please coordinate changes and requests with Dominik Spies
* <kontakt@dspies.de>
* <kontakt@dspies.de>
*/
*/
#ifndef __LWIP_AUTOIP_H__
#ifndef __LWIP_AUTOIP_H__
#define __LWIP_AUTOIP_H__
#define __LWIP_AUTOIP_H__
...
...
app/include/lwip/debug.h
View file @
d77666c0
/*
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright notice,
...
@@ -11,21 +11,21 @@
...
@@ -11,21 +11,21 @@
* this list of conditions and the following disclaimer in the documentation
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* derived from this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
* OF SUCH DAMAGE.
*
*
* This file is part of the lwIP TCP/IP stack.
* This file is part of the lwIP TCP/IP stack.
*
*
* Author: Adam Dunkels <adam@sics.se>
* Author: Adam Dunkels <adam@sics.se>
*
*
*/
*/
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
#define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \
#define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \
LWIP_PLATFORM_ASSERT(message); } while(0)
LWIP_PLATFORM_ASSERT(message); } while(0)
#else
/* LWIP_NOASSERT */
#else
/* LWIP_NOASSERT */
#define LWIP_ASSERT(message, assertion)
#define LWIP_ASSERT(message, assertion)
#endif
/* LWIP_NOASSERT */
#endif
/* LWIP_NOASSERT */
/** if "expression" isn't true, then print "message" and execute "handler" expression */
/** if "expression" isn't true, then print "message" and execute "handler" expression */
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
} while(0)
} while(0)
#else
/* LWIP_DEBUG */
#else
/* LWIP_DEBUG */
#define LWIP_DEBUGF(debug, message)
#define LWIP_DEBUGF(debug, message)
#endif
/* LWIP_DEBUG */
#endif
/* LWIP_DEBUG */
#endif
/* __LWIP_DEBUG_H__ */
#endif
/* __LWIP_DEBUG_H__ */
...
...
app/include/lwip/def.h
View file @
d77666c0
/*
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright notice,
...
@@ -11,21 +11,21 @@
...
@@ -11,21 +11,21 @@
* this list of conditions and the following disclaimer in the documentation
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* derived from this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
* OF SUCH DAMAGE.
*
*
* This file is part of the lwIP TCP/IP stack.
* This file is part of the lwIP TCP/IP stack.
*
*
* Author: Adam Dunkels <adam@sics.se>
* Author: Adam Dunkels <adam@sics.se>
*
*
*/
*/
...
@@ -49,14 +49,14 @@ extern "C" {
...
@@ -49,14 +49,14 @@ extern "C" {
/** Get the absolute difference between 2 u32_t values (correcting overflows)
/** Get the absolute difference between 2 u32_t values (correcting overflows)
* 'a' is expected to be 'higher' (without overflow) than 'b'. */
* 'a' is expected to be 'higher' (without overflow) than 'b'. */
#define LWIP_U32_DIFF(a, b) (((a) >= (b)) ? ((a) - (b)) : (((a) + ((b) ^ 0xFFFFFFFF) + 1)))
#define LWIP_U32_DIFF(a, b) (((a) >= (b)) ? ((a) - (b)) : (((a) + ((b) ^ 0xFFFFFFFF) + 1)))
/* Endianess-optimized shifting of two u8_t to create one u16_t */
/* Endianess-optimized shifting of two u8_t to create one u16_t */
#if BYTE_ORDER == LITTLE_ENDIAN
#if BYTE_ORDER == LITTLE_ENDIAN
#define LWIP_MAKE_U16(a, b) ((a << 8) | b)
#define LWIP_MAKE_U16(a, b) ((a << 8) | b)
#else
#else
#define LWIP_MAKE_U16(a, b) ((b << 8) | a)
#define LWIP_MAKE_U16(a, b) ((b << 8) | a)
#endif
#endif
#ifndef LWIP_PLATFORM_BYTESWAP
#ifndef LWIP_PLATFORM_BYTESWAP
#define LWIP_PLATFORM_BYTESWAP 0
#define LWIP_PLATFORM_BYTESWAP 0
...
...
app/include/lwip/dhcp.h
View file @
d77666c0
...
@@ -16,11 +16,11 @@ extern "C" {
...
@@ -16,11 +16,11 @@ extern "C" {
#endif
#endif
/** period (in seconds) of the application calling dhcp_coarse_tmr() */
/** period (in seconds) of the application calling dhcp_coarse_tmr() */
#define DHCP_COARSE_TIMER_SECS 60
#define DHCP_COARSE_TIMER_SECS 60
/** period (in milliseconds) of the application calling dhcp_coarse_tmr() */
/** period (in milliseconds) of the application calling dhcp_coarse_tmr() */
#define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL)
#define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL)
/** period (in milliseconds) of the application calling dhcp_fine_tmr() */
/** period (in milliseconds) of the application calling dhcp_fine_tmr() */
#define DHCP_FINE_TIMER_MSECS 500
#define DHCP_FINE_TIMER_MSECS 500
#define DHCP_CHADDR_LEN 16U
#define DHCP_CHADDR_LEN 16U
#define DHCP_SNAME_LEN 64U
#define DHCP_SNAME_LEN 64U
...
@@ -28,9 +28,9 @@ extern "C" {
...
@@ -28,9 +28,9 @@ extern "C" {
struct
dhcp
struct
dhcp
{
{
/** transaction identifier of last sent request */
/** transaction identifier of last sent request */
u32_t
xid
;
u32_t
xid
;
/** our connection to the DHCP server */
/** our connection to the DHCP server */
struct
udp_pcb
*
pcb
;
struct
udp_pcb
*
pcb
;
/** incoming msg */
/** incoming msg */
struct
dhcp_msg
*
msg_in
;
struct
dhcp_msg
*
msg_in
;
...
@@ -53,7 +53,7 @@ struct dhcp
...
@@ -53,7 +53,7 @@ struct dhcp
ip_addr_t
offered_ip_addr
;
ip_addr_t
offered_ip_addr
;
ip_addr_t
offered_sn_mask
;
ip_addr_t
offered_sn_mask
;
ip_addr_t
offered_gw_addr
;
ip_addr_t
offered_gw_addr
;
u32_t
offered_t0_lease
;
/* lease period (in seconds) */
u32_t
offered_t0_lease
;
/* lease period (in seconds) */
u32_t
offered_t1_renew
;
/* recommended renew time (usually 50% of lease period) */
u32_t
offered_t1_renew
;
/* recommended renew time (usually 50% of lease period) */
u32_t
offered_t2_rebind
;
/* recommended rebind time (usually 66% of lease period) */
u32_t
offered_t2_rebind
;
/* recommended rebind time (usually 66% of lease period) */
...
@@ -132,7 +132,7 @@ void dhcp_arp_reply(struct netif *netif, ip_addr_t *addr);
...
@@ -132,7 +132,7 @@ void dhcp_arp_reply(struct netif *netif, ip_addr_t *addr);
void
dhcp_coarse_tmr
(
void
);
void
dhcp_coarse_tmr
(
void
);
/** to be called every half second */
/** to be called every half second */
void
dhcp_fine_tmr
(
void
);
void
dhcp_fine_tmr
(
void
);
/** DHCP message item offsets and length */
/** DHCP message item offsets and length */
#define DHCP_OP_OFS 0
#define DHCP_OP_OFS 0
#define DHCP_HTYPE_OFS 1
#define DHCP_HTYPE_OFS 1
...
@@ -153,7 +153,7 @@ void dhcp_fine_tmr(void);
...
@@ -153,7 +153,7 @@ void dhcp_fine_tmr(void);
#define DHCP_COOKIE_OFS DHCP_MSG_LEN
#define DHCP_COOKIE_OFS DHCP_MSG_LEN
#define DHCP_OPTIONS_OFS (DHCP_MSG_LEN + 4)
#define DHCP_OPTIONS_OFS (DHCP_MSG_LEN + 4)
#define DHCP_CLIENT_PORT 68
#define DHCP_CLIENT_PORT 68
#define DHCP_SERVER_PORT 67
#define DHCP_SERVER_PORT 67
/** DHCP client states */
/** DHCP client states */
...
@@ -174,7 +174,7 @@ void dhcp_fine_tmr(void);
...
@@ -174,7 +174,7 @@ void dhcp_fine_tmr(void);
/** AUTOIP cooperatation flags */
/** AUTOIP cooperatation flags */
#define DHCP_AUTOIP_COOP_STATE_OFF 0
#define DHCP_AUTOIP_COOP_STATE_OFF 0
#define DHCP_AUTOIP_COOP_STATE_ON 1
#define DHCP_AUTOIP_COOP_STATE_ON 1
#define DHCP_BOOTREQUEST 1
#define DHCP_BOOTREQUEST 1
#define DHCP_BOOTREPLY 2
#define DHCP_BOOTREPLY 2
...
@@ -199,7 +199,7 @@ void dhcp_fine_tmr(void);
...
@@ -199,7 +199,7 @@ void dhcp_fine_tmr(void);
#define DHCP_OPTION_PAD 0
#define DHCP_OPTION_PAD 0
#define DHCP_OPTION_SUBNET_MASK 1
/* RFC 2132 3.3 */
#define DHCP_OPTION_SUBNET_MASK 1
/* RFC 2132 3.3 */
#define DHCP_OPTION_ROUTER 3
#define DHCP_OPTION_ROUTER 3
#define DHCP_OPTION_DNS_SERVER 6
#define DHCP_OPTION_DNS_SERVER 6
#define DHCP_OPTION_HOSTNAME 12
#define DHCP_OPTION_HOSTNAME 12
#define DHCP_OPTION_IP_TTL 23
#define DHCP_OPTION_IP_TTL 23
#define DHCP_OPTION_MTU 26
#define DHCP_OPTION_MTU 26
...
...
app/include/lwip/dns.h
View file @
d77666c0
/**
/**
* lwip DNS resolver header file.
* lwip DNS resolver header file.
* Author: Jim Pettinato
* Author: Jim Pettinato
* April 2007
* April 2007
* ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels.
* ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels.
...
...
app/include/lwip/err.h
View file @
d77666c0
/*
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* 1. Redistributions of source code must retain the above copyright notice,
...
@@ -11,21 +11,21 @@
...
@@ -11,21 +11,21 @@
* this list of conditions and the following disclaimer in the documentation
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* derived from this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
* OF SUCH DAMAGE.
*
*
* This file is part of the lwIP TCP/IP stack.
* This file is part of the lwIP TCP/IP stack.
*
*
* Author: Adam Dunkels <adam@sics.se>
* Author: Adam Dunkels <adam@sics.se>
*
*
*/
*/
...
...
Prev
1
2
3
4
5
6
7
…
19
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment