From ac63f6153e4264628c8d3e39251fbb47b91277f8 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sat, 9 Jul 2022 12:34:28 +0200 Subject: [PATCH 1/5] add missing license headers --- cores/esp8266/LwipIntf.cpp | 23 +++++++++++++++++++++++ cores/esp8266/LwipIntf.h | 27 +++++++++++++++++++++++++++ cores/esp8266/LwipIntfCB.cpp | 23 +++++++++++++++++++++++ cores/esp8266/LwipIntfDev.h | 24 +++++++++++++++++++++++- 4 files changed, 96 insertions(+), 1 deletion(-) diff --git a/cores/esp8266/LwipIntf.cpp b/cores/esp8266/LwipIntf.cpp index 84e1969e95..3d4e106f3c 100644 --- a/cores/esp8266/LwipIntf.cpp +++ b/cores/esp8266/LwipIntf.cpp @@ -1,3 +1,26 @@ +/* + LwipIntf.cpp + + Arduino interface for lwIP generic callbacks and functions + + Original Copyright (c) 2020 esp8266 Arduino All rights reserved. + This file is part of the esp8266 Arduino core environment. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + extern "C" { diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h index 1eee25cce5..7a33f76192 100644 --- a/cores/esp8266/LwipIntf.h +++ b/cores/esp8266/LwipIntf.h @@ -1,3 +1,25 @@ +/* + LwipIntf.h + + Arduino interface for lwIP generic callbacks and functions + + Original Copyright (c) 2020 esp8266 Arduino All rights reserved. + This file is part of the esp8266 Arduino core environment. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ #ifndef _LWIPINTF_H #define _LWIPINTF_H @@ -28,16 +50,21 @@ class LwipIntf IPAddress& netmask, IPAddress& dns1); String hostname(); + bool hostname(const String& aHostname) { return hostname(aHostname.c_str()); } + bool hostname(const char* aHostname); + // ESP32 API compatibility bool setHostname(const char* aHostName) { return hostname(aHostName); } + + // ESP32 API compatibility const char* getHostname(); protected: diff --git a/cores/esp8266/LwipIntfCB.cpp b/cores/esp8266/LwipIntfCB.cpp index 9d0f9feb22..e09ce7ca18 100644 --- a/cores/esp8266/LwipIntfCB.cpp +++ b/cores/esp8266/LwipIntfCB.cpp @@ -1,3 +1,26 @@ +/* + LwipIntfCB.cpp + + network generic callback implementation + + Original Copyright (c) 2020 esp8266 Arduino All rights reserved. + This file is part of the esp8266 Arduino core environment. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + #include #include diff --git a/cores/esp8266/LwipIntfDev.h b/cores/esp8266/LwipIntfDev.h index 6fb0ac22dc..bfb3792fb6 100644 --- a/cores/esp8266/LwipIntfDev.h +++ b/cores/esp8266/LwipIntfDev.h @@ -1,9 +1,31 @@ +/* + LwipIntfDev.h + + Arduino network template class for generic device + + Original Copyright (c) 2020 esp8266 Arduino All rights reserved. + This file is part of the esp8266 Arduino core environment. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + #ifndef _LWIPINTFDEV_H #define _LWIPINTFDEV_H // TODO: -// remove all Serial.print // unchain pbufs #include From 4c707f38e0e223ab7f997edaa6646f1b951e76aa Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 9 Jul 2022 09:49:52 -0700 Subject: [PATCH 2/5] Update LwipIntf.h --- cores/esp8266/LwipIntf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h index 7a33f76192..43941c4f28 100644 --- a/cores/esp8266/LwipIntf.h +++ b/cores/esp8266/LwipIntf.h @@ -51,7 +51,7 @@ class LwipIntf String hostname(); - bool hostname(const String& aHostname) + bool hostname(const String& aHostname) { return hostname(aHostname.c_str()); } From ef01247ae19de359ad4b138ca00024fdf0a10df5 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 9 Jul 2022 09:50:18 -0700 Subject: [PATCH 3/5] Update LwipIntfDev.h --- cores/esp8266/LwipIntfDev.h | 1 - 1 file changed, 1 deletion(-) diff --git a/cores/esp8266/LwipIntfDev.h b/cores/esp8266/LwipIntfDev.h index bfb3792fb6..15f3f033b1 100644 --- a/cores/esp8266/LwipIntfDev.h +++ b/cores/esp8266/LwipIntfDev.h @@ -21,7 +21,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - #ifndef _LWIPINTFDEV_H #define _LWIPINTFDEV_H From b30ebe704479b8ff45052e5955329711ae8ef45f Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 9 Jul 2022 09:50:36 -0700 Subject: [PATCH 4/5] Update LwipIntfCB.cpp --- cores/esp8266/LwipIntfCB.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/cores/esp8266/LwipIntfCB.cpp b/cores/esp8266/LwipIntfCB.cpp index e09ce7ca18..f7b9fd2b5a 100644 --- a/cores/esp8266/LwipIntfCB.cpp +++ b/cores/esp8266/LwipIntfCB.cpp @@ -21,7 +21,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - #include #include #include From d3bc2cd4b57a65c078dbc9257495bcf0af92d499 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 9 Jul 2022 09:51:00 -0700 Subject: [PATCH 5/5] Update LwipIntf.cpp --- cores/esp8266/LwipIntf.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/cores/esp8266/LwipIntf.cpp b/cores/esp8266/LwipIntf.cpp index 3d4e106f3c..e142730df0 100644 --- a/cores/esp8266/LwipIntf.cpp +++ b/cores/esp8266/LwipIntf.cpp @@ -21,7 +21,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - extern "C" { #include "lwip/err.h"