NetUtils.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * NetUtils.h
8  *
9  ****/
10 
11 #pragma once
12 
13 #include <lwip/init.h>
14 
15 #if LWIP_VERSION_MAJOR == 2
16 #include "lwip/priv/tcp_priv.h"
17 #else
18 #include "lwip/tcp_impl.h"
19 #endif
20 
21 struct pbuf;
22 class String;
23 
28 namespace NetUtils
29 {
30 // Helpers
31 bool pbufIsStrEqual(const pbuf* buf, const char* compared, unsigned startPos);
32 int pbufFindChar(const pbuf* buf, char wtf, unsigned startPos = 0);
33 int pbufFindStr(const pbuf* buf, const char* wtf, unsigned startPos = 0);
34 char* pbufAllocateStrCopy(const pbuf* buf, unsigned startPos, unsigned length);
35 String pbufStrCopy(const pbuf* buf, unsigned startPos, unsigned length);
36 
37 #ifdef FIX_NETWORK_ROUTING
38 bool FixNetworkRouting();
39 #else
40 inline bool FixNetworkRouting()
41 {
42  return true; // Should work on standard lwip
43 }
44 #endif
45 
46 // Debug
47 void debugPrintTcpList();
48 
49 }; // namespace NetUtils
50 
bool FixNetworkRouting()
Definition: NetUtils.h:40
int pbufFindChar(const pbuf *buf, char wtf, unsigned startPos=0)
The String class.
Definition: WString.h:136
Definition: NetUtils.h:28
int pbufFindStr(const pbuf *buf, const char *wtf, unsigned startPos=0)
bool pbufIsStrEqual(const pbuf *buf, const char *compared, unsigned startPos)
String pbufStrCopy(const pbuf *buf, unsigned startPos, unsigned length)
char * pbufAllocateStrCopy(const pbuf *buf, unsigned startPos, unsigned length)
void debugPrintTcpList()