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