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 #ifdef ARCH_ESP8266
14 #include "lwip/tcp_impl.h"
15 #else
16 #include "lwip/priv/tcp_priv.h"
17 #endif
18 
19 struct pbuf;
20 class String;
21 
26 namespace NetUtils
27 {
28 // Helpers
29 bool pbufIsStrEqual(const pbuf* buf, const char* compared, unsigned startPos);
30 int pbufFindChar(const pbuf* buf, char wtf, unsigned startPos = 0);
31 int pbufFindStr(const pbuf* buf, const char* wtf, unsigned startPos = 0);
32 char* pbufAllocateStrCopy(const pbuf* buf, unsigned startPos, unsigned length);
33 String pbufStrCopy(const pbuf* buf, unsigned startPos, unsigned length);
34 
35 #ifdef FIX_NETWORK_ROUTING
36 bool FixNetworkRouting();
37 #else
38 inline bool FixNetworkRouting()
39 {
40  return true; // Should work on standard lwip
41 }
42 #endif
43 
44 // Debug
45 void debugPrintTcpList();
46 
47 }; // namespace NetUtils
48 
bool FixNetworkRouting()
Definition: NetUtils.h:38
The String class.
Definition: WString.h:136
char * pbufAllocateStrCopy(const pbuf *buf, unsigned startPos, unsigned length)
int pbufFindStr(const pbuf *buf, const char *wtf, unsigned startPos=0)
int pbufFindChar(const pbuf *buf, char wtf, unsigned startPos=0)
void debugPrintTcpList()
String pbufStrCopy(const pbuf *buf, unsigned startPos, unsigned length)
bool pbufIsStrEqual(const pbuf *buf, const char *compared, unsigned startPos)
Definition: NetUtils.h:26