├── .mxproject ├── EWARM ├── settings │ ├── Project.wspos │ ├── STM32F4_MODBUS_TCP.STM32F4_MODBUS_TCP.cspy.bat │ ├── STM32F4_MODBUS_TCP.STM32F4_MODBUS_TCP.general.xcl │ ├── STM32F4_MODBUS_TCP.crun │ ├── STM32F4_MODBUS_TCP.STM32F4_MODBUS_TCP.driver.xcl │ ├── STM32F4_MODBUS_TCP.dni │ └── STM32F4_MODBUS_TCP_STM32F4_MODBUS_TCP.jlink ├── Project.eww ├── stm32f407xx_flash.icf └── stm32f407xx_sram.icf ├── Middlewares └── Third_Party │ ├── modbus │ ├── port │ │ ├── porttcp.c │ │ ├── portevent.c │ │ ├── port.h │ │ └── porttimer.c │ ├── functions │ │ ├── mbfuncdiag.c │ │ └── mbfuncother.c │ ├── tcp │ │ └── mbtcp.h │ └── include │ │ ├── mbfunc.h │ │ ├── mbproto.h │ │ └── mbframe.h │ └── LwIP │ ├── src │ ├── include │ │ ├── netif │ │ │ ├── etharp.h │ │ │ ├── ppp │ │ │ │ ├── chap-md5.h │ │ │ │ ├── chap_ms.h │ │ │ │ ├── ecp.h │ │ │ │ ├── polarssl │ │ │ │ │ ├── arc4.h │ │ │ │ │ ├── des.h │ │ │ │ │ ├── md5.h │ │ │ │ │ ├── md4.h │ │ │ │ │ └── sha1.h │ │ │ │ ├── eui64.h │ │ │ │ └── pppdebug.h │ │ │ ├── lowpan6_opts.h │ │ │ ├── ethernet.h │ │ │ ├── lowpan6.h │ │ │ └── slipif.h │ │ ├── posix │ │ │ ├── errno.h │ │ │ ├── netdb.h │ │ │ └── sys │ │ │ │ └── socket.h │ │ └── lwip │ │ │ ├── apps │ │ │ ├── netbiosns.h │ │ │ ├── netbiosns_opts.h │ │ │ ├── mdns_opts.h │ │ │ ├── mdns_priv.h │ │ │ ├── mdns.h │ │ │ ├── sntp.h │ │ │ ├── snmp_mib2.h │ │ │ ├── lwiperf.h │ │ │ ├── tftp_opts.h │ │ │ ├── snmpv3.h │ │ │ ├── tftp_server.h │ │ │ └── fs.h │ │ │ ├── prot │ │ │ ├── ip.h │ │ │ ├── udp.h │ │ │ ├── mld6.h │ │ │ ├── icmp6.h │ │ │ ├── etharp.h │ │ │ ├── igmp.h │ │ │ ├── autoip.h │ │ │ ├── icmp.h │ │ │ └── tcp.h │ │ │ ├── dhcp6.h │ │ │ ├── ethip6.h │ │ │ ├── mem.h │ │ │ ├── ip4_frag.h │ │ │ ├── autoip.h │ │ │ ├── ip6.h │ │ │ ├── err.h │ │ │ └── mld6.h │ ├── core │ │ ├── ipv6 │ │ │ ├── dhcp6.c │ │ │ └── inet6.c │ │ └── sys.c │ └── netif │ │ └── ppp │ │ ├── eui64.c │ │ ├── pppcrypt.c │ │ └── polarssl │ │ └── arc4.c │ └── system │ └── arch │ ├── bpstruct.h │ ├── epstruct.h │ ├── lib.h │ ├── cpu.h │ ├── perf.h │ ├── init.h │ ├── sys_arch.h │ └── cc.h ├── README.md ├── .gitattributes ├── .gitignore ├── Inc ├── stm32f4xx_it.h ├── ethernetif.h └── main.h └── Src └── mbtask.c /.mxproject: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eziya/STM32_HAL_FREEMODBUS_TCP/HEAD/.mxproject -------------------------------------------------------------------------------- /EWARM/settings/Project.wspos: -------------------------------------------------------------------------------- 1 | [MainWindow] 2 | WindowPlacement=_ 88 241 1528 1001 3 3 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/modbus/port/porttcp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eziya/STM32_HAL_FREEMODBUS_TCP/HEAD/Middlewares/Third_Party/modbus/port/porttcp.c -------------------------------------------------------------------------------- /EWARM/settings/STM32F4_MODBUS_TCP.STM32F4_MODBUS_TCP.cspy.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eziya/STM32_HAL_FREEMODBUS_TCP/HEAD/EWARM/settings/STM32F4_MODBUS_TCP.STM32F4_MODBUS_TCP.cspy.bat -------------------------------------------------------------------------------- /EWARM/settings/STM32F4_MODBUS_TCP.STM32F4_MODBUS_TCP.general.xcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eziya/STM32_HAL_FREEMODBUS_TCP/HEAD/EWARM/settings/STM32F4_MODBUS_TCP.STM32F4_MODBUS_TCP.general.xcl -------------------------------------------------------------------------------- /EWARM/Project.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $WS_DIR$\STM32F4_MODBUS_TCP.ewp 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/etharp.h: -------------------------------------------------------------------------------- 1 | /* ARP has been moved to core/ipv4, provide this #include for compatibility only */ 2 | #include "lwip/etharp.h" 3 | #include "netif/ethernet.h" 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # STM32_HAL_FREEMODBUS_TCP 2 | FreeMODBUS TCP port for STM32 HAL library 3 | 4 | Adding multi clients support (Testing feature) 5 | http://blog.naver.com/eziya76/220971629198 6 | 7 | Reference 8 | https://bitbucket.org/DamiBanfi/open-surce/overview 9 | -------------------------------------------------------------------------------- /EWARM/settings/STM32F4_MODBUS_TCP.crun: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1 5 | 6 | 7 | * 8 | * 9 | * 10 | 0 11 | 1 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /EWARM/settings/STM32F4_MODBUS_TCP.STM32F4_MODBUS_TCP.driver.xcl: -------------------------------------------------------------------------------- 1 | "--endian=little" 2 | 3 | "--cpu=Cortex-M4F" 4 | 5 | "--fpu=VFPv4" 6 | 7 | "-p" 8 | 9 | "C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.2\arm\CONFIG\debugger\ST\STM32F407VE.ddf" 10 | 11 | "--drv_verify_download" 12 | 13 | "--semihosting" 14 | 15 | "--device=STM32F407VE" 16 | 17 | "--drv_communication=USB0" 18 | 19 | "--drv_interface_speed=100" 20 | 21 | "--jlink_reset_strategy=0,0" 22 | 23 | "--drv_catch_exceptions=0x000" 24 | 25 | "--drv_swo_clock_setup=72000000,0,2000000" 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /EWARM/settings/STM32F4_MODBUS_TCP.dni: -------------------------------------------------------------------------------- 1 | [Stack] 2 | FillEnabled=0 3 | OverflowWarningsEnabled=1 4 | WarningThreshold=90 5 | SpWarningsEnabled=1 6 | WarnLogOnly=1 7 | UseTrigger=1 8 | TriggerName=main 9 | LimitSize=0 10 | ByteLimit=50 11 | [DebugChecksum] 12 | Checksum=876502056 13 | [Exceptions] 14 | StopOnUncaught=_ 0 15 | StopOnThrow=_ 0 16 | [Log file] 17 | LoggingEnabled=_ 0 18 | LogFile=_ "" 19 | Category=_ 0 20 | [TermIOLog] 21 | LoggingEnabled=_ 0 22 | LogFile=_ "" 23 | [CallStack] 24 | ShowArgs=0 25 | [Disassembly] 26 | MixedMode=1 27 | [CallStackLog] 28 | Enabled=0 29 | [CallStackStripe] 30 | ShowTiming=122 31 | [JLinkDriver] 32 | CStepIntDis=_ 0 33 | [Disassemble mode] 34 | mode=0 35 | [Breakpoints2] 36 | Count=0 37 | [Aliases] 38 | Count=0 39 | SuppressDialog=0 40 | -------------------------------------------------------------------------------- /EWARM/settings/STM32F4_MODBUS_TCP_STM32F4_MODBUS_TCP.jlink: -------------------------------------------------------------------------------- 1 | [BREAKPOINTS] 2 | ForceImpTypeAny = 0 3 | ShowInfoWin = 1 4 | EnableFlashBP = 2 5 | BPDuringExecution = 0 6 | [CFI] 7 | CFISize = 0x00 8 | CFIAddr = 0x00 9 | [CPU] 10 | OverrideMemMap = 0 11 | AllowSimulation = 1 12 | ScriptFile="" 13 | [FLASH] 14 | CacheExcludeSize = 0x00 15 | CacheExcludeAddr = 0x00 16 | MinNumBytesFlashDL = 0 17 | SkipProgOnCRCMatch = 1 18 | VerifyDownload = 1 19 | AllowCaching = 1 20 | EnableFlashDL = 2 21 | Override = 0 22 | Device="UNSPECIFIED" 23 | [GENERAL] 24 | WorkRAMSize = 0x00 25 | WorkRAMAddr = 0x00 26 | RAMUsageLimit = 0x00 27 | [SWO] 28 | SWOLogFile="" 29 | [MEM] 30 | RdOverrideOrMask = 0x00 31 | RdOverrideAndMask = 0xFFFFFFFF 32 | RdOverrideAddr = 0xFFFFFFFF 33 | WrOverrideOrMask = 0x00 34 | WrOverrideAndMask = 0xFFFFFFFF 35 | WrOverrideAddr = 0xFFFFFFFF 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/ppp/chap-md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * chap-md5.h - New CHAP/MD5 implementation. 3 | * 4 | * Copyright (c) 2003 Paul Mackerras. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. The name(s) of the authors of this software must not be used to 14 | * endorse or promote products derived from this software without 15 | * prior written permission. 16 | * 17 | * 3. Redistributions of any form whatsoever must retain the following 18 | * acknowledgment: 19 | * "This product includes software developed by Paul Mackerras 20 | * ". 21 | * 22 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 23 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 24 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 25 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 26 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 27 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 28 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 29 | */ 30 | 31 | #include "netif/ppp/ppp_opts.h" 32 | #if PPP_SUPPORT && CHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ 33 | 34 | extern const struct chap_digest_type md5_digest; 35 | 36 | #endif /* PPP_SUPPORT && CHAP_SUPPORT */ 37 | -------------------------------------------------------------------------------- /EWARM/stm32f407xx_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x080FFFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF; 11 | define symbol __ICFEDIT_region_CCMRAM_start__ = 0x10000000; 12 | define symbol __ICFEDIT_region_CCMRAM_end__ = 0x1000FFFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x400; 15 | define symbol __ICFEDIT_size_heap__ = 0x200; 16 | /**** End of ICF editor section. ###ICF###*/ 17 | 18 | 19 | define memory mem with size = 4G; 20 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 21 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 22 | define region CCMRAM_region = mem:[from __ICFEDIT_region_CCMRAM_start__ to __ICFEDIT_region_CCMRAM_end__]; 23 | 24 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 25 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 26 | 27 | initialize by copy { readwrite }; 28 | do not initialize { section .noinit }; 29 | 30 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 31 | 32 | place in ROM_region { readonly }; 33 | place in RAM_region { readwrite, 34 | block CSTACK, block HEAP }; 35 | -------------------------------------------------------------------------------- /EWARM/stm32f407xx_sram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x20000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x20000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x2000FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20010000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2001FFFF; 11 | define symbol __ICFEDIT_region_CCMRAM_start__ = 0x10000000; 12 | define symbol __ICFEDIT_region_CCMRAM_end__ = 0x1000FFFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x400; 15 | define symbol __ICFEDIT_size_heap__ = 0x200; 16 | /**** End of ICF editor section. ###ICF###*/ 17 | 18 | 19 | define memory mem with size = 4G; 20 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 21 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 22 | define region CCMRAM_region = mem:[from __ICFEDIT_region_CCMRAM_start__ to __ICFEDIT_region_CCMRAM_end__]; 23 | 24 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 25 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 26 | 27 | initialize by copy { readwrite }; 28 | do not initialize { section .noinit }; 29 | 30 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 31 | 32 | place in ROM_region { readonly }; 33 | place in RAM_region { readwrite, 34 | block CSTACK, block HEAP }; 35 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/posix/errno.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/errno.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/errno.h" 34 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/posix/netdb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/netdb.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/netdb.h" 34 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/posix/sys/socket.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/sockets.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/sockets.h" 34 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/modbus/functions/mbfuncdiag.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. 3 | * Copyright (c) 2006 Christian Walter 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * File: $Id: mbfuncdiag.c,v 1.3 2006/12/07 22:10:34 wolti Exp $ 29 | */ 30 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/system/arch/bpstruct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #if defined(__IAR_SYSTEMS_ICC__) 34 | #pragma pack(1) 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/system/arch/epstruct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #if defined(__IAR_SYSTEMS_ICC__) 34 | #pragma pack() 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/system/arch/lib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LIB_H__ 33 | #define __LIB_H__ 34 | 35 | #include 36 | 37 | 38 | #endif /* __LIB_H__ */ 39 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/system/arch/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __CPU_H__ 33 | #define __CPU_H__ 34 | 35 | #ifndef BYTE_ORDER 36 | #define BYTE_ORDER LITTLE_ENDIAN 37 | #endif 38 | 39 | #endif /* __CPU_H__ */ 40 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/system/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __PERF_H__ 33 | #define __PERF_H__ 34 | 35 | #define PERF_START /* null definition */ 36 | #define PERF_STOP(x) /* null definition */ 37 | 38 | #endif /* __PERF_H__ */ 39 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/ppp/chap_ms.h: -------------------------------------------------------------------------------- 1 | /* 2 | * chap_ms.h - Challenge Handshake Authentication Protocol definitions. 3 | * 4 | * Copyright (c) 1995 Eric Rosenquist. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * 18 | * 3. The name(s) of the authors of this software must not be used to 19 | * endorse or promote products derived from this software without 20 | * prior written permission. 21 | * 22 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 23 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 24 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 25 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 26 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 27 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 28 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 29 | * 30 | * $Id: chap_ms.h,v 1.13 2004/11/15 22:13:26 paulus Exp $ 31 | */ 32 | 33 | #include "netif/ppp/ppp_opts.h" 34 | #if PPP_SUPPORT && MSCHAP_SUPPORT /* don't build if not configured for use in lwipopts.h */ 35 | 36 | #ifndef CHAPMS_INCLUDE 37 | #define CHAPMS_INCLUDE 38 | 39 | extern const struct chap_digest_type chapms_digest; 40 | extern const struct chap_digest_type chapms2_digest; 41 | 42 | #endif /* CHAPMS_INCLUDE */ 43 | 44 | #endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ 45 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/modbus/port/portevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: BARE Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: portevent.c,v 1.1 2006/08/22 21:35:13 wolti Exp $ 20 | */ 21 | 22 | /* ----------------------- Modbus includes ----------------------------------*/ 23 | #include "mb.h" 24 | #include "mbport.h" 25 | 26 | /* ----------------------- Variables ----------------------------------------*/ 27 | static eMBEventType eQueuedEvent; 28 | static BOOL xEventInQueue; 29 | 30 | /* ----------------------- Start implementation -----------------------------*/ 31 | BOOL 32 | xMBPortEventInit( void ) 33 | { 34 | xEventInQueue = FALSE; 35 | return TRUE; 36 | } 37 | 38 | BOOL 39 | xMBPortEventPost( eMBEventType eEvent ) 40 | { 41 | xEventInQueue = TRUE; 42 | eQueuedEvent = eEvent; 43 | return TRUE; 44 | } 45 | 46 | BOOL 47 | xMBPortEventGet( eMBEventType * eEvent ) 48 | { 49 | BOOL xEventHappened = FALSE; 50 | 51 | if( xEventInQueue ) 52 | { 53 | *eEvent = eQueuedEvent; 54 | xEventInQueue = FALSE; 55 | xEventHappened = TRUE; 56 | } 57 | return xEventHappened; 58 | } 59 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/apps/netbiosns.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * NETBIOS name service responder 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | #ifndef LWIP_HDR_APPS_NETBIOS_H 33 | #define LWIP_HDR_APPS_NETBIOS_H 34 | 35 | #include "lwip/apps/netbiosns_opts.h" 36 | 37 | void netbiosns_init(void); 38 | #ifndef NETBIOS_LWIP_NAME 39 | void netbiosns_set_name(const char* hostname); 40 | #endif 41 | void netbiosns_stop(void); 42 | 43 | #endif /* LWIP_HDR_APPS_NETBIOS_H */ 44 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/system/arch/init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __ARCH_INIT_H__ 33 | #define __ARCH_INIT_H__ 34 | 35 | #define TCPIP_INIT_DONE(arg) tcpip_init_done(arg) 36 | 37 | void tcpip_init_done(void *); 38 | int wait_for_tcpip_init(void); 39 | 40 | #endif /* __ARCH_INIT_H__ */ 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/ppp/ecp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ecp.h - Definitions for PPP Encryption Control Protocol. 3 | * 4 | * Copyright (c) 2002 Google, Inc. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in 16 | * the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * 3. The name(s) of the authors of this software must not be used to 20 | * endorse or promote products derived from this software without 21 | * prior written permission. 22 | * 23 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 24 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 25 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 26 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 27 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 28 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 29 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 30 | * 31 | * $Id: ecp.h,v 1.2 2003/01/10 07:12:36 fcusack Exp $ 32 | */ 33 | 34 | #include "netif/ppp/ppp_opts.h" 35 | #if PPP_SUPPORT && ECP_SUPPORT /* don't build if not configured for use in lwipopts.h */ 36 | 37 | typedef struct ecp_options { 38 | bool required; /* Is ECP required? */ 39 | unsigned enctype; /* Encryption type */ 40 | } ecp_options; 41 | 42 | extern fsm ecp_fsm[]; 43 | extern ecp_options ecp_wantoptions[]; 44 | extern ecp_options ecp_gotoptions[]; 45 | extern ecp_options ecp_allowoptions[]; 46 | extern ecp_options ecp_hisoptions[]; 47 | 48 | extern const struct protent ecp_protent; 49 | 50 | #endif /* PPP_SUPPORT && ECP_SUPPORT */ 51 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/core/ipv6/dhcp6.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * DHCPv6. 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2010 Inico Technologies Ltd. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Ivan Delamer 36 | * 37 | * 38 | * Please coordinate changes and requests with Ivan Delamer 39 | * 40 | */ 41 | 42 | #include "lwip/opt.h" 43 | 44 | #if LWIP_IPV6 && LWIP_IPV6_DHCP6 /* don't build if not configured for use in lwipopts.h */ 45 | 46 | #include "lwip/ip6_addr.h" 47 | #include "lwip/def.h" 48 | 49 | 50 | #endif /* LWIP_IPV6 && LWIP_IPV6_DHCP6 */ 51 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/prot/ip.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * IP protocol definitions 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Adam Dunkels 35 | * 36 | */ 37 | #ifndef LWIP_HDR_PROT_IP_H 38 | #define LWIP_HDR_PROT_IP_H 39 | 40 | #include "lwip/arch.h" 41 | 42 | #define IP_PROTO_ICMP 1 43 | #define IP_PROTO_IGMP 2 44 | #define IP_PROTO_UDP 17 45 | #define IP_PROTO_UDPLITE 136 46 | #define IP_PROTO_TCP 6 47 | 48 | /** This operates on a void* by loading the first byte */ 49 | #define IP_HDR_GET_VERSION(ptr) ((*(u8_t*)(ptr)) >> 4) 50 | 51 | #endif /* LWIP_HDR_PROT_IP_H */ 52 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/core/ipv6/inet6.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * INET v6 addresses. 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2010 Inico Technologies Ltd. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Ivan Delamer 36 | * 37 | * 38 | * Please coordinate changes and requests with Ivan Delamer 39 | * 40 | */ 41 | 42 | #include "lwip/opt.h" 43 | 44 | #if LWIP_IPV6 && LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ 45 | 46 | #include "lwip/def.h" 47 | #include "lwip/inet.h" 48 | 49 | /** This variable is initialized by the system to contain the wildcard IPv6 address. 50 | */ 51 | const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; 52 | 53 | #endif /* LWIP_IPV6 */ 54 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/dhcp6.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * IPv6 address autoconfiguration as per RFC 4862. 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2010 Inico Technologies Ltd. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Ivan Delamer 36 | * 37 | * IPv6 address autoconfiguration as per RFC 4862. 38 | * 39 | * Please coordinate changes and requests with Ivan Delamer 40 | * 41 | */ 42 | 43 | #ifndef LWIP_HDR_IP6_DHCP6_H 44 | #define LWIP_HDR_IP6_DHCP6_H 45 | 46 | #include "lwip/opt.h" 47 | 48 | #if LWIP_IPV6_DHCP6 /* don't build if not configured for use in lwipopts.h */ 49 | 50 | 51 | struct dhcp6 52 | { 53 | /*@todo: implement DHCP6*/ 54 | }; 55 | 56 | #endif /* LWIP_IPV6_DHCP6 */ 57 | 58 | #endif /* LWIP_HDR_IP6_DHCP6_H */ 59 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/netif/ppp/eui64.c: -------------------------------------------------------------------------------- 1 | /* 2 | * eui64.c - EUI64 routines for IPv6CP. 3 | * 4 | * Copyright (c) 1999 Tommi Komulainen. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * 18 | * 3. The name(s) of the authors of this software must not be used to 19 | * endorse or promote products derived from this software without 20 | * prior written permission. 21 | * 22 | * 4. Redistributions of any form whatsoever must retain the following 23 | * acknowledgment: 24 | * "This product includes software developed by Tommi Komulainen 25 | * ". 26 | * 27 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 28 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 29 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 30 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 31 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 32 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 33 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 34 | * 35 | * $Id: eui64.c,v 1.6 2002/12/04 23:03:32 paulus Exp $ 36 | */ 37 | 38 | #include "netif/ppp/ppp_opts.h" 39 | #if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ 40 | 41 | #include "netif/ppp/ppp_impl.h" 42 | #include "netif/ppp/eui64.h" 43 | 44 | /* 45 | * eui64_ntoa - Make an ascii representation of an interface identifier 46 | */ 47 | char *eui64_ntoa(eui64_t e) { 48 | static char buf[20]; 49 | 50 | sprintf(buf, "%02x%02x:%02x%02x:%02x%02x:%02x%02x", 51 | e.e8[0], e.e8[1], e.e8[2], e.e8[3], 52 | e.e8[4], e.e8[5], e.e8[6], e.e8[7]); 53 | return buf; 54 | } 55 | 56 | #endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ 57 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/modbus/port/port.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: BARE Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: port.h,v 1.1 2006/08/22 21:35:13 wolti Exp $ 20 | */ 21 | 22 | #ifndef _PORT_H 23 | #define _PORT_H 24 | 25 | #include 26 | #include "stm32f4xx_hal.h" 27 | #include "lwip/opt.h" 28 | #include "lwip/sys.h" 29 | 30 | /* default */ 31 | 32 | #define MB_TCP_DEBUG 0 33 | 34 | #define INLINE inline 35 | #define PR_BEGIN_EXTERN_C extern "C" { 36 | #define PR_END_EXTERN_C } 37 | 38 | #define ENTER_CRITICAL_SECTION() ( __disable_interrupt() ) 39 | #define EXIT_CRITICAL_SECTION() ( __enable_interrupt() ) 40 | 41 | typedef uint8_t BOOL; 42 | typedef unsigned char UCHAR; 43 | typedef char CHAR; 44 | typedef uint16_t USHORT; 45 | typedef int16_t SHORT; 46 | typedef uint32_t ULONG; 47 | typedef int32_t LONG; 48 | 49 | #ifndef TRUE 50 | #define TRUE 1 51 | #endif 52 | 53 | #ifndef FALSE 54 | #define FALSE 0 55 | #endif 56 | 57 | #ifdef __cplusplus 58 | PR_BEGIN_EXTERN_C 59 | #endif 60 | 61 | #ifdef MB_TCP_DEBUG 62 | typedef enum 63 | { 64 | MB_LOG_DEBUG, 65 | MB_LOG_INFO, 66 | MB_LOG_WARN, 67 | MB_LOG_ERROR 68 | } eMBPortLogLevel; 69 | #endif 70 | 71 | /* ----------------------- Function prototypes ------------------------------*/ 72 | #ifdef MB_TCP_DEBUG 73 | void vMBPortLog( eMBPortLogLevel eLevel, const CHAR * szModule, const CHAR * szFmt, ... ); 74 | void prvvMBTCPLogFrame( UCHAR * pucMsg, UCHAR * pucFrame, USHORT usFrameLen ); 75 | #endif 76 | 77 | #ifdef __cplusplus 78 | PR_END_EXTERN_C 79 | #endif 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/core/sys.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * lwIP Operating System abstraction 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/opt.h" 40 | 41 | #include "lwip/sys.h" 42 | 43 | /* Most of the functions defined in sys.h must be implemented in the 44 | * architecture-dependent file sys_arch.c */ 45 | 46 | #if !NO_SYS 47 | 48 | #ifndef sys_msleep 49 | /** 50 | * Sleep for some ms. Timeouts are NOT processed while sleeping. 51 | * 52 | * @param ms number of milliseconds to sleep 53 | */ 54 | void 55 | sys_msleep(u32_t ms) 56 | { 57 | if (ms > 0) { 58 | sys_sem_t delaysem; 59 | err_t err = sys_sem_new(&delaysem, 0); 60 | if (err == ERR_OK) { 61 | sys_arch_sem_wait(&delaysem, ms); 62 | sys_sem_free(&delaysem); 63 | } 64 | } 65 | } 66 | #endif /* sys_msleep */ 67 | 68 | #endif /* !NO_SYS */ 69 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/apps/netbiosns_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * NETBIOS name service responder options 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | #ifndef LWIP_HDR_APPS_NETBIOS_OPTS_H 33 | #define LWIP_HDR_APPS_NETBIOS_OPTS_H 34 | 35 | #include "lwip/opt.h" 36 | 37 | /** 38 | * @defgroup netbiosns_opts Options 39 | * @ingroup netbiosns 40 | * @{ 41 | */ 42 | 43 | /** NetBIOS name of lwip device 44 | * This must be uppercase until NETBIOS_STRCMP() is defined to a string 45 | * comparision function that is case insensitive. 46 | * If you want to use the netif's hostname, use this (with LWIP_NETIF_HOSTNAME): 47 | * (ip_current_netif() != NULL ? ip_current_netif()->hostname != NULL ? ip_current_netif()->hostname : "" : "") 48 | * 49 | * If this is not defined, netbiosns_set_name() can be called at runtime to change the name. 50 | */ 51 | #ifdef __DOXYGEN__ 52 | #define NETBIOS_LWIP_NAME "NETBIOSLWIPDEV" 53 | #endif 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | #endif /* LWIP_HDR_APPS_NETBIOS_OPTS_H */ 60 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/modbus/tcp/mbtcp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. 3 | * Copyright (c) 2006 Christian Walter 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * File: $Id: mbtcp.h,v 1.2 2006/12/07 22:10:34 wolti Exp $ 29 | */ 30 | 31 | #ifndef _MB_TCP_H 32 | #define _MB_TCP_H 33 | 34 | #ifdef __cplusplus 35 | PR_BEGIN_EXTERN_C 36 | #endif 37 | 38 | /* ----------------------- Defines ------------------------------------------*/ 39 | #define MB_TCP_PSEUDO_ADDRESS 255 40 | 41 | /* ----------------------- Function prototypes ------------------------------*/ 42 | eMBErrorCode eMBTCPDoInit( USHORT ucTCPPort ); 43 | void eMBTCPStart( void ); 44 | void eMBTCPStop( void ); 45 | eMBErrorCode eMBTCPReceive( UCHAR * pucRcvAddress, UCHAR ** pucFrame, 46 | USHORT * pusLength ); 47 | eMBErrorCode eMBTCPSend( UCHAR _unused, const UCHAR * pucFrame, 48 | USHORT usLength ); 49 | 50 | #ifdef __cplusplus 51 | PR_END_EXTERN_C 52 | #endif 53 | #endif 54 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/ethip6.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * Ethernet output for IPv6. Uses ND tables for link-layer addressing. 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2010 Inico Technologies Ltd. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Ivan Delamer 36 | * 37 | * 38 | * Please coordinate changes and requests with Ivan Delamer 39 | * 40 | */ 41 | 42 | #ifndef LWIP_HDR_ETHIP6_H 43 | #define LWIP_HDR_ETHIP6_H 44 | 45 | #include "lwip/opt.h" 46 | 47 | #if LWIP_IPV6 && LWIP_ETHERNET /* don't build if not configured for use in lwipopts.h */ 48 | 49 | #include "lwip/pbuf.h" 50 | #include "lwip/ip6.h" 51 | #include "lwip/ip6_addr.h" 52 | #include "lwip/netif.h" 53 | 54 | 55 | #ifdef __cplusplus 56 | extern "C" { 57 | #endif 58 | 59 | 60 | err_t ethip6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif /* LWIP_IPV6 && LWIP_ETHERNET */ 67 | 68 | #endif /* LWIP_HDR_ETHIP6_H */ 69 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/prot/udp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * UDP protocol definitions 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Adam Dunkels 35 | * 36 | */ 37 | #ifndef LWIP_HDR_PROT_UDP_H 38 | #define LWIP_HDR_PROT_UDP_H 39 | 40 | #include "lwip/arch.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | #define UDP_HLEN 8 47 | 48 | /* Fields are (of course) in network byte order. */ 49 | #ifdef PACK_STRUCT_USE_INCLUDES 50 | # include "arch/bpstruct.h" 51 | #endif 52 | PACK_STRUCT_BEGIN 53 | struct udp_hdr { 54 | PACK_STRUCT_FIELD(u16_t src); 55 | PACK_STRUCT_FIELD(u16_t dest); /* src/dest UDP ports */ 56 | PACK_STRUCT_FIELD(u16_t len); 57 | PACK_STRUCT_FIELD(u16_t chksum); 58 | } PACK_STRUCT_STRUCT; 59 | PACK_STRUCT_END 60 | #ifdef PACK_STRUCT_USE_INCLUDES 61 | # include "arch/epstruct.h" 62 | #endif 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* LWIP_HDR_PROT_UDP_H */ 69 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/system/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __SYS_RTXC_H__ 33 | #define __SYS_RTXC_H__ 34 | 35 | #include "cmsis_os.h" 36 | 37 | #define SYS_MBOX_NULL (osMessageQId)0 38 | #define SYS_SEM_NULL (osSemaphoreId)0 39 | #define SYS_DEFAULT_THREAD_STACK_DEPTH configMINIMAL_STACK_SIZE 40 | 41 | typedef osSemaphoreId sys_sem_t; 42 | typedef osSemaphoreId sys_mutex_t; 43 | typedef osMessageQId sys_mbox_t; 44 | typedef osThreadId sys_thread_t; 45 | 46 | typedef struct _sys_arch_state_t 47 | { 48 | // Task creation data. 49 | char cTaskName[configMAX_TASK_NAME_LEN]; 50 | unsigned short nStackDepth; 51 | unsigned short nTaskCount; 52 | } sys_arch_state_t; 53 | 54 | 55 | 56 | //extern sys_arch_state_t s_sys_arch_state; 57 | 58 | //void sys_set_default_state(); 59 | //void sys_set_state(signed char *pTaskName, unsigned short nStackSize); 60 | 61 | #endif /* __SYS_RTXC_H__ */ 62 | 63 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/netif/ppp/pppcrypt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pppcrypt.c - PPP/DES linkage for MS-CHAP and EAP SRP-SHA1 3 | * 4 | * Extracted from chap_ms.c by James Carlson. 5 | * 6 | * Copyright (c) 1995 Eric Rosenquist. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * 3. The name(s) of the authors of this software must not be used to 21 | * endorse or promote products derived from this software without 22 | * prior written permission. 23 | * 24 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 25 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 26 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 27 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 28 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 29 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 30 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 31 | */ 32 | 33 | #include "netif/ppp/ppp_opts.h" 34 | #if PPP_SUPPORT && MSCHAP_SUPPORT /* don't build if not necessary */ 35 | 36 | #include "netif/ppp/ppp_impl.h" 37 | 38 | #include "netif/ppp/pppcrypt.h" 39 | 40 | 41 | static u_char pppcrypt_get_7bits(u_char *input, int startBit) { 42 | unsigned int word; 43 | 44 | word = (unsigned)input[startBit / 8] << 8; 45 | word |= (unsigned)input[startBit / 8 + 1]; 46 | 47 | word >>= 15 - (startBit % 8 + 7); 48 | 49 | return word & 0xFE; 50 | } 51 | 52 | /* IN 56 bit DES key missing parity bits 53 | * OUT 64 bit DES key with parity bits added 54 | */ 55 | void pppcrypt_56_to_64_bit_key(u_char *key, u_char * des_key) { 56 | des_key[0] = pppcrypt_get_7bits(key, 0); 57 | des_key[1] = pppcrypt_get_7bits(key, 7); 58 | des_key[2] = pppcrypt_get_7bits(key, 14); 59 | des_key[3] = pppcrypt_get_7bits(key, 21); 60 | des_key[4] = pppcrypt_get_7bits(key, 28); 61 | des_key[5] = pppcrypt_get_7bits(key, 35); 62 | des_key[6] = pppcrypt_get_7bits(key, 42); 63 | des_key[7] = pppcrypt_get_7bits(key, 49); 64 | } 65 | 66 | #endif /* PPP_SUPPORT && MSCHAP_SUPPORT */ 67 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/lowpan6_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 6LowPAN options list 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2015 Inico Technologies Ltd. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Ivan Delamer 35 | * 36 | * 37 | * Please coordinate changes and requests with Ivan Delamer 38 | * 39 | */ 40 | 41 | #ifndef LWIP_HDR_LOWPAN6_OPTS_H 42 | #define LWIP_HDR_LOWPAN6_OPTS_H 43 | 44 | #include "lwip/opt.h" 45 | 46 | #ifndef LWIP_6LOWPAN 47 | #define LWIP_6LOWPAN 0 48 | #endif 49 | 50 | #ifndef LWIP_6LOWPAN_NUM_CONTEXTS 51 | #define LWIP_6LOWPAN_NUM_CONTEXTS 10 52 | #endif 53 | 54 | #ifndef LWIP_6LOWPAN_INFER_SHORT_ADDRESS 55 | #define LWIP_6LOWPAN_INFER_SHORT_ADDRESS 1 56 | #endif 57 | 58 | #ifndef LWIP_6LOWPAN_IPHC 59 | #define LWIP_6LOWPAN_IPHC 1 60 | #endif 61 | 62 | #ifndef LWIP_6LOWPAN_HW_CRC 63 | #define LWIP_6LOWPAN_HW_CRC 1 64 | #endif 65 | 66 | #ifndef LOWPAN6_DEBUG 67 | #define LOWPAN6_DEBUG LWIP_DBG_OFF 68 | #endif 69 | 70 | #endif /* LWIP_HDR_LOWPAN6_OPTS_H */ 71 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/apps/mdns_opts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * MDNS responder 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2015 Verisure Innovation AB 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Erik Ekman 35 | * 36 | */ 37 | 38 | #ifndef LWIP_HDR_APPS_MDNS_OPTS_H 39 | #define LWIP_HDR_APPS_MDNS_OPTS_H 40 | 41 | #include "lwip/opt.h" 42 | 43 | /** 44 | * @defgroup mdns_opts Options 45 | * @ingroup mdns 46 | * @{ 47 | */ 48 | 49 | /** 50 | * LWIP_MDNS_RESPONDER==1: Turn on multicast DNS module. UDP must be available for MDNS 51 | * transport. IGMP is needed for IPv4 multicast. 52 | */ 53 | #ifndef LWIP_MDNS_RESPONDER 54 | #define LWIP_MDNS_RESPONDER 0 55 | #endif /* LWIP_MDNS_RESPONDER */ 56 | 57 | /** The maximum number of services per netif */ 58 | #ifndef MDNS_MAX_SERVICES 59 | #define MDNS_MAX_SERVICES 1 60 | #endif 61 | 62 | /** 63 | * MDNS_DEBUG: Enable debugging for multicast DNS. 64 | */ 65 | #ifndef MDNS_DEBUG 66 | #define MDNS_DEBUG LWIP_DBG_OFF 67 | #endif 68 | 69 | /** 70 | * @} 71 | */ 72 | 73 | #endif /* LWIP_HDR_APPS_MDNS_OPTS_H */ 74 | 75 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/prot/mld6.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * MLD6 protocol definitions 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Adam Dunkels 35 | * 36 | */ 37 | #ifndef LWIP_HDR_PROT_MLD6_H 38 | #define LWIP_HDR_PROT_MLD6_H 39 | 40 | #include "lwip/arch.h" 41 | #include "lwip/ip6_addr.h" 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /** Multicast listener report/query/done message header. */ 48 | #ifdef PACK_STRUCT_USE_INCLUDES 49 | # include "arch/bpstruct.h" 50 | #endif 51 | PACK_STRUCT_BEGIN 52 | struct mld_header { 53 | PACK_STRUCT_FLD_8(u8_t type); 54 | PACK_STRUCT_FLD_8(u8_t code); 55 | PACK_STRUCT_FIELD(u16_t chksum); 56 | PACK_STRUCT_FIELD(u16_t max_resp_delay); 57 | PACK_STRUCT_FIELD(u16_t reserved); 58 | PACK_STRUCT_FLD_S(ip6_addr_p_t multicast_address); 59 | /* Options follow. */ 60 | } PACK_STRUCT_STRUCT; 61 | PACK_STRUCT_END 62 | #ifdef PACK_STRUCT_USE_INCLUDES 63 | # include "arch/epstruct.h" 64 | #endif 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* LWIP_HDR_PROT_MLD6_H */ 71 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/mem.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Heap API 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Adam Dunkels 35 | * 36 | */ 37 | #ifndef LWIP_HDR_MEM_H 38 | #define LWIP_HDR_MEM_H 39 | 40 | #include "lwip/opt.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | #if MEM_LIBC_MALLOC 47 | 48 | #include /* for size_t */ 49 | typedef size_t mem_size_t; 50 | #define MEM_SIZE_F SZT_F 51 | 52 | #elif MEM_USE_POOLS 53 | 54 | typedef u16_t mem_size_t; 55 | #define MEM_SIZE_F U16_F 56 | 57 | #else 58 | 59 | /* MEM_SIZE would have to be aligned, but using 64000 here instead of 60 | * 65535 leaves some room for alignment... 61 | */ 62 | #if MEM_SIZE > 64000L 63 | typedef u32_t mem_size_t; 64 | #define MEM_SIZE_F U32_F 65 | #else 66 | typedef u16_t mem_size_t; 67 | #define MEM_SIZE_F U16_F 68 | #endif /* MEM_SIZE > 64000 */ 69 | #endif 70 | 71 | void mem_init(void); 72 | void *mem_trim(void *mem, mem_size_t size); 73 | void *mem_malloc(mem_size_t size); 74 | void *mem_calloc(mem_size_t count, mem_size_t size); 75 | void mem_free(void *mem); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* LWIP_HDR_MEM_H */ 82 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/apps/mdns_priv.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * MDNS responder private definitions 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2015 Verisure Innovation AB 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Erik Ekman 35 | * 36 | */ 37 | #ifndef LWIP_HDR_MDNS_PRIV_H 38 | #define LWIP_HDR_MDNS_PRIV_H 39 | 40 | #include "lwip/apps/mdns_opts.h" 41 | #include "lwip/pbuf.h" 42 | 43 | #if LWIP_MDNS_RESPONDER 44 | 45 | /* Domain struct and methods - visible for unit tests */ 46 | 47 | #define MDNS_DOMAIN_MAXLEN 256 48 | #define MDNS_READNAME_ERROR 0xFFFF 49 | 50 | struct mdns_domain { 51 | /* Encoded domain name */ 52 | u8_t name[MDNS_DOMAIN_MAXLEN]; 53 | /* Total length of domain name, including zero */ 54 | u16_t length; 55 | /* Set if compression of this domain is not allowed */ 56 | u8_t skip_compression; 57 | }; 58 | 59 | err_t mdns_domain_add_label(struct mdns_domain *domain, const char *label, u8_t len); 60 | u16_t mdns_readname(struct pbuf *p, u16_t offset, struct mdns_domain *domain); 61 | int mdns_domain_eq(struct mdns_domain *a, struct mdns_domain *b); 62 | u16_t mdns_compress_domain(struct pbuf *pbuf, u16_t *offset, struct mdns_domain *domain); 63 | 64 | #endif /* LWIP_MDNS_RESPONDER */ 65 | 66 | #endif /* LWIP_HDR_MDNS_PRIV_H */ 67 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/apps/mdns.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * MDNS responder 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2015 Verisure Innovation AB 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Erik Ekman 35 | * 36 | */ 37 | #ifndef LWIP_HDR_MDNS_H 38 | #define LWIP_HDR_MDNS_H 39 | 40 | #include "lwip/apps/mdns_opts.h" 41 | #include "lwip/netif.h" 42 | 43 | #if LWIP_MDNS_RESPONDER 44 | 45 | enum mdns_sd_proto { 46 | DNSSD_PROTO_UDP = 0, 47 | DNSSD_PROTO_TCP = 1 48 | }; 49 | 50 | #define MDNS_LABEL_MAXLEN 63 51 | 52 | struct mdns_host; 53 | struct mdns_service; 54 | 55 | /** Callback function to add text to a reply, called when generating the reply */ 56 | typedef void (*service_get_txt_fn_t)(struct mdns_service *service, void *txt_userdata); 57 | 58 | void mdns_resp_init(void); 59 | 60 | err_t mdns_resp_add_netif(struct netif *netif, const char *hostname, u32_t dns_ttl); 61 | err_t mdns_resp_remove_netif(struct netif *netif); 62 | 63 | err_t mdns_resp_add_service(struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_userdata); 64 | err_t mdns_resp_add_service_txtitem(struct mdns_service *service, const char *txt, u8_t txt_len); 65 | void mdns_resp_netif_settings_changed(struct netif *netif); 66 | 67 | #endif /* LWIP_MDNS_RESPONDER */ 68 | 69 | #endif /* LWIP_HDR_MDNS_H */ 70 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/system/arch/cc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __CC_H__ 33 | #define __CC_H__ 34 | 35 | #include "cpu.h" 36 | #include 37 | #include 38 | 39 | typedef int sys_prot_t; 40 | 41 | #define LWIP_PROVIDE_ERRNO 42 | 43 | #define LWIP_PLATFORM_DIAG(message) printf message 44 | 45 | /* define compiler specific symbols */ 46 | #if defined (__ICCARM__) 47 | 48 | #define PACK_STRUCT_BEGIN 49 | #define PACK_STRUCT_STRUCT 50 | #define PACK_STRUCT_END 51 | #define PACK_STRUCT_FIELD(x) x 52 | #define PACK_STRUCT_USE_INCLUDES 53 | 54 | #elif defined (__CC_ARM) 55 | 56 | #define PACK_STRUCT_BEGIN __packed 57 | #define PACK_STRUCT_STRUCT 58 | #define PACK_STRUCT_END 59 | #define PACK_STRUCT_FIELD(x) x 60 | 61 | 62 | #elif defined (__GNUC__) 63 | 64 | #define PACK_STRUCT_BEGIN 65 | #define PACK_STRUCT_STRUCT __attribute__ ((__packed__)) 66 | #define PACK_STRUCT_END 67 | #define PACK_STRUCT_FIELD(x) x 68 | 69 | #elif defined (__TASKING__) 70 | 71 | #define PACK_STRUCT_BEGIN 72 | #define PACK_STRUCT_STRUCT 73 | #define PACK_STRUCT_END 74 | #define PACK_STRUCT_FIELD(x) x 75 | 76 | #endif 77 | 78 | #define LWIP_PLATFORM_ASSERT(x) //do { if(!(x)) while(1); } while(0) 79 | 80 | #define LWIP_RAND() ((u32_t)rand()) 81 | 82 | #endif /* __CC_H__ */ 83 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/modbus/port/porttimer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: BARE Port 3 | * Copyright (C) 2006 Christian Walter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * File: $Id: porttimer.c,v 1.1 2006/08/22 21:35:13 wolti Exp $ 20 | */ 21 | 22 | /* ----------------------- Platform includes --------------------------------*/ 23 | #include "port.h" 24 | 25 | /* ----------------------- Modbus includes ----------------------------------*/ 26 | #include "mb.h" 27 | #include "mbport.h" 28 | 29 | /* ----------------------- static functions ---------------------------------*/ 30 | extern TIM_HandleTypeDef htim7; 31 | uint16_t timeout = 0; 32 | uint16_t downcounter = 0; 33 | //static void prvvTIMERExpiredISR( void ); 34 | 35 | /* ----------------------- Start implementation -----------------------------*/ 36 | 37 | BOOL 38 | xMBPortTimersInit( USHORT usTim1Timerout50us ) 39 | { 40 | TIM_MasterConfigTypeDef sMasterConfig; 41 | 42 | htim7.Instance = TIM7; 43 | htim7.Init.Prescaler = (HAL_RCC_GetPCLK1Freq() / 1000000) - 1; 44 | htim7.Init.CounterMode = TIM_COUNTERMODE_UP; 45 | htim7.Init.Period = 50 - 1; 46 | 47 | timeout = usTim1Timerout50us; 48 | 49 | if (HAL_TIM_Base_Init(&htim7) != HAL_OK) 50 | { 51 | return FALSE; 52 | } 53 | 54 | sMasterConfig.MasterOutputTrigger = TIM_TRGO_UPDATE; 55 | sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; 56 | if (HAL_TIMEx_MasterConfigSynchronization(&htim7, &sMasterConfig) != HAL_OK) 57 | { 58 | return FALSE; 59 | } 60 | 61 | return TRUE; 62 | } 63 | 64 | void 65 | vMBPortTimersEnable( ) 66 | { 67 | /* Enable the timer with the timeout passed to xMBPortTimersInit( ) */ 68 | downcounter = timeout; 69 | HAL_TIM_Base_Start_IT(&htim7); 70 | } 71 | 72 | void 73 | vMBPortTimersDisable( ) 74 | { 75 | /* Disable any pending timers. */ 76 | HAL_TIM_Base_Stop_IT(&htim7); 77 | } 78 | 79 | /* Create an ISR which is called whenever the timer has expired. This function 80 | * must then call pxMBPortCBTimerExpired( ) to notify the protocol stack that 81 | * the timer has expired. 82 | * THIS FUNCTION IS NOT USED!!!! 83 | 84 | static void prvvTIMERExpiredISR( void ) 85 | { 86 | ( void )pxMBPortCBTimerExpired( ); 87 | } 88 | */ 89 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/apps/sntp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * SNTP client API 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2007-2009 Frédéric Bernon, Simon Goldschmidt 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Frédéric Bernon, Simon Goldschmidt 35 | * 36 | */ 37 | #ifndef LWIP_HDR_APPS_SNTP_H 38 | #define LWIP_HDR_APPS_SNTP_H 39 | 40 | #include "lwip/apps/sntp_opts.h" 41 | #include "lwip/ip_addr.h" 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /* SNTP operating modes: default is to poll using unicast. 48 | The mode has to be set before calling sntp_init(). */ 49 | #define SNTP_OPMODE_POLL 0 50 | #define SNTP_OPMODE_LISTENONLY 1 51 | void sntp_setoperatingmode(u8_t operating_mode); 52 | u8_t sntp_getoperatingmode(void); 53 | 54 | void sntp_init(void); 55 | void sntp_stop(void); 56 | u8_t sntp_enabled(void); 57 | 58 | void sntp_setserver(u8_t idx, const ip_addr_t *addr); 59 | const ip_addr_t* sntp_getserver(u8_t idx); 60 | 61 | #if SNTP_SERVER_DNS 62 | void sntp_setservername(u8_t idx, char *server); 63 | char *sntp_getservername(u8_t idx); 64 | #endif /* SNTP_SERVER_DNS */ 65 | 66 | #if SNTP_GET_SERVERS_FROM_DHCP 67 | void sntp_servermode_dhcp(int set_servers_from_dhcp); 68 | #else /* SNTP_GET_SERVERS_FROM_DHCP */ 69 | #define sntp_servermode_dhcp(x) 70 | #endif /* SNTP_GET_SERVERS_FROM_DHCP */ 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif /* LWIP_HDR_APPS_SNTP_H */ 77 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/prot/icmp6.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * ICMP6 protocol definitions 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Adam Dunkels 35 | * 36 | */ 37 | #ifndef LWIP_HDR_PROT_ICMP6_H 38 | #define LWIP_HDR_PROT_ICMP6_H 39 | 40 | #include "lwip/arch.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /** This is the standard ICMP6 header. */ 47 | #ifdef PACK_STRUCT_USE_INCLUDES 48 | # include "arch/bpstruct.h" 49 | #endif 50 | PACK_STRUCT_BEGIN 51 | struct icmp6_hdr { 52 | PACK_STRUCT_FLD_8(u8_t type); 53 | PACK_STRUCT_FLD_8(u8_t code); 54 | PACK_STRUCT_FIELD(u16_t chksum); 55 | PACK_STRUCT_FIELD(u32_t data); 56 | } PACK_STRUCT_STRUCT; 57 | PACK_STRUCT_END 58 | #ifdef PACK_STRUCT_USE_INCLUDES 59 | # include "arch/epstruct.h" 60 | #endif 61 | 62 | /** This is the ICMP6 header adapted for echo req/resp. */ 63 | #ifdef PACK_STRUCT_USE_INCLUDES 64 | # include "arch/bpstruct.h" 65 | #endif 66 | PACK_STRUCT_BEGIN 67 | struct icmp6_echo_hdr { 68 | PACK_STRUCT_FLD_8(u8_t type); 69 | PACK_STRUCT_FLD_8(u8_t code); 70 | PACK_STRUCT_FIELD(u16_t chksum); 71 | PACK_STRUCT_FIELD(u16_t id); 72 | PACK_STRUCT_FIELD(u16_t seqno); 73 | } PACK_STRUCT_STRUCT; 74 | PACK_STRUCT_END 75 | #ifdef PACK_STRUCT_USE_INCLUDES 76 | # include "arch/epstruct.h" 77 | #endif 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif /* LWIP_HDR_PROT_ICMP6_H */ 84 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/ppp/polarssl/arc4.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file arc4.h 3 | * 4 | * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine 5 | * 6 | * Copyright (C) 2009 Paul Bakker 7 | * 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * * Neither the names of PolarSSL or XySSL nor the names of its contributors 20 | * may be used to endorse or promote products derived from this software 21 | * without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 29 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 30 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | 36 | #include "netif/ppp/ppp_opts.h" 37 | #if LWIP_INCLUDED_POLARSSL_ARC4 38 | 39 | #ifndef LWIP_INCLUDED_POLARSSL_ARC4_H 40 | #define LWIP_INCLUDED_POLARSSL_ARC4_H 41 | 42 | /** 43 | * \brief ARC4 context structure 44 | */ 45 | typedef struct 46 | { 47 | int x; /*!< permutation index */ 48 | int y; /*!< permutation index */ 49 | unsigned char m[256]; /*!< permutation table */ 50 | } 51 | arc4_context; 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | /** 58 | * \brief ARC4 key schedule 59 | * 60 | * \param ctx ARC4 context to be initialized 61 | * \param key the secret key 62 | * \param keylen length of the key 63 | */ 64 | void arc4_setup( arc4_context *ctx, unsigned char *key, int keylen ); 65 | 66 | /** 67 | * \brief ARC4 cipher function 68 | * 69 | * \param ctx ARC4 context 70 | * \param buf buffer to be processed 71 | * \param buflen amount of data in buf 72 | */ 73 | void arc4_crypt( arc4_context *ctx, unsigned char *buf, int buflen ); 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif /* LWIP_INCLUDED_POLARSSL_ARC4_H */ 80 | 81 | #endif /* LWIP_INCLUDED_POLARSSL_ARC4 */ 82 | -------------------------------------------------------------------------------- /Inc/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_it.h 4 | * @brief This file contains the headers of the interrupt handlers. 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2017 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | 34 | /* Define to prevent recursive inclusion -------------------------------------*/ 35 | #ifndef __STM32F4xx_IT_H 36 | #define __STM32F4xx_IT_H 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /* Includes ------------------------------------------------------------------*/ 43 | /* Exported types ------------------------------------------------------------*/ 44 | /* Exported constants --------------------------------------------------------*/ 45 | /* Exported macro ------------------------------------------------------------*/ 46 | /* Exported functions ------------------------------------------------------- */ 47 | 48 | void NMI_Handler(void); 49 | void HardFault_Handler(void); 50 | void MemManage_Handler(void); 51 | void BusFault_Handler(void); 52 | void UsageFault_Handler(void); 53 | void SVC_Handler(void); 54 | void DebugMon_Handler(void); 55 | void PendSV_Handler(void); 56 | void SysTick_Handler(void); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* __STM32F4xx_IT_H */ 63 | 64 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 65 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/ethernet.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Ethernet input function - handles INCOMING ethernet level traffic 4 | * To be used in most low-level netif implementations 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 9 | * Copyright (c) 2003-2004 Leon Woestenberg 10 | * Copyright (c) 2003-2004 Axon Digital Design B.V., The Netherlands. 11 | * All rights reserved. 12 | * 13 | * Redistribution and use in source and binary forms, with or without modification, 14 | * are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 3. The name of the author may not be used to endorse or promote products 22 | * derived from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 25 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 27 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 28 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 29 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 33 | * OF SUCH DAMAGE. 34 | * 35 | * This file is part of the lwIP TCP/IP stack. 36 | * 37 | * Author: Adam Dunkels 38 | * 39 | */ 40 | 41 | #ifndef LWIP_HDR_NETIF_ETHERNET_H 42 | #define LWIP_HDR_NETIF_ETHERNET_H 43 | 44 | #include "lwip/opt.h" 45 | 46 | #include "lwip/pbuf.h" 47 | #include "lwip/netif.h" 48 | #include "lwip/prot/ethernet.h" 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | 54 | #if LWIP_ARP || LWIP_ETHERNET 55 | 56 | /** Define this to 1 and define LWIP_ARP_FILTER_NETIF_FN(pbuf, netif, type) 57 | * to a filter function that returns the correct netif when using multiple 58 | * netifs on one hardware interface where the netif's low-level receive 59 | * routine cannot decide for the correct netif (e.g. when mapping multiple 60 | * IP addresses to one hardware interface). 61 | */ 62 | #ifndef LWIP_ARP_FILTER_NETIF 63 | #define LWIP_ARP_FILTER_NETIF 0 64 | #endif 65 | 66 | err_t ethernet_input(struct pbuf *p, struct netif *netif); 67 | err_t ethernet_output(struct netif* netif, struct pbuf* p, const struct eth_addr* src, const struct eth_addr* dst, u16_t eth_type); 68 | 69 | extern const struct eth_addr ethbroadcast, ethzero; 70 | 71 | #endif /* LWIP_ARP || LWIP_ETHERNET */ 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif /* LWIP_HDR_NETIF_ETHERNET_H */ 78 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/prot/etharp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * ARP protocol definitions 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Adam Dunkels 35 | * 36 | */ 37 | #ifndef LWIP_HDR_PROT_ETHARP_H 38 | #define LWIP_HDR_PROT_ETHARP_H 39 | 40 | #include "lwip/arch.h" 41 | #include "lwip/prot/ethernet.h" 42 | #include "lwip/ip4_addr.h" 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | #ifndef ETHARP_HWADDR_LEN 49 | #define ETHARP_HWADDR_LEN ETH_HWADDR_LEN 50 | #endif 51 | 52 | #ifdef PACK_STRUCT_USE_INCLUDES 53 | # include "arch/bpstruct.h" 54 | #endif 55 | PACK_STRUCT_BEGIN 56 | /** the ARP message, see RFC 826 ("Packet format") */ 57 | struct etharp_hdr { 58 | PACK_STRUCT_FIELD(u16_t hwtype); 59 | PACK_STRUCT_FIELD(u16_t proto); 60 | PACK_STRUCT_FLD_8(u8_t hwlen); 61 | PACK_STRUCT_FLD_8(u8_t protolen); 62 | PACK_STRUCT_FIELD(u16_t opcode); 63 | PACK_STRUCT_FLD_S(struct eth_addr shwaddr); 64 | PACK_STRUCT_FLD_S(struct ip4_addr2 sipaddr); 65 | PACK_STRUCT_FLD_S(struct eth_addr dhwaddr); 66 | PACK_STRUCT_FLD_S(struct ip4_addr2 dipaddr); 67 | } PACK_STRUCT_STRUCT; 68 | PACK_STRUCT_END 69 | #ifdef PACK_STRUCT_USE_INCLUDES 70 | # include "arch/epstruct.h" 71 | #endif 72 | 73 | #define SIZEOF_ETHARP_HDR 28 74 | 75 | /* ARP hwtype values */ 76 | enum etharp_hwtype { 77 | HWTYPE_ETHERNET = 1 78 | /* others not used */ 79 | }; 80 | 81 | /* ARP message types (opcodes) */ 82 | enum etharp_opcode { 83 | ARP_REQUEST = 1, 84 | ARP_REPLY = 2 85 | }; 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | #endif /* LWIP_HDR_PROT_ETHARP_H */ 92 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/apps/snmp_mib2.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * SNMP MIB2 API 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Dirk Ziegelmeier 35 | * 36 | */ 37 | #ifndef LWIP_HDR_APPS_SNMP_MIB2_H 38 | #define LWIP_HDR_APPS_SNMP_MIB2_H 39 | 40 | #include "lwip/apps/snmp_opts.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | #if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ 47 | #if SNMP_LWIP_MIB2 48 | 49 | #include "lwip/apps/snmp_core.h" 50 | 51 | extern const struct snmp_mib mib2; 52 | 53 | #if SNMP_USE_NETCONN 54 | #include "lwip/apps/snmp_threadsync.h" 55 | void snmp_mib2_lwip_synchronizer(snmp_threadsync_called_fn fn, void* arg); 56 | extern struct snmp_threadsync_instance snmp_mib2_lwip_locks; 57 | #endif 58 | 59 | #ifndef SNMP_SYSSERVICES 60 | #define SNMP_SYSSERVICES ((1 << 6) | (1 << 3) | ((IP_FORWARD) << 2)) 61 | #endif 62 | 63 | void snmp_mib2_set_sysdescr(const u8_t* str, const u16_t* len); /* read-only be defintion */ 64 | void snmp_mib2_set_syscontact(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize); 65 | void snmp_mib2_set_syscontact_readonly(const u8_t *ocstr, const u16_t *ocstrlen); 66 | void snmp_mib2_set_sysname(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize); 67 | void snmp_mib2_set_sysname_readonly(const u8_t *ocstr, const u16_t *ocstrlen); 68 | void snmp_mib2_set_syslocation(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize); 69 | void snmp_mib2_set_syslocation_readonly(const u8_t *ocstr, const u16_t *ocstrlen); 70 | 71 | #endif /* SNMP_LWIP_MIB2 */ 72 | #endif /* LWIP_SNMP */ 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* LWIP_HDR_APPS_SNMP_MIB2_H */ 79 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/lowpan6.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * 6LowPAN output for IPv6. Uses ND tables for link-layer addressing. Fragments packets to 6LowPAN units. 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2015 Inico Technologies Ltd. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Ivan Delamer 36 | * 37 | * 38 | * Please coordinate changes and requests with Ivan Delamer 39 | * 40 | */ 41 | 42 | #ifndef LWIP_HDR_LOWPAN6_H 43 | #define LWIP_HDR_LOWPAN6_H 44 | 45 | #include "netif/lowpan6_opts.h" 46 | 47 | #if LWIP_IPV6 && LWIP_6LOWPAN /* don't build if not configured for use in lwipopts.h */ 48 | 49 | #include "lwip/pbuf.h" 50 | #include "lwip/ip.h" 51 | #include "lwip/ip_addr.h" 52 | #include "lwip/netif.h" 53 | 54 | #ifdef __cplusplus 55 | extern "C" { 56 | #endif 57 | 58 | /** 1 second period */ 59 | #define LOWPAN6_TMR_INTERVAL 1000 60 | 61 | void lowpan6_tmr(void); 62 | 63 | err_t lowpan6_set_context(u8_t index, const ip6_addr_t * context); 64 | err_t lowpan6_set_short_addr(u8_t addr_high, u8_t addr_low); 65 | 66 | #if LWIP_IPV4 67 | err_t lowpan4_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr); 68 | #endif /* LWIP_IPV4 */ 69 | err_t lowpan6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr); 70 | err_t lowpan6_input(struct pbuf * p, struct netif *netif); 71 | err_t lowpan6_if_init(struct netif *netif); 72 | 73 | /* pan_id in network byte order. */ 74 | err_t lowpan6_set_pan_id(u16_t pan_id); 75 | 76 | #if !NO_SYS 77 | err_t tcpip_6lowpan_input(struct pbuf *p, struct netif *inp); 78 | #endif /* !NO_SYS */ 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #endif /* LWIP_IPV6 && LWIP_6LOWPAN */ 85 | 86 | #endif /* LWIP_HDR_LOWPAN6_H */ 87 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/modbus/include/mbfunc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. 3 | * Copyright (c) 2006 Christian Walter 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * File: $Id: mbfunc.h,v 1.12 2006/12/07 22:10:34 wolti Exp $ 29 | */ 30 | 31 | #ifndef _MB_FUNC_H 32 | #define _MB_FUNC_H 33 | 34 | #ifdef __cplusplus 35 | PR_BEGIN_EXTERN_C 36 | #endif 37 | #if MB_FUNC_OTHER_REP_SLAVEID_BUF > 0 38 | eMBException eMBFuncReportSlaveID( UCHAR * pucFrame, USHORT * usLen ); 39 | #endif 40 | 41 | #if MB_FUNC_READ_INPUT_ENABLED > 0 42 | eMBException eMBFuncReadInputRegister( UCHAR * pucFrame, USHORT * usLen ); 43 | #endif 44 | 45 | #if MB_FUNC_READ_HOLDING_ENABLED > 0 46 | eMBException eMBFuncReadHoldingRegister( UCHAR * pucFrame, USHORT * usLen ); 47 | #endif 48 | 49 | #if MB_FUNC_WRITE_HOLDING_ENABLED > 0 50 | eMBException eMBFuncWriteHoldingRegister( UCHAR * pucFrame, USHORT * usLen ); 51 | #endif 52 | 53 | #if MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED > 0 54 | eMBException eMBFuncWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen ); 55 | #endif 56 | 57 | #if MB_FUNC_READ_COILS_ENABLED > 0 58 | eMBException eMBFuncReadCoils( UCHAR * pucFrame, USHORT * usLen ); 59 | #endif 60 | 61 | #if MB_FUNC_WRITE_COIL_ENABLED > 0 62 | eMBException eMBFuncWriteCoil( UCHAR * pucFrame, USHORT * usLen ); 63 | #endif 64 | 65 | #if MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED > 0 66 | eMBException eMBFuncWriteMultipleCoils( UCHAR * pucFrame, USHORT * usLen ); 67 | #endif 68 | 69 | #if MB_FUNC_READ_DISCRETE_INPUTS_ENABLED > 0 70 | eMBException eMBFuncReadDiscreteInputs( UCHAR * pucFrame, USHORT * usLen ); 71 | #endif 72 | 73 | #if MB_FUNC_READWRITE_HOLDING_ENABLED > 0 74 | eMBException eMBFuncReadWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen ); 75 | #endif 76 | 77 | #ifdef __cplusplus 78 | PR_END_EXTERN_C 79 | #endif 80 | #endif 81 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/prot/igmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * IGMP protocol definitions 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Adam Dunkels 35 | * 36 | */ 37 | #ifndef LWIP_HDR_PROT_IGMP_H 38 | #define LWIP_HDR_PROT_IGMP_H 39 | 40 | #include "lwip/arch.h" 41 | #include "lwip/ip4_addr.h" 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /* 48 | * IGMP constants 49 | */ 50 | #define IGMP_TTL 1 51 | #define IGMP_MINLEN 8 52 | #define ROUTER_ALERT 0x9404U 53 | #define ROUTER_ALERTLEN 4 54 | 55 | /* 56 | * IGMP message types, including version number. 57 | */ 58 | #define IGMP_MEMB_QUERY 0x11 /* Membership query */ 59 | #define IGMP_V1_MEMB_REPORT 0x12 /* Ver. 1 membership report */ 60 | #define IGMP_V2_MEMB_REPORT 0x16 /* Ver. 2 membership report */ 61 | #define IGMP_LEAVE_GROUP 0x17 /* Leave-group message */ 62 | 63 | /* Group membership states */ 64 | #define IGMP_GROUP_NON_MEMBER 0 65 | #define IGMP_GROUP_DELAYING_MEMBER 1 66 | #define IGMP_GROUP_IDLE_MEMBER 2 67 | 68 | /** 69 | * IGMP packet format. 70 | */ 71 | #ifdef PACK_STRUCT_USE_INCLUDES 72 | # include "arch/bpstruct.h" 73 | #endif 74 | PACK_STRUCT_BEGIN 75 | struct igmp_msg { 76 | PACK_STRUCT_FLD_8(u8_t igmp_msgtype); 77 | PACK_STRUCT_FLD_8(u8_t igmp_maxresp); 78 | PACK_STRUCT_FIELD(u16_t igmp_checksum); 79 | PACK_STRUCT_FLD_S(ip4_addr_p_t igmp_group_address); 80 | } PACK_STRUCT_STRUCT; 81 | PACK_STRUCT_END 82 | #ifdef PACK_STRUCT_USE_INCLUDES 83 | # include "arch/epstruct.h" 84 | #endif 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif /* LWIP_HDR_PROT_IGMP_H */ 91 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/ppp/eui64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * eui64.h - EUI64 routines for IPv6CP. 3 | * 4 | * Copyright (c) 1999 Tommi Komulainen. All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in 15 | * the documentation and/or other materials provided with the 16 | * distribution. 17 | * 18 | * 3. The name(s) of the authors of this software must not be used to 19 | * endorse or promote products derived from this software without 20 | * prior written permission. 21 | * 22 | * 4. Redistributions of any form whatsoever must retain the following 23 | * acknowledgment: 24 | * "This product includes software developed by Tommi Komulainen 25 | * ". 26 | * 27 | * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO 28 | * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 29 | * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY 30 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 31 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 32 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 33 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 34 | * 35 | * $Id: eui64.h,v 1.6 2002/12/04 23:03:32 paulus Exp $ 36 | */ 37 | 38 | #include "netif/ppp/ppp_opts.h" 39 | #if PPP_SUPPORT && PPP_IPV6_SUPPORT /* don't build if not configured for use in lwipopts.h */ 40 | 41 | #ifndef EUI64_H 42 | #define EUI64_H 43 | 44 | /* 45 | * @todo: 46 | * 47 | * Maybe this should be done by processing struct in6_addr directly... 48 | */ 49 | typedef union 50 | { 51 | u8_t e8[8]; 52 | u16_t e16[4]; 53 | u32_t e32[2]; 54 | } eui64_t; 55 | 56 | #define eui64_iszero(e) (((e).e32[0] | (e).e32[1]) == 0) 57 | #define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \ 58 | ((e).e32[1] == (o).e32[1])) 59 | #define eui64_zero(e) (e).e32[0] = (e).e32[1] = 0; 60 | 61 | #define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t)) 62 | 63 | #define eui64_magic(e) do { \ 64 | (e).e32[0] = magic(); \ 65 | (e).e32[1] = magic(); \ 66 | (e).e8[0] &= ~2; \ 67 | } while (0) 68 | #define eui64_magic_nz(x) do { \ 69 | eui64_magic(x); \ 70 | } while (eui64_iszero(x)) 71 | #define eui64_magic_ne(x, y) do { \ 72 | eui64_magic(x); \ 73 | } while (eui64_equals(x, y)) 74 | 75 | #define eui64_get(ll, cp) do { \ 76 | eui64_copy((*cp), (ll)); \ 77 | (cp) += sizeof(eui64_t); \ 78 | } while (0) 79 | 80 | #define eui64_put(ll, cp) do { \ 81 | eui64_copy((ll), (*cp)); \ 82 | (cp) += sizeof(eui64_t); \ 83 | } while (0) 84 | 85 | #define eui64_set32(e, l) do { \ 86 | (e).e32[0] = 0; \ 87 | (e).e32[1] = lwip_htonl(l); \ 88 | } while (0) 89 | #define eui64_setlo32(e, l) eui64_set32(e, l) 90 | 91 | char *eui64_ntoa(eui64_t); /* Returns ascii representation of id */ 92 | 93 | #endif /* EUI64_H */ 94 | #endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */ 95 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/ppp/polarssl/des.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file des.h 3 | * 4 | * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine 5 | * 6 | * Copyright (C) 2009 Paul Bakker 7 | * 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * * Neither the names of PolarSSL or XySSL nor the names of its contributors 20 | * may be used to endorse or promote products derived from this software 21 | * without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 29 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 30 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | 36 | #include "netif/ppp/ppp_opts.h" 37 | #if LWIP_INCLUDED_POLARSSL_DES 38 | 39 | #ifndef LWIP_INCLUDED_POLARSSL_DES_H 40 | #define LWIP_INCLUDED_POLARSSL_DES_H 41 | 42 | #define DES_ENCRYPT 1 43 | #define DES_DECRYPT 0 44 | 45 | /** 46 | * \brief DES context structure 47 | */ 48 | typedef struct 49 | { 50 | int mode; /*!< encrypt/decrypt */ 51 | unsigned long sk[32]; /*!< DES subkeys */ 52 | } 53 | des_context; 54 | 55 | #ifdef __cplusplus 56 | extern "C" { 57 | #endif 58 | 59 | /** 60 | * \brief DES key schedule (56-bit, encryption) 61 | * 62 | * \param ctx DES context to be initialized 63 | * \param key 8-byte secret key 64 | */ 65 | void des_setkey_enc( des_context *ctx, unsigned char key[8] ); 66 | 67 | /** 68 | * \brief DES key schedule (56-bit, decryption) 69 | * 70 | * \param ctx DES context to be initialized 71 | * \param key 8-byte secret key 72 | */ 73 | void des_setkey_dec( des_context *ctx, unsigned char key[8] ); 74 | 75 | /** 76 | * \brief DES-ECB block encryption/decryption 77 | * 78 | * \param ctx DES context 79 | * \param input 64-bit input block 80 | * \param output 64-bit output block 81 | */ 82 | void des_crypt_ecb( des_context *ctx, 83 | const unsigned char input[8], 84 | unsigned char output[8] ); 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif /* LWIP_INCLUDED_POLARSSL_DES_H */ 91 | 92 | #endif /* LWIP_INCLUDED_POLARSSL_DES */ 93 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/apps/lwiperf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * lwIP iPerf server implementation 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2014 Simon Goldschmidt 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Simon Goldschmidt 35 | * 36 | */ 37 | #ifndef LWIP_HDR_APPS_LWIPERF_H 38 | #define LWIP_HDR_APPS_LWIPERF_H 39 | 40 | #include "lwip/opt.h" 41 | #include "lwip/ip_addr.h" 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | #define LWIPERF_TCP_PORT_DEFAULT 5001 48 | 49 | /** lwIPerf test results */ 50 | enum lwiperf_report_type 51 | { 52 | /** The server side test is done */ 53 | LWIPERF_TCP_DONE_SERVER, 54 | /** The client side test is done */ 55 | LWIPERF_TCP_DONE_CLIENT, 56 | /** Local error lead to test abort */ 57 | LWIPERF_TCP_ABORTED_LOCAL, 58 | /** Data check error lead to test abort */ 59 | LWIPERF_TCP_ABORTED_LOCAL_DATAERROR, 60 | /** Transmit error lead to test abort */ 61 | LWIPERF_TCP_ABORTED_LOCAL_TXERROR, 62 | /** Remote side aborted the test */ 63 | LWIPERF_TCP_ABORTED_REMOTE 64 | }; 65 | 66 | /** Prototype of a report function that is called when a session is finished. 67 | This report function can show the test results. 68 | @param report_type contains the test result */ 69 | typedef void (*lwiperf_report_fn)(void *arg, enum lwiperf_report_type report_type, 70 | const ip_addr_t* local_addr, u16_t local_port, const ip_addr_t* remote_addr, u16_t remote_port, 71 | u32_t bytes_transferred, u32_t ms_duration, u32_t bandwidth_kbitpsec); 72 | 73 | 74 | void* lwiperf_start_tcp_server(const ip_addr_t* local_addr, u16_t local_port, 75 | lwiperf_report_fn report_fn, void* report_arg); 76 | void* lwiperf_start_tcp_server_default(lwiperf_report_fn report_fn, void* report_arg); 77 | void lwiperf_abort(void* lwiperf_session); 78 | 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #endif /* LWIP_HDR_APPS_LWIPERF_H */ 85 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/slipif.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * SLIP netif API 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001, Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 1. Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * 3. Neither the name of the Institute nor the names of its contributors 20 | * may be used to endorse or promote products derived from this software 21 | * without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 24 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 | * SUCH DAMAGE. 34 | * 35 | * This file is part of the lwIP TCP/IP stack. 36 | * 37 | * Author: Adam Dunkels 38 | * 39 | */ 40 | #ifndef LWIP_HDR_NETIF_SLIPIF_H 41 | #define LWIP_HDR_NETIF_SLIPIF_H 42 | 43 | #include "lwip/opt.h" 44 | #include "lwip/netif.h" 45 | 46 | /** Set this to 1 to start a thread that blocks reading on the serial line 47 | * (using sio_read()). 48 | */ 49 | #ifndef SLIP_USE_RX_THREAD 50 | #define SLIP_USE_RX_THREAD !NO_SYS 51 | #endif 52 | 53 | /** Set this to 1 to enable functions to pass in RX bytes from ISR context. 54 | * If enabled, slipif_received_byte[s]() process incoming bytes and put assembled 55 | * packets on a queue, which is fed into lwIP from slipif_poll(). 56 | * If disabled, slipif_poll() polls the serial line (using sio_tryread()). 57 | */ 58 | #ifndef SLIP_RX_FROM_ISR 59 | #define SLIP_RX_FROM_ISR 0 60 | #endif 61 | 62 | /** Set this to 1 (default for SLIP_RX_FROM_ISR) to queue incoming packets 63 | * received by slipif_received_byte[s]() as long as PBUF_POOL pbufs are available. 64 | * If disabled, packets will be dropped if more than one packet is received. 65 | */ 66 | #ifndef SLIP_RX_QUEUE 67 | #define SLIP_RX_QUEUE SLIP_RX_FROM_ISR 68 | #endif 69 | 70 | #ifdef __cplusplus 71 | extern "C" { 72 | #endif 73 | 74 | err_t slipif_init(struct netif * netif); 75 | void slipif_poll(struct netif *netif); 76 | #if SLIP_RX_FROM_ISR 77 | void slipif_process_rxqueue(struct netif *netif); 78 | void slipif_received_byte(struct netif *netif, u8_t data); 79 | void slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len); 80 | #endif /* SLIP_RX_FROM_ISR */ 81 | 82 | #ifdef __cplusplus 83 | } 84 | #endif 85 | 86 | #endif /* LWIP_HDR_NETIF_SLIPIF_H */ 87 | 88 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/ppp/pppdebug.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * pppdebug.h - System debugging utilities. 3 | * 4 | * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 5 | * portions Copyright (c) 1998 Global Election Systems Inc. 6 | * portions Copyright (c) 2001 by Cognizant Pty Ltd. 7 | * 8 | * The authors hereby grant permission to use, copy, modify, distribute, 9 | * and license this software and its documentation for any purpose, provided 10 | * that existing copyright notices are retained in all copies and that this 11 | * notice and the following disclaimer are included verbatim in any 12 | * distributions. No written agreement, license, or royalty fee is required 13 | * for any of the authorized uses. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | ****************************************************************************** 27 | * REVISION HISTORY (please don't use tabs!) 28 | * 29 | * 03-01-01 Marc Boucher 30 | * Ported to lwIP. 31 | * 98-07-29 Guy Lancaster , Global Election Systems Inc. 32 | * Original. 33 | * 34 | ***************************************************************************** 35 | */ 36 | 37 | #include "netif/ppp/ppp_opts.h" 38 | #if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ 39 | 40 | #ifndef PPPDEBUG_H 41 | #define PPPDEBUG_H 42 | 43 | /* Trace levels. */ 44 | #define LOG_CRITICAL (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) 45 | #define LOG_ERR (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) 46 | #define LOG_NOTICE (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING) 47 | #define LOG_WARNING (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING) 48 | #define LOG_INFO (PPP_DEBUG) 49 | #define LOG_DETAIL (PPP_DEBUG) 50 | #define LOG_DEBUG (PPP_DEBUG) 51 | 52 | #if PPP_DEBUG 53 | 54 | #define MAINDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) 55 | #define SYSDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) 56 | #define FSMDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) 57 | #define LCPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) 58 | #define IPCPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) 59 | #define IPV6CPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) 60 | #define UPAPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) 61 | #define CHAPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a) 62 | #define PPPDEBUG(a, b) LWIP_DEBUGF(a, b) 63 | 64 | #else /* PPP_DEBUG */ 65 | 66 | #define MAINDEBUG(a) 67 | #define SYSDEBUG(a) 68 | #define FSMDEBUG(a) 69 | #define LCPDEBUG(a) 70 | #define IPCPDEBUG(a) 71 | #define IPV6CPDEBUG(a) 72 | #define UPAPDEBUG(a) 73 | #define CHAPDEBUG(a) 74 | #define PPPDEBUG(a, b) 75 | 76 | #endif /* PPP_DEBUG */ 77 | 78 | #endif /* PPPDEBUG_H */ 79 | 80 | #endif /* PPP_SUPPORT */ 81 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/prot/autoip.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * AutoIP protocol definitions 4 | */ 5 | 6 | /* 7 | * 8 | * Copyright (c) 2007 Dominik Spies 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * Author: Dominik Spies 34 | * 35 | * This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform 36 | * with RFC 3927. 37 | * 38 | */ 39 | 40 | #ifndef LWIP_HDR_PROT_AUTOIP_H 41 | #define LWIP_HDR_PROT_AUTOIP_H 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /* 169.254.0.0 */ 48 | #define AUTOIP_NET 0xA9FE0000 49 | /* 169.254.1.0 */ 50 | #define AUTOIP_RANGE_START (AUTOIP_NET | 0x0100) 51 | /* 169.254.254.255 */ 52 | #define AUTOIP_RANGE_END (AUTOIP_NET | 0xFEFF) 53 | 54 | /* RFC 3927 Constants */ 55 | #define PROBE_WAIT 1 /* second (initial random delay) */ 56 | #define PROBE_MIN 1 /* second (minimum delay till repeated probe) */ 57 | #define PROBE_MAX 2 /* seconds (maximum delay till repeated probe) */ 58 | #define PROBE_NUM 3 /* (number of probe packets) */ 59 | #define ANNOUNCE_NUM 2 /* (number of announcement packets) */ 60 | #define ANNOUNCE_INTERVAL 2 /* seconds (time between announcement packets) */ 61 | #define ANNOUNCE_WAIT 2 /* seconds (delay before announcing) */ 62 | #define MAX_CONFLICTS 10 /* (max conflicts before rate limiting) */ 63 | #define RATE_LIMIT_INTERVAL 60 /* seconds (delay between successive attempts) */ 64 | #define DEFEND_INTERVAL 10 /* seconds (min. wait between defensive ARPs) */ 65 | 66 | /* AutoIP client states */ 67 | typedef enum { 68 | AUTOIP_STATE_OFF = 0, 69 | AUTOIP_STATE_PROBING = 1, 70 | AUTOIP_STATE_ANNOUNCING = 2, 71 | AUTOIP_STATE_BOUND = 3 72 | } autoip_state_enum_t; 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* LWIP_HDR_PROT_AUTOIP_H */ 79 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/apps/tftp_opts.h: -------------------------------------------------------------------------------- 1 | /****************************************************************//** 2 | * 3 | * @file tftp_opts.h 4 | * 5 | * @author Logan Gunthorpe 6 | * 7 | * @brief Trivial File Transfer Protocol (RFC 1350) implementation options 8 | * 9 | * Copyright (c) Deltatee Enterprises Ltd. 2013 10 | * All rights reserved. 11 | * 12 | ********************************************************************/ 13 | 14 | /* 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification,are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright notice, 21 | * this list of conditions and the following disclaimer in the documentation 22 | * and/or other materials provided with the distribution. 23 | * 3. The name of the author may not be used to endorse or promote products 24 | * derived from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 28 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 29 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * Author: Logan Gunthorpe 38 | * 39 | */ 40 | 41 | #ifndef LWIP_HDR_APPS_TFTP_OPTS_H 42 | #define LWIP_HDR_APPS_TFTP_OPTS_H 43 | 44 | #include "lwip/opt.h" 45 | 46 | /** 47 | * @defgroup tftp_opts Options 48 | * @ingroup tftp 49 | * @{ 50 | */ 51 | 52 | /** 53 | * Enable TFTP debug messages 54 | */ 55 | #if !defined TFTP_DEBUG || defined __DOXYGEN__ 56 | #define TFTP_DEBUG LWIP_DBG_ON 57 | #endif 58 | 59 | /** 60 | * TFTP server port 61 | */ 62 | #if !defined TFTP_PORT || defined __DOXYGEN__ 63 | #define TFTP_PORT 69 64 | #endif 65 | 66 | /** 67 | * TFTP timeout 68 | */ 69 | #if !defined TFTP_TIMEOUT_MSECS || defined __DOXYGEN__ 70 | #define TFTP_TIMEOUT_MSECS 10000 71 | #endif 72 | 73 | /** 74 | * Max. number of retries when a file is read from server 75 | */ 76 | #if !defined TFTP_MAX_RETRIES || defined __DOXYGEN__ 77 | #define TFTP_MAX_RETRIES 5 78 | #endif 79 | 80 | /** 81 | * TFTP timer cyclic interval 82 | */ 83 | #if !defined TFTP_TIMER_MSECS || defined __DOXYGEN__ 84 | #define TFTP_TIMER_MSECS 50 85 | #endif 86 | 87 | /** 88 | * Max. length of TFTP filename 89 | */ 90 | #if !defined TFTP_MAX_FILENAME_LEN || defined __DOXYGEN__ 91 | #define TFTP_MAX_FILENAME_LEN 20 92 | #endif 93 | 94 | /** 95 | * Max. length of TFTP mode 96 | */ 97 | #if !defined TFTP_MAX_MODE_LEN || defined __DOXYGEN__ 98 | #define TFTP_MAX_MODE_LEN 7 99 | #endif 100 | 101 | /** 102 | * @} 103 | */ 104 | 105 | #endif /* LWIP_HDR_APPS_TFTP_OPTS_H */ 106 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/ppp/polarssl/md5.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file md5.h 3 | * 4 | * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine 5 | * 6 | * Copyright (C) 2009 Paul Bakker 7 | * 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * * Neither the names of PolarSSL or XySSL nor the names of its contributors 20 | * may be used to endorse or promote products derived from this software 21 | * without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 29 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 30 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | 36 | #include "netif/ppp/ppp_opts.h" 37 | #if LWIP_INCLUDED_POLARSSL_MD5 38 | 39 | #ifndef LWIP_INCLUDED_POLARSSL_MD5_H 40 | #define LWIP_INCLUDED_POLARSSL_MD5_H 41 | 42 | /** 43 | * \brief MD5 context structure 44 | */ 45 | typedef struct 46 | { 47 | unsigned long total[2]; /*!< number of bytes processed */ 48 | unsigned long state[4]; /*!< intermediate digest state */ 49 | unsigned char buffer[64]; /*!< data block being processed */ 50 | } 51 | md5_context; 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | /** 58 | * \brief MD5 context setup 59 | * 60 | * \param ctx context to be initialized 61 | */ 62 | void md5_starts( md5_context *ctx ); 63 | 64 | /** 65 | * \brief MD5 process buffer 66 | * 67 | * \param ctx MD5 context 68 | * \param input buffer holding the data 69 | * \param ilen length of the input data 70 | */ 71 | void md5_update( md5_context *ctx, const unsigned char *input, int ilen ); 72 | 73 | /** 74 | * \brief MD5 final digest 75 | * 76 | * \param ctx MD5 context 77 | * \param output MD5 checksum result 78 | */ 79 | void md5_finish( md5_context *ctx, unsigned char output[16] ); 80 | 81 | /** 82 | * \brief Output = MD5( input buffer ) 83 | * 84 | * \param input buffer holding the data 85 | * \param ilen length of the input data 86 | * \param output MD5 checksum result 87 | */ 88 | void md5( unsigned char *input, int ilen, unsigned char output[16] ); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif /* LWIP_INCLUDED_POLARSSL_MD5_H */ 95 | 96 | #endif /* LWIP_INCLUDED_POLARSSL_MD5 */ 97 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/ppp/polarssl/md4.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file md4.h 3 | * 4 | * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine 5 | * 6 | * Copyright (C) 2009 Paul Bakker 7 | * 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * * Neither the names of PolarSSL or XySSL nor the names of its contributors 20 | * may be used to endorse or promote products derived from this software 21 | * without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 29 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 30 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | 36 | #include "netif/ppp/ppp_opts.h" 37 | #if LWIP_INCLUDED_POLARSSL_MD4 38 | 39 | #ifndef LWIP_INCLUDED_POLARSSL_MD4_H 40 | #define LWIP_INCLUDED_POLARSSL_MD4_H 41 | 42 | /** 43 | * \brief MD4 context structure 44 | */ 45 | typedef struct 46 | { 47 | unsigned long total[2]; /*!< number of bytes processed */ 48 | unsigned long state[4]; /*!< intermediate digest state */ 49 | unsigned char buffer[64]; /*!< data block being processed */ 50 | } 51 | md4_context; 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | /** 58 | * \brief MD4 context setup 59 | * 60 | * \param ctx context to be initialized 61 | */ 62 | void md4_starts( md4_context *ctx ); 63 | 64 | /** 65 | * \brief MD4 process buffer 66 | * 67 | * \param ctx MD4 context 68 | * \param input buffer holding the data 69 | * \param ilen length of the input data 70 | */ 71 | void md4_update( md4_context *ctx, const unsigned char *input, int ilen ); 72 | 73 | /** 74 | * \brief MD4 final digest 75 | * 76 | * \param ctx MD4 context 77 | * \param output MD4 checksum result 78 | */ 79 | void md4_finish( md4_context *ctx, unsigned char output[16] ); 80 | 81 | /** 82 | * \brief Output = MD4( input buffer ) 83 | * 84 | * \param input buffer holding the data 85 | * \param ilen length of the input data 86 | * \param output MD4 checksum result 87 | */ 88 | void md4( unsigned char *input, int ilen, unsigned char output[16] ); 89 | 90 | 91 | #ifdef __cplusplus 92 | } 93 | #endif 94 | 95 | #endif /* LWIP_INCLUDED_POLARSSL_MD4_H */ 96 | 97 | #endif /* LWIP_INCLUDED_POLARSSL_MD4 */ 98 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/netif/ppp/polarssl/sha1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file sha1.h 3 | * 4 | * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine 5 | * 6 | * Copyright (C) 2009 Paul Bakker 7 | * 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * * Neither the names of PolarSSL or XySSL nor the names of its contributors 20 | * may be used to endorse or promote products derived from this software 21 | * without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 29 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 30 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | 36 | #include "netif/ppp/ppp_opts.h" 37 | #if LWIP_INCLUDED_POLARSSL_SHA1 38 | 39 | #ifndef LWIP_INCLUDED_POLARSSL_SHA1_H 40 | #define LWIP_INCLUDED_POLARSSL_SHA1_H 41 | 42 | /** 43 | * \brief SHA-1 context structure 44 | */ 45 | typedef struct 46 | { 47 | unsigned long total[2]; /*!< number of bytes processed */ 48 | unsigned long state[5]; /*!< intermediate digest state */ 49 | unsigned char buffer[64]; /*!< data block being processed */ 50 | } 51 | sha1_context; 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | /** 58 | * \brief SHA-1 context setup 59 | * 60 | * \param ctx context to be initialized 61 | */ 62 | void sha1_starts( sha1_context *ctx ); 63 | 64 | /** 65 | * \brief SHA-1 process buffer 66 | * 67 | * \param ctx SHA-1 context 68 | * \param input buffer holding the data 69 | * \param ilen length of the input data 70 | */ 71 | void sha1_update( sha1_context *ctx, const unsigned char *input, int ilen ); 72 | 73 | /** 74 | * \brief SHA-1 final digest 75 | * 76 | * \param ctx SHA-1 context 77 | * \param output SHA-1 checksum result 78 | */ 79 | void sha1_finish( sha1_context *ctx, unsigned char output[20] ); 80 | 81 | /** 82 | * \brief Output = SHA-1( input buffer ) 83 | * 84 | * \param input buffer holding the data 85 | * \param ilen length of the input data 86 | * \param output SHA-1 checksum result 87 | */ 88 | void sha1( unsigned char *input, int ilen, unsigned char output[20] ); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif /* LWIP_INCLUDED_POLARSSL_SHA1_H */ 95 | 96 | #endif /* LWIP_INCLUDED_POLARSSL_SHA1 */ 97 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/netif/ppp/polarssl/arc4.c: -------------------------------------------------------------------------------- 1 | /* 2 | * An implementation of the ARCFOUR algorithm 3 | * 4 | * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine 5 | * 6 | * Copyright (C) 2009 Paul Bakker 7 | * 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * * Neither the names of PolarSSL or XySSL nor the names of its contributors 20 | * may be used to endorse or promote products derived from this software 21 | * without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 29 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 30 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | /* 36 | * The ARCFOUR algorithm was publicly disclosed on 94/09. 37 | * 38 | * http://groups.google.com/group/sci.crypt/msg/10a300c9d21afca0 39 | */ 40 | 41 | #include "netif/ppp/ppp_opts.h" 42 | #if PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_ARC4 43 | 44 | #include "netif/ppp/polarssl/arc4.h" 45 | /* 46 | * ARC4 key schedule 47 | */ 48 | void arc4_setup( arc4_context *ctx, unsigned char *key, int keylen ) 49 | { 50 | int i, j, k, a; 51 | unsigned char *m; 52 | 53 | ctx->x = 0; 54 | ctx->y = 0; 55 | m = ctx->m; 56 | 57 | for( i = 0; i < 256; i++ ) 58 | m[i] = (unsigned char) i; 59 | 60 | j = k = 0; 61 | 62 | for( i = 0; i < 256; i++, k++ ) 63 | { 64 | if( k >= keylen ) k = 0; 65 | 66 | a = m[i]; 67 | j = ( j + a + key[k] ) & 0xFF; 68 | m[i] = m[j]; 69 | m[j] = (unsigned char) a; 70 | } 71 | } 72 | 73 | /* 74 | * ARC4 cipher function 75 | */ 76 | void arc4_crypt( arc4_context *ctx, unsigned char *buf, int buflen ) 77 | { 78 | int i, x, y, a, b; 79 | unsigned char *m; 80 | 81 | x = ctx->x; 82 | y = ctx->y; 83 | m = ctx->m; 84 | 85 | for( i = 0; i < buflen; i++ ) 86 | { 87 | x = ( x + 1 ) & 0xFF; a = m[x]; 88 | y = ( y + a ) & 0xFF; b = m[y]; 89 | 90 | m[x] = (unsigned char) b; 91 | m[y] = (unsigned char) a; 92 | 93 | buf[i] = (unsigned char) 94 | ( buf[i] ^ m[(unsigned char)( a + b )] ); 95 | } 96 | 97 | ctx->x = x; 98 | ctx->y = y; 99 | } 100 | 101 | #endif /* PPP_SUPPORT && LWIP_INCLUDED_POLARSSL_DES */ 102 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/ip4_frag.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * IP fragmentation/reassembly 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Jani Monoses 35 | * 36 | */ 37 | 38 | #ifndef LWIP_HDR_IP4_FRAG_H 39 | #define LWIP_HDR_IP4_FRAG_H 40 | 41 | #include "lwip/opt.h" 42 | #include "lwip/err.h" 43 | #include "lwip/pbuf.h" 44 | #include "lwip/netif.h" 45 | #include "lwip/ip_addr.h" 46 | #include "lwip/ip.h" 47 | 48 | #if LWIP_IPV4 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | 54 | #if IP_REASSEMBLY 55 | /* The IP reassembly timer interval in milliseconds. */ 56 | #define IP_TMR_INTERVAL 1000 57 | 58 | /** IP reassembly helper struct. 59 | * This is exported because memp needs to know the size. 60 | */ 61 | struct ip_reassdata { 62 | struct ip_reassdata *next; 63 | struct pbuf *p; 64 | struct ip_hdr iphdr; 65 | u16_t datagram_len; 66 | u8_t flags; 67 | u8_t timer; 68 | }; 69 | 70 | void ip_reass_init(void); 71 | void ip_reass_tmr(void); 72 | struct pbuf * ip4_reass(struct pbuf *p); 73 | #endif /* IP_REASSEMBLY */ 74 | 75 | #if IP_FRAG 76 | #if !LWIP_NETIF_TX_SINGLE_PBUF 77 | #ifndef LWIP_PBUF_CUSTOM_REF_DEFINED 78 | #define LWIP_PBUF_CUSTOM_REF_DEFINED 79 | /** A custom pbuf that holds a reference to another pbuf, which is freed 80 | * when this custom pbuf is freed. This is used to create a custom PBUF_REF 81 | * that points into the original pbuf. */ 82 | struct pbuf_custom_ref { 83 | /** 'base class' */ 84 | struct pbuf_custom pc; 85 | /** pointer to the original pbuf that is referenced */ 86 | struct pbuf *original; 87 | }; 88 | #endif /* LWIP_PBUF_CUSTOM_REF_DEFINED */ 89 | #endif /* !LWIP_NETIF_TX_SINGLE_PBUF */ 90 | 91 | err_t ip4_frag(struct pbuf *p, struct netif *netif, const ip4_addr_t *dest); 92 | #endif /* IP_FRAG */ 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | 98 | #endif /* LWIP_IPV4 */ 99 | 100 | #endif /* LWIP_HDR_IP4_FRAG_H */ 101 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/prot/icmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * ICMP protocol definitions 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Adam Dunkels 35 | * 36 | */ 37 | #ifndef LWIP_HDR_PROT_ICMP_H 38 | #define LWIP_HDR_PROT_ICMP_H 39 | 40 | #include "lwip/arch.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | #define ICMP_ER 0 /* echo reply */ 47 | #define ICMP_DUR 3 /* destination unreachable */ 48 | #define ICMP_SQ 4 /* source quench */ 49 | #define ICMP_RD 5 /* redirect */ 50 | #define ICMP_ECHO 8 /* echo */ 51 | #define ICMP_TE 11 /* time exceeded */ 52 | #define ICMP_PP 12 /* parameter problem */ 53 | #define ICMP_TS 13 /* timestamp */ 54 | #define ICMP_TSR 14 /* timestamp reply */ 55 | #define ICMP_IRQ 15 /* information request */ 56 | #define ICMP_IR 16 /* information reply */ 57 | #define ICMP_AM 17 /* address mask request */ 58 | #define ICMP_AMR 18 /* address mask reply */ 59 | 60 | #ifdef PACK_STRUCT_USE_INCLUDES 61 | # include "arch/bpstruct.h" 62 | #endif 63 | /** This is the standard ICMP header only that the u32_t data 64 | * is split to two u16_t like ICMP echo needs it. 65 | * This header is also used for other ICMP types that do not 66 | * use the data part. 67 | */ 68 | PACK_STRUCT_BEGIN 69 | struct icmp_echo_hdr { 70 | PACK_STRUCT_FLD_8(u8_t type); 71 | PACK_STRUCT_FLD_8(u8_t code); 72 | PACK_STRUCT_FIELD(u16_t chksum); 73 | PACK_STRUCT_FIELD(u16_t id); 74 | PACK_STRUCT_FIELD(u16_t seqno); 75 | } PACK_STRUCT_STRUCT; 76 | PACK_STRUCT_END 77 | #ifdef PACK_STRUCT_USE_INCLUDES 78 | # include "arch/epstruct.h" 79 | #endif 80 | 81 | /* Compatibility defines, old versions used to combine type and code to an u16_t */ 82 | #define ICMPH_TYPE(hdr) ((hdr)->type) 83 | #define ICMPH_CODE(hdr) ((hdr)->code) 84 | #define ICMPH_TYPE_SET(hdr, t) ((hdr)->type = (t)) 85 | #define ICMPH_CODE_SET(hdr, c) ((hdr)->code = (c)) 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | #endif /* LWIP_HDR_PROT_ICMP_H */ 92 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/apps/snmpv3.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Additional SNMPv3 functionality RFC3414 and RFC3826. 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2016 Elias Oenal. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * Author: Elias Oenal 33 | */ 34 | 35 | #ifndef LWIP_HDR_APPS_SNMP_V3_H 36 | #define LWIP_HDR_APPS_SNMP_V3_H 37 | 38 | #include "lwip/apps/snmp_opts.h" 39 | #include "lwip/err.h" 40 | 41 | #if LWIP_SNMP && LWIP_SNMP_V3 42 | 43 | #define SNMP_V3_AUTH_ALGO_INVAL 0 44 | #define SNMP_V3_AUTH_ALGO_MD5 1 45 | #define SNMP_V3_AUTH_ALGO_SHA 2 46 | 47 | #define SNMP_V3_PRIV_ALGO_INVAL 0 48 | #define SNMP_V3_PRIV_ALGO_DES 1 49 | #define SNMP_V3_PRIV_ALGO_AES 2 50 | 51 | #define SNMP_V3_PRIV_MODE_DECRYPT 0 52 | #define SNMP_V3_PRIV_MODE_ENCRYPT 1 53 | 54 | /* 55 | * The following callback functions must be implemented by the application. 56 | * There is a dummy implementation in snmpv3_dummy.c. 57 | */ 58 | 59 | void snmpv3_get_engine_id(const char **id, u8_t *len); 60 | err_t snmpv3_set_engine_id(const char* id, u8_t len); 61 | 62 | u32_t snmpv3_get_engine_boots(void); 63 | void snmpv3_set_engine_boots(u32_t boots); 64 | 65 | u32_t snmpv3_get_engine_time(void); 66 | void snmpv3_reset_engine_time(void); 67 | 68 | err_t snmpv3_get_user(const char* username, u8_t *auth_algo, u8_t *auth_key, u8_t *priv_algo, u8_t *priv_key); 69 | 70 | /* The following functions are provided by the SNMPv3 agent */ 71 | 72 | void snmpv3_engine_id_changed(void); 73 | 74 | void snmpv3_password_to_key_md5( 75 | const u8_t *password, /* IN */ 76 | u8_t passwordlen, /* IN */ 77 | const u8_t *engineID, /* IN - pointer to snmpEngineID */ 78 | u8_t engineLength, /* IN - length of snmpEngineID */ 79 | u8_t *key); /* OUT - pointer to caller 16-octet buffer */ 80 | 81 | void snmpv3_password_to_key_sha( 82 | const u8_t *password, /* IN */ 83 | u8_t passwordlen, /* IN */ 84 | const u8_t *engineID, /* IN - pointer to snmpEngineID */ 85 | u8_t engineLength, /* IN - length of snmpEngineID */ 86 | u8_t *key); /* OUT - pointer to caller 20-octet buffer */ 87 | 88 | #endif 89 | 90 | #endif /* LWIP_HDR_APPS_SNMP_V3_H */ 91 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/apps/tftp_server.h: -------------------------------------------------------------------------------- 1 | /****************************************************************//** 2 | * 3 | * @file tftp_server.h 4 | * 5 | * @author Logan Gunthorpe 6 | * 7 | * @brief Trivial File Transfer Protocol (RFC 1350) 8 | * 9 | * Copyright (c) Deltatee Enterprises Ltd. 2013 10 | * All rights reserved. 11 | * 12 | ********************************************************************/ 13 | 14 | /* 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification,are permitted provided that the following conditions are met: 17 | * 18 | * 1. Redistributions of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright notice, 21 | * this list of conditions and the following disclaimer in the documentation 22 | * and/or other materials provided with the distribution. 23 | * 3. The name of the author may not be used to endorse or promote products 24 | * derived from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 27 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 28 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 29 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | * Author: Logan Gunthorpe 38 | * 39 | */ 40 | 41 | #ifndef LWIP_HDR_APPS_TFTP_SERVER_H 42 | #define LWIP_HDR_APPS_TFTP_SERVER_H 43 | 44 | #include "lwip/apps/tftp_opts.h" 45 | #include "lwip/err.h" 46 | #include "lwip/pbuf.h" 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | /** @ingroup tftp 53 | * TFTP context containing callback functions for TFTP transfers 54 | */ 55 | struct tftp_context { 56 | /** 57 | * Open file for read/write. 58 | * @param fname Filename 59 | * @param mode Mode string from TFTP RFC 1350 (netascii, octet, mail) 60 | * @param write Flag indicating read (0) or write (!= 0) access 61 | * @returns File handle supplied to other functions 62 | */ 63 | void* (*open)(const char* fname, const char* mode, u8_t write); 64 | /** 65 | * Close file handle 66 | * @param handle File handle returned by open() 67 | */ 68 | void (*close)(void* handle); 69 | /** 70 | * Read from file 71 | * @param handle File handle returned by open() 72 | * @param buf Target buffer to copy read data to 73 | * @param bytes Number of bytes to copy to buf 74 | * @returns >= 0: Success; < 0: Error 75 | */ 76 | int (*read)(void* handle, void* buf, int bytes); 77 | /** 78 | * Write to file 79 | * @param handle File handle returned by open() 80 | * @param pbuf PBUF adjusted such that payload pointer points 81 | * to the beginning of write data. In other words, 82 | * TFTP headers are stripped off. 83 | * @returns >= 0: Success; < 0: Error 84 | */ 85 | int (*write)(void* handle, struct pbuf* p); 86 | }; 87 | 88 | err_t tftp_init(const struct tftp_context* ctx); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif /* LWIP_HDR_APPS_TFTP_SERVER_H */ 95 | -------------------------------------------------------------------------------- /Inc/ethernetif.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : ethernetif.h 4 | * Description : This file provides initialization code for LWIP 5 | * middleWare. 6 | ****************************************************************************** 7 | * This notice applies to any and all portions of this file 8 | * that are not between comment pairs USER CODE BEGIN and 9 | * USER CODE END. Other portions of this file, whether 10 | * inserted by the user or by software development tools 11 | * are owned by their respective copyright owners. 12 | * 13 | * Copyright (c) 2017 STMicroelectronics International N.V. 14 | * All rights reserved. 15 | * 16 | * Redistribution and use in source and binary forms, with or without 17 | * modification, are permitted, provided that the following conditions are met: 18 | * 19 | * 1. Redistribution of source code must retain the above copyright notice, 20 | * this list of conditions and the following disclaimer. 21 | * 2. Redistributions in binary form must reproduce the above copyright notice, 22 | * this list of conditions and the following disclaimer in the documentation 23 | * and/or other materials provided with the distribution. 24 | * 3. Neither the name of STMicroelectronics nor the names of other 25 | * contributors to this software may be used to endorse or promote products 26 | * derived from this software without specific written permission. 27 | * 4. This software, including modifications and/or derivative works of this 28 | * software, must execute solely and exclusively on microcontroller or 29 | * microprocessor devices manufactured by or for STMicroelectronics. 30 | * 5. Redistribution and use of this software other than as permitted under 31 | * this license is void and will automatically terminate your rights under 32 | * this license. 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 35 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 37 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 38 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 39 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 40 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 41 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 42 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 43 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 44 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 45 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 46 | * 47 | ****************************************************************************** 48 | */ 49 | 50 | 51 | #ifndef __ETHERNETIF_H__ 52 | #define __ETHERNETIF_H__ 53 | 54 | #include "lwip/err.h" 55 | #include "lwip/netif.h" 56 | 57 | /* Within 'USER CODE' section, code will be kept by default at each generation */ 58 | /* USER CODE BEGIN 0 */ 59 | 60 | /* USER CODE END 0 */ 61 | 62 | /* Exported functions ------------------------------------------------------- */ 63 | err_t ethernetif_init(struct netif *netif); 64 | 65 | void ethernetif_input(struct netif *netif); 66 | void ethernetif_update_config(struct netif *netif); 67 | void ethernetif_notify_conn_changed(struct netif *netif); 68 | 69 | /* USER CODE BEGIN 1 */ 70 | 71 | /* USER CODE END 1 */ 72 | #endif 73 | 74 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 75 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/autoip.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * AutoIP Automatic LinkLocal IP Configuration 5 | */ 6 | 7 | /* 8 | * 9 | * Copyright (c) 2007 Dominik Spies 10 | * All rights reserved. 11 | * 12 | * Redistribution and use in source and binary forms, with or without modification, 13 | * are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 3. The name of the author may not be used to endorse or promote products 21 | * derived from this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 24 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 25 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 26 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 28 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 29 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 30 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 31 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 32 | * OF SUCH DAMAGE. 33 | * 34 | * Author: Dominik Spies 35 | * 36 | * This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform 37 | * with RFC 3927. 38 | * 39 | */ 40 | 41 | #ifndef LWIP_HDR_AUTOIP_H 42 | #define LWIP_HDR_AUTOIP_H 43 | 44 | #include "lwip/opt.h" 45 | 46 | #if LWIP_IPV4 && LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */ 47 | 48 | #include "lwip/netif.h" 49 | /* #include "lwip/udp.h" */ 50 | #include "lwip/etharp.h" 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | /** AutoIP Timing */ 57 | #define AUTOIP_TMR_INTERVAL 100 58 | #define AUTOIP_TICKS_PER_SECOND (1000 / AUTOIP_TMR_INTERVAL) 59 | 60 | /** AutoIP state information per netif */ 61 | struct autoip 62 | { 63 | /** the currently selected, probed, announced or used LL IP-Address */ 64 | ip4_addr_t llipaddr; 65 | /** current AutoIP state machine state */ 66 | u8_t state; 67 | /** sent number of probes or announces, dependent on state */ 68 | u8_t sent_num; 69 | /** ticks to wait, tick is AUTOIP_TMR_INTERVAL long */ 70 | u16_t ttw; 71 | /** ticks until a conflict can be solved by defending */ 72 | u8_t lastconflict; 73 | /** total number of probed/used Link Local IP-Addresses */ 74 | u8_t tried_llipaddr; 75 | }; 76 | 77 | 78 | void autoip_set_struct(struct netif *netif, struct autoip *autoip); 79 | /** Remove a struct autoip previously set to the netif using autoip_set_struct() */ 80 | #define autoip_remove_struct(netif) do { (netif)->autoip = NULL; } while (0) 81 | err_t autoip_start(struct netif *netif); 82 | err_t autoip_stop(struct netif *netif); 83 | void autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr); 84 | void autoip_tmr(void); 85 | void autoip_network_changed(struct netif *netif); 86 | u8_t autoip_supplied_address(const struct netif *netif); 87 | 88 | /* for lwIP internal use by ip4.c */ 89 | u8_t autoip_accept_packet(struct netif *netif, const ip4_addr_t *addr); 90 | 91 | #ifdef __cplusplus 92 | } 93 | #endif 94 | 95 | #endif /* LWIP_IPV4 && LWIP_AUTOIP */ 96 | 97 | #endif /* LWIP_HDR_AUTOIP_H */ 98 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/ip6.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * IPv6 layer. 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2010 Inico Technologies Ltd. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Ivan Delamer 36 | * 37 | * 38 | * Please coordinate changes and requests with Ivan Delamer 39 | * 40 | */ 41 | #ifndef LWIP_HDR_IP6_H 42 | #define LWIP_HDR_IP6_H 43 | 44 | #include "lwip/opt.h" 45 | 46 | #if LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ 47 | 48 | #include "lwip/ip6_addr.h" 49 | #include "lwip/prot/ip6.h" 50 | #include "lwip/def.h" 51 | #include "lwip/pbuf.h" 52 | #include "lwip/netif.h" 53 | 54 | #include "lwip/err.h" 55 | 56 | #ifdef __cplusplus 57 | extern "C" { 58 | #endif 59 | 60 | struct netif *ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest); 61 | const ip_addr_t *ip6_select_source_address(struct netif *netif, const ip6_addr_t * dest); 62 | err_t ip6_input(struct pbuf *p, struct netif *inp); 63 | err_t ip6_output(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, 64 | u8_t hl, u8_t tc, u8_t nexth); 65 | err_t ip6_output_if(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, 66 | u8_t hl, u8_t tc, u8_t nexth, struct netif *netif); 67 | err_t ip6_output_if_src(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, 68 | u8_t hl, u8_t tc, u8_t nexth, struct netif *netif); 69 | #if LWIP_NETIF_HWADDRHINT 70 | err_t ip6_output_hinted(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, 71 | u8_t hl, u8_t tc, u8_t nexth, u8_t *addr_hint); 72 | #endif /* LWIP_NETIF_HWADDRHINT */ 73 | #if LWIP_IPV6_MLD 74 | err_t ip6_options_add_hbh_ra(struct pbuf * p, u8_t nexth, u8_t value); 75 | #endif /* LWIP_IPV6_MLD */ 76 | 77 | #define ip6_netif_get_local_ip(netif, dest) (((netif) != NULL) ? \ 78 | ip6_select_source_address(netif, dest) : NULL) 79 | 80 | #if IP6_DEBUG 81 | void ip6_debug_print(struct pbuf *p); 82 | #else 83 | #define ip6_debug_print(p) 84 | #endif /* IP6_DEBUG */ 85 | 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | #endif /* LWIP_IPV6 */ 92 | 93 | #endif /* LWIP_HDR_IP6_H */ 94 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/modbus/functions/mbfuncother.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. 3 | * Copyright (c) 2006 Christian Walter 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * File: $Id: mbfuncother.c,v 1.8 2006/12/07 22:10:34 wolti Exp $ 29 | */ 30 | 31 | /* ----------------------- System includes ----------------------------------*/ 32 | #include "stdlib.h" 33 | #include "string.h" 34 | 35 | /* ----------------------- Platform includes --------------------------------*/ 36 | #include "port.h" 37 | 38 | /* ----------------------- Modbus includes ----------------------------------*/ 39 | #include "mb.h" 40 | #include "mbframe.h" 41 | #include "mbproto.h" 42 | #include "mbconfig.h" 43 | 44 | #if MB_FUNC_OTHER_REP_SLAVEID_ENABLED > 0 45 | 46 | /* ----------------------- Static variables ---------------------------------*/ 47 | static UCHAR ucMBSlaveID[MB_FUNC_OTHER_REP_SLAVEID_BUF]; 48 | static USHORT usMBSlaveIDLen; 49 | 50 | /* ----------------------- Start implementation -----------------------------*/ 51 | 52 | eMBErrorCode 53 | eMBSetSlaveID( UCHAR ucSlaveID, BOOL xIsRunning, 54 | UCHAR const *pucAdditional, USHORT usAdditionalLen ) 55 | { 56 | eMBErrorCode eStatus = MB_ENOERR; 57 | 58 | /* the first byte and second byte in the buffer is reserved for 59 | * the parameter ucSlaveID and the running flag. The rest of 60 | * the buffer is available for additional data. */ 61 | if( usAdditionalLen + 2 < MB_FUNC_OTHER_REP_SLAVEID_BUF ) 62 | { 63 | usMBSlaveIDLen = 0; 64 | ucMBSlaveID[usMBSlaveIDLen++] = ucSlaveID; 65 | ucMBSlaveID[usMBSlaveIDLen++] = ( UCHAR )( xIsRunning ? 0xFF : 0x00 ); 66 | if( usAdditionalLen > 0 ) 67 | { 68 | memcpy( &ucMBSlaveID[usMBSlaveIDLen], pucAdditional, 69 | ( size_t )usAdditionalLen ); 70 | usMBSlaveIDLen += usAdditionalLen; 71 | } 72 | } 73 | else 74 | { 75 | eStatus = MB_ENORES; 76 | } 77 | return eStatus; 78 | } 79 | 80 | eMBException 81 | eMBFuncReportSlaveID( UCHAR * pucFrame, USHORT * usLen ) 82 | { 83 | memcpy( &pucFrame[MB_PDU_DATA_OFF], &ucMBSlaveID[0], ( size_t )usMBSlaveIDLen ); 84 | *usLen = ( USHORT )( MB_PDU_DATA_OFF + usMBSlaveIDLen ); 85 | return MB_EX_NONE; 86 | } 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/modbus/include/mbproto.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. 3 | * Copyright (c) 2006 Christian Walter 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * File: $Id: mbproto.h,v 1.14 2006/12/07 22:10:34 wolti Exp $ 29 | */ 30 | 31 | #ifndef _MB_PROTO_H 32 | #define _MB_PROTO_H 33 | 34 | #ifdef __cplusplus 35 | PR_BEGIN_EXTERN_C 36 | #endif 37 | /* ----------------------- Defines ------------------------------------------*/ 38 | #define MB_ADDRESS_BROADCAST ( 0 ) /*! Modbus broadcast address. */ 39 | #define MB_ADDRESS_MIN ( 1 ) /*! Smallest possible slave address. */ 40 | #define MB_ADDRESS_MAX ( 247 ) /*! Biggest possible slave address. */ 41 | #define MB_FUNC_NONE ( 0 ) 42 | #define MB_FUNC_READ_COILS ( 1 ) 43 | #define MB_FUNC_READ_DISCRETE_INPUTS ( 2 ) 44 | #define MB_FUNC_WRITE_SINGLE_COIL ( 5 ) 45 | #define MB_FUNC_WRITE_MULTIPLE_COILS ( 15 ) 46 | #define MB_FUNC_READ_HOLDING_REGISTER ( 3 ) 47 | #define MB_FUNC_READ_INPUT_REGISTER ( 4 ) 48 | #define MB_FUNC_WRITE_REGISTER ( 6 ) 49 | #define MB_FUNC_WRITE_MULTIPLE_REGISTERS ( 16 ) 50 | #define MB_FUNC_READWRITE_MULTIPLE_REGISTERS ( 23 ) 51 | #define MB_FUNC_DIAG_READ_EXCEPTION ( 7 ) 52 | #define MB_FUNC_DIAG_DIAGNOSTIC ( 8 ) 53 | #define MB_FUNC_DIAG_GET_COM_EVENT_CNT ( 11 ) 54 | #define MB_FUNC_DIAG_GET_COM_EVENT_LOG ( 12 ) 55 | #define MB_FUNC_OTHER_REPORT_SLAVEID ( 17 ) 56 | #define MB_FUNC_ERROR ( 128 ) 57 | /* ----------------------- Type definitions ---------------------------------*/ 58 | typedef enum 59 | { 60 | MB_EX_NONE = 0x00, 61 | MB_EX_ILLEGAL_FUNCTION = 0x01, 62 | MB_EX_ILLEGAL_DATA_ADDRESS = 0x02, 63 | MB_EX_ILLEGAL_DATA_VALUE = 0x03, 64 | MB_EX_SLAVE_DEVICE_FAILURE = 0x04, 65 | MB_EX_ACKNOWLEDGE = 0x05, 66 | MB_EX_SLAVE_BUSY = 0x06, 67 | MB_EX_MEMORY_PARITY_ERROR = 0x08, 68 | MB_EX_GATEWAY_PATH_FAILED = 0x0A, 69 | MB_EX_GATEWAY_TGT_FAILED = 0x0B 70 | } eMBException; 71 | 72 | typedef eMBException( *pxMBFunctionHandler ) ( UCHAR * pucFrame, USHORT * pusLength ); 73 | 74 | typedef struct 75 | { 76 | UCHAR ucFunctionCode; 77 | pxMBFunctionHandler pxHandler; 78 | } xMBFunctionHandler; 79 | 80 | #ifdef __cplusplus 81 | PR_END_EXTERN_C 82 | #endif 83 | #endif 84 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/prot/tcp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * TCP protocol definitions 4 | */ 5 | 6 | /* 7 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without modification, 11 | * are permitted provided that the following conditions are met: 12 | * 13 | * 1. Redistributions of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. The name of the author may not be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 22 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 24 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 26 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 30 | * OF SUCH DAMAGE. 31 | * 32 | * This file is part of the lwIP TCP/IP stack. 33 | * 34 | * Author: Adam Dunkels 35 | * 36 | */ 37 | #ifndef LWIP_HDR_PROT_TCP_H 38 | #define LWIP_HDR_PROT_TCP_H 39 | 40 | #include "lwip/arch.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /* Length of the TCP header, excluding options. */ 47 | #define TCP_HLEN 20 48 | 49 | /* Fields are (of course) in network byte order. 50 | * Some fields are converted to host byte order in tcp_input(). 51 | */ 52 | #ifdef PACK_STRUCT_USE_INCLUDES 53 | # include "arch/bpstruct.h" 54 | #endif 55 | PACK_STRUCT_BEGIN 56 | struct tcp_hdr { 57 | PACK_STRUCT_FIELD(u16_t src); 58 | PACK_STRUCT_FIELD(u16_t dest); 59 | PACK_STRUCT_FIELD(u32_t seqno); 60 | PACK_STRUCT_FIELD(u32_t ackno); 61 | PACK_STRUCT_FIELD(u16_t _hdrlen_rsvd_flags); 62 | PACK_STRUCT_FIELD(u16_t wnd); 63 | PACK_STRUCT_FIELD(u16_t chksum); 64 | PACK_STRUCT_FIELD(u16_t urgp); 65 | } PACK_STRUCT_STRUCT; 66 | PACK_STRUCT_END 67 | #ifdef PACK_STRUCT_USE_INCLUDES 68 | # include "arch/epstruct.h" 69 | #endif 70 | 71 | /* TCP header flags bits */ 72 | #define TCP_FIN 0x01U 73 | #define TCP_SYN 0x02U 74 | #define TCP_RST 0x04U 75 | #define TCP_PSH 0x08U 76 | #define TCP_ACK 0x10U 77 | #define TCP_URG 0x20U 78 | #define TCP_ECE 0x40U 79 | #define TCP_CWR 0x80U 80 | /* Valid TCP header flags */ 81 | #define TCP_FLAGS 0x3fU 82 | 83 | #define TCPH_HDRLEN(phdr) ((u16_t)(lwip_ntohs((phdr)->_hdrlen_rsvd_flags) >> 12)) 84 | #define TCPH_FLAGS(phdr) ((u16_t)(lwip_ntohs((phdr)->_hdrlen_rsvd_flags) & TCP_FLAGS)) 85 | 86 | #define TCPH_HDRLEN_SET(phdr, len) (phdr)->_hdrlen_rsvd_flags = lwip_htons(((len) << 12) | TCPH_FLAGS(phdr)) 87 | #define TCPH_FLAGS_SET(phdr, flags) (phdr)->_hdrlen_rsvd_flags = (((phdr)->_hdrlen_rsvd_flags & PP_HTONS(~TCP_FLAGS)) | lwip_htons(flags)) 88 | #define TCPH_HDRLEN_FLAGS_SET(phdr, len, flags) (phdr)->_hdrlen_rsvd_flags = lwip_htons(((len) << 12) | (flags)) 89 | 90 | #define TCPH_SET_FLAG(phdr, flags ) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags | lwip_htons(flags)) 91 | #define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags & ~lwip_htons(flags)) 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif /* LWIP_HDR_PROT_TCP_H */ 98 | -------------------------------------------------------------------------------- /Inc/main.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : main.h 4 | * Description : This file contains the common defines of the application 5 | ****************************************************************************** 6 | * This notice applies to any and all portions of this file 7 | * that are not between comment pairs USER CODE BEGIN and 8 | * USER CODE END. Other portions of this file, whether 9 | * inserted by the user or by software development tools 10 | * are owned by their respective copyright owners. 11 | * 12 | * Copyright (c) 2017 STMicroelectronics International N.V. 13 | * All rights reserved. 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted, provided that the following conditions are met: 17 | * 18 | * 1. Redistribution of source code must retain the above copyright notice, 19 | * this list of conditions and the following disclaimer. 20 | * 2. Redistributions in binary form must reproduce the above copyright notice, 21 | * this list of conditions and the following disclaimer in the documentation 22 | * and/or other materials provided with the distribution. 23 | * 3. Neither the name of STMicroelectronics nor the names of other 24 | * contributors to this software may be used to endorse or promote products 25 | * derived from this software without specific written permission. 26 | * 4. This software, including modifications and/or derivative works of this 27 | * software, must execute solely and exclusively on microcontroller or 28 | * microprocessor devices manufactured by or for STMicroelectronics. 29 | * 5. Redistribution and use of this software other than as permitted under 30 | * this license is void and will automatically terminate your rights under 31 | * this license. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 34 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 35 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 36 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 37 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 38 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 39 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 41 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 42 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 43 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 44 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * 46 | ****************************************************************************** 47 | */ 48 | /* Define to prevent recursive inclusion -------------------------------------*/ 49 | #ifndef __MAIN_H 50 | #define __MAIN_H 51 | /* Includes ------------------------------------------------------------------*/ 52 | 53 | /* USER CODE BEGIN Includes */ 54 | 55 | /* USER CODE END Includes */ 56 | 57 | /* Private define ------------------------------------------------------------*/ 58 | 59 | #define LED1_Pin GPIO_PIN_3 60 | #define LED1_GPIO_Port GPIOE 61 | #define LED2_Pin GPIO_PIN_4 62 | #define LED2_GPIO_Port GPIOE 63 | #define LED3_Pin GPIO_PIN_5 64 | #define LED3_GPIO_Port GPIOE 65 | #define LED4_Pin GPIO_PIN_6 66 | #define LED4_GPIO_Port GPIOE 67 | 68 | /* USER CODE BEGIN Private defines */ 69 | 70 | /* USER CODE END Private defines */ 71 | 72 | void _Error_Handler(char *, int); 73 | 74 | #define Error_Handler() _Error_Handler(__FILE__, __LINE__) 75 | 76 | /** 77 | * @} 78 | */ 79 | 80 | /** 81 | * @} 82 | */ 83 | 84 | #endif /* __MAIN_H */ 85 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 86 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/err.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * lwIP Error codes 4 | */ 5 | /* 6 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 7 | * All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 12 | * 1. Redistributions of source code must retain the above copyright notice, 13 | * this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright notice, 15 | * this list of conditions and the following disclaimer in the documentation 16 | * and/or other materials provided with the distribution. 17 | * 3. The name of the author may not be used to endorse or promote products 18 | * derived from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 21 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 23 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 28 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 29 | * OF SUCH DAMAGE. 30 | * 31 | * This file is part of the lwIP TCP/IP stack. 32 | * 33 | * Author: Adam Dunkels 34 | * 35 | */ 36 | #ifndef LWIP_HDR_ERR_H 37 | #define LWIP_HDR_ERR_H 38 | 39 | #include "lwip/opt.h" 40 | #include "lwip/arch.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /** 47 | * @defgroup infrastructure_errors Error codes 48 | * @ingroup infrastructure 49 | * @{ 50 | */ 51 | 52 | /** Define LWIP_ERR_T in cc.h if you want to use 53 | * a different type for your platform (must be signed). */ 54 | #ifdef LWIP_ERR_T 55 | typedef LWIP_ERR_T err_t; 56 | #else /* LWIP_ERR_T */ 57 | typedef s8_t err_t; 58 | #endif /* LWIP_ERR_T*/ 59 | 60 | /** Definitions for error constants. */ 61 | typedef enum { 62 | /** No error, everything OK. */ 63 | ERR_OK = 0, 64 | /** Out of memory error. */ 65 | ERR_MEM = -1, 66 | /** Buffer error. */ 67 | ERR_BUF = -2, 68 | /** Timeout. */ 69 | ERR_TIMEOUT = -3, 70 | /** Routing problem. */ 71 | ERR_RTE = -4, 72 | /** Operation in progress */ 73 | ERR_INPROGRESS = -5, 74 | /** Illegal value. */ 75 | ERR_VAL = -6, 76 | /** Operation would block. */ 77 | ERR_WOULDBLOCK = -7, 78 | /** Address in use. */ 79 | ERR_USE = -8, 80 | /** Already connecting. */ 81 | ERR_ALREADY = -9, 82 | /** Conn already established.*/ 83 | ERR_ISCONN = -10, 84 | /** Not connected. */ 85 | ERR_CONN = -11, 86 | /** Low-level netif error */ 87 | ERR_IF = -12, 88 | 89 | /** Connection aborted. */ 90 | ERR_ABRT = -13, 91 | /** Connection reset. */ 92 | ERR_RST = -14, 93 | /** Connection closed. */ 94 | ERR_CLSD = -15, 95 | /** Illegal argument. */ 96 | ERR_ARG = -16 97 | } err_enum_t; 98 | 99 | #define ERR_IS_FATAL(e) ((e) <= ERR_ABRT) 100 | 101 | /** 102 | * @} 103 | */ 104 | 105 | #ifdef LWIP_DEBUG 106 | extern const char *lwip_strerr(err_t err); 107 | #else 108 | #define lwip_strerr(x) "" 109 | #endif /* LWIP_DEBUG */ 110 | 111 | #if !NO_SYS 112 | int err_to_errno(err_t err); 113 | #endif /* !NO_SYS */ 114 | 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | 119 | #endif /* LWIP_HDR_ERR_H */ 120 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/modbus/include/mbframe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU. 3 | * Copyright (c) 2006 Christian Walter 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote products 15 | * derived from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | * 28 | * File: $Id: mbframe.h,v 1.9 2006/12/07 22:10:34 wolti Exp $ 29 | */ 30 | 31 | #ifndef _MB_FRAME_H 32 | #define _MB_FRAME_H 33 | 34 | #ifdef __cplusplus 35 | PR_BEGIN_EXTERN_C 36 | #endif 37 | 38 | /*! 39 | * Constants which defines the format of a modbus frame. The example is 40 | * shown for a Modbus RTU/ASCII frame. Note that the Modbus PDU is not 41 | * dependent on the underlying transport. 42 | * 43 | * 44 | * <------------------------ MODBUS SERIAL LINE PDU (1) -------------------> 45 | * <----------- MODBUS PDU (1') ----------------> 46 | * +-----------+---------------+----------------------------+-------------+ 47 | * | Address | Function Code | Data | CRC/LRC | 48 | * +-----------+---------------+----------------------------+-------------+ 49 | * | | | | 50 | * (2) (3/2') (3') (4) 51 | * 52 | * (1) ... MB_SER_PDU_SIZE_MAX = 256 53 | * (2) ... MB_SER_PDU_ADDR_OFF = 0 54 | * (3) ... MB_SER_PDU_PDU_OFF = 1 55 | * (4) ... MB_SER_PDU_SIZE_CRC = 2 56 | * 57 | * (1') ... MB_PDU_SIZE_MAX = 253 58 | * (2') ... MB_PDU_FUNC_OFF = 0 59 | * (3') ... MB_PDU_DATA_OFF = 1 60 | * 61 | */ 62 | 63 | /* ----------------------- Defines ------------------------------------------*/ 64 | #define MB_PDU_SIZE_MAX 253 /*!< Maximum size of a PDU. */ 65 | #define MB_PDU_SIZE_MIN 1 /*!< Function Code */ 66 | #define MB_PDU_FUNC_OFF 0 /*!< Offset of function code in PDU. */ 67 | #define MB_PDU_DATA_OFF 1 /*!< Offset for response data in PDU. */ 68 | 69 | /* ----------------------- Prototypes 0-------------------------------------*/ 70 | typedef void ( *pvMBFrameStart ) ( void ); 71 | 72 | typedef void ( *pvMBFrameStop ) ( void ); 73 | 74 | typedef eMBErrorCode( *peMBFrameReceive ) ( UCHAR * pucRcvAddress, 75 | UCHAR ** pucFrame, 76 | USHORT * pusLength ); 77 | 78 | typedef eMBErrorCode( *peMBFrameSend ) ( UCHAR slaveAddress, 79 | const UCHAR * pucFrame, 80 | USHORT usLength ); 81 | 82 | typedef void( *pvMBFrameClose ) ( void ); 83 | 84 | #ifdef __cplusplus 85 | PR_END_EXTERN_C 86 | #endif 87 | #endif 88 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/mld6.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * 4 | * Multicast listener discovery for IPv6. Aims to be compliant with RFC 2710. 5 | * No support for MLDv2. 6 | */ 7 | 8 | /* 9 | * Copyright (c) 2010 Inico Technologies Ltd. 10 | * All rights reserved. 11 | * 12 | * Redistribution and use in source and binary forms, with or without modification, 13 | * are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 3. The name of the author may not be used to endorse or promote products 21 | * derived from this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 24 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 25 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 26 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 28 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 29 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 30 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 31 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 32 | * OF SUCH DAMAGE. 33 | * 34 | * This file is part of the lwIP TCP/IP stack. 35 | * 36 | * Author: Ivan Delamer 37 | * 38 | * 39 | * Please coordinate changes and requests with Ivan Delamer 40 | * 41 | */ 42 | 43 | #ifndef LWIP_HDR_MLD6_H 44 | #define LWIP_HDR_MLD6_H 45 | 46 | #include "lwip/opt.h" 47 | 48 | #if LWIP_IPV6_MLD && LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */ 49 | 50 | #include "lwip/pbuf.h" 51 | #include "lwip/netif.h" 52 | 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | /** MLD group */ 58 | struct mld_group { 59 | /** next link */ 60 | struct mld_group *next; 61 | /** multicast address */ 62 | ip6_addr_t group_address; 63 | /** signifies we were the last person to report */ 64 | u8_t last_reporter_flag; 65 | /** current state of the group */ 66 | u8_t group_state; 67 | /** timer for reporting */ 68 | u16_t timer; 69 | /** counter of simultaneous uses */ 70 | u8_t use; 71 | }; 72 | 73 | #define MLD6_TMR_INTERVAL 100 /* Milliseconds */ 74 | 75 | err_t mld6_stop(struct netif *netif); 76 | void mld6_report_groups(struct netif *netif); 77 | void mld6_tmr(void); 78 | struct mld_group *mld6_lookfor_group(struct netif *ifp, const ip6_addr_t *addr); 79 | void mld6_input(struct pbuf *p, struct netif *inp); 80 | err_t mld6_joingroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr); 81 | err_t mld6_joingroup_netif(struct netif *netif, const ip6_addr_t *groupaddr); 82 | err_t mld6_leavegroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr); 83 | err_t mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr); 84 | 85 | /** @ingroup mld6 86 | * Get list head of MLD6 groups for netif. 87 | * Note: The allnodes group IP is NOT in the list, since it must always 88 | * be received for correct IPv6 operation. 89 | * @see @ref netif_set_mld_mac_filter() 90 | */ 91 | #define netif_mld6_data(netif) ((struct mld_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_MLD6)) 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif /* LWIP_IPV6_MLD && LWIP_IPV6 */ 98 | 99 | #endif /* LWIP_HDR_MLD6_H */ 100 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/LwIP/src/include/lwip/apps/fs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef LWIP_HDR_APPS_FS_H 33 | #define LWIP_HDR_APPS_FS_H 34 | 35 | #include "httpd_opts.h" 36 | #include "lwip/err.h" 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | #define FS_READ_EOF -1 43 | #define FS_READ_DELAYED -2 44 | 45 | #if HTTPD_PRECALCULATED_CHECKSUM 46 | struct fsdata_chksum { 47 | u32_t offset; 48 | u16_t chksum; 49 | u16_t len; 50 | }; 51 | #endif /* HTTPD_PRECALCULATED_CHECKSUM */ 52 | 53 | #define FS_FILE_FLAGS_HEADER_INCLUDED 0x01 54 | #define FS_FILE_FLAGS_HEADER_PERSISTENT 0x02 55 | 56 | struct fs_file { 57 | const char *data; 58 | int len; 59 | int index; 60 | void *pextension; 61 | #if HTTPD_PRECALCULATED_CHECKSUM 62 | const struct fsdata_chksum *chksum; 63 | u16_t chksum_count; 64 | #endif /* HTTPD_PRECALCULATED_CHECKSUM */ 65 | u8_t flags; 66 | #if LWIP_HTTPD_CUSTOM_FILES 67 | u8_t is_custom_file; 68 | #endif /* LWIP_HTTPD_CUSTOM_FILES */ 69 | #if LWIP_HTTPD_FILE_STATE 70 | void *state; 71 | #endif /* LWIP_HTTPD_FILE_STATE */ 72 | }; 73 | 74 | #if LWIP_HTTPD_FS_ASYNC_READ 75 | typedef void (*fs_wait_cb)(void *arg); 76 | #endif /* LWIP_HTTPD_FS_ASYNC_READ */ 77 | 78 | err_t fs_open(struct fs_file *file, const char *name); 79 | void fs_close(struct fs_file *file); 80 | #if LWIP_HTTPD_DYNAMIC_FILE_READ 81 | #if LWIP_HTTPD_FS_ASYNC_READ 82 | int fs_read_async(struct fs_file *file, char *buffer, int count, fs_wait_cb callback_fn, void *callback_arg); 83 | #else /* LWIP_HTTPD_FS_ASYNC_READ */ 84 | int fs_read(struct fs_file *file, char *buffer, int count); 85 | #endif /* LWIP_HTTPD_FS_ASYNC_READ */ 86 | #endif /* LWIP_HTTPD_DYNAMIC_FILE_READ */ 87 | #if LWIP_HTTPD_FS_ASYNC_READ 88 | int fs_is_file_ready(struct fs_file *file, fs_wait_cb callback_fn, void *callback_arg); 89 | #endif /* LWIP_HTTPD_FS_ASYNC_READ */ 90 | int fs_bytes_left(struct fs_file *file); 91 | 92 | #if LWIP_HTTPD_FILE_STATE 93 | /** This user-defined function is called when a file is opened. */ 94 | void *fs_state_init(struct fs_file *file, const char *name); 95 | /** This user-defined function is called when a file is closed. */ 96 | void fs_state_free(struct fs_file *file, void *state); 97 | #endif /* #if LWIP_HTTPD_FILE_STATE */ 98 | 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | 103 | #endif /* LWIP_HDR_APPS_FS_H */ 104 | -------------------------------------------------------------------------------- /Src/mbtask.c: -------------------------------------------------------------------------------- 1 | #include "stm32f4xx_hal.h" 2 | #include 3 | 4 | #include "mb.h" 5 | #include "mbport.h" 6 | 7 | #include "lwip.h" 8 | #include "lwip/api.h" 9 | #include "lwip/tcp.h" 10 | 11 | #define REG_INPUT_START 0x01 12 | #define REG_INPUT_NREGS 100 13 | #define REG_HOLDING_START 0x01 14 | #define REG_HOLDING_NREGS 100 15 | 16 | static USHORT usRegInputStart = REG_INPUT_START; 17 | static USHORT usRegInputBuf[REG_INPUT_NREGS]; 18 | static USHORT usRegHoldingStart = REG_HOLDING_START; 19 | static USHORT usRegHoldingBuf[REG_HOLDING_NREGS]; 20 | 21 | static UCHAR Vendor[11] = "Modbus TCP"; 22 | extern struct netif gnetif; 23 | 24 | void User_notification(struct netif *netif); 25 | 26 | void ModbusTask() 27 | { 28 | 29 | for(int i=0; i < 100; i++) 30 | { 31 | usRegInputBuf[i] = i; 32 | } 33 | 34 | for(int i=0; i < 100; i++) 35 | { 36 | usRegHoldingBuf[i] = i+100; 37 | } 38 | 39 | 40 | User_notification(&gnetif); 41 | 42 | if(eMBTCPInit(0) != MB_ENOERR) 43 | return; 44 | 45 | if(eMBSetSlaveID( 1, TRUE, Vendor, sizeof(Vendor)) != MB_ENOERR) 46 | return; 47 | 48 | if(eMBEnable() != MB_ENOERR) 49 | return; 50 | 51 | while(1) 52 | { 53 | eMBPoll(); 54 | MX_LWIP_Process(); 55 | } 56 | } 57 | 58 | void User_notification(struct netif *netif) 59 | { 60 | if (netif_is_up(netif)) 61 | { 62 | /* Turn On LED 1 to indicate ETH and LwIP init success*/ 63 | HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET); 64 | } 65 | else 66 | { 67 | /* Turn On LED 2 to indicate ETH and LwIP init error */ 68 | HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET); 69 | } 70 | } 71 | 72 | eMBErrorCode eMBRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs ) 73 | { 74 | eMBErrorCode eStatus = MB_ENOERR; 75 | int iRegIndex; 76 | 77 | if( ( usAddress >= REG_INPUT_START ) && ( usAddress + usNRegs <= REG_INPUT_START + REG_INPUT_NREGS ) ) 78 | { 79 | iRegIndex = ( int )( usAddress - usRegInputStart ); 80 | while( usNRegs > 0 ) 81 | { 82 | *pucRegBuffer++ = 83 | ( unsigned char )( usRegInputBuf[iRegIndex] >> 8 ); 84 | *pucRegBuffer++ = 85 | ( unsigned char )( usRegInputBuf[iRegIndex] & 0xFF ); 86 | iRegIndex++; 87 | usNRegs--; 88 | } 89 | } 90 | else 91 | { 92 | eStatus = MB_ENOREG; 93 | } 94 | 95 | HAL_GPIO_TogglePin(LED2_GPIO_Port, LED2_Pin); 96 | 97 | return eStatus; 98 | } 99 | 100 | eMBErrorCode eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegisterMode eMode ) 101 | { 102 | eMBErrorCode eStatus = MB_ENOERR; 103 | int iRegIndex; 104 | 105 | if( ( usAddress >= REG_HOLDING_START ) && ( usAddress + usNRegs <= REG_HOLDING_START + REG_HOLDING_NREGS ) ) 106 | { 107 | iRegIndex = ( int )( usAddress - usRegHoldingStart ); 108 | switch ( eMode ) 109 | { 110 | case MB_REG_READ: 111 | while( usNRegs > 0 ) 112 | { 113 | *pucRegBuffer++ = ( unsigned char )( usRegHoldingBuf[iRegIndex] >> 8 ); 114 | *pucRegBuffer++ = ( unsigned char )( usRegHoldingBuf[iRegIndex] & 0xFF ); 115 | iRegIndex++; 116 | usNRegs--; 117 | } 118 | break; 119 | 120 | case MB_REG_WRITE: 121 | while( usNRegs > 0 ) 122 | { 123 | usRegHoldingBuf[iRegIndex] = *pucRegBuffer++ << 8; 124 | usRegHoldingBuf[iRegIndex] |= *pucRegBuffer++; 125 | iRegIndex++; 126 | usNRegs--; 127 | } 128 | } 129 | } 130 | else 131 | { 132 | eStatus = MB_ENOREG; 133 | } 134 | 135 | HAL_GPIO_TogglePin(LED2_GPIO_Port, LED2_Pin); 136 | 137 | return eStatus; 138 | } 139 | 140 | 141 | eMBErrorCode eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNCoils, eMBRegisterMode eMode ) 142 | { 143 | return MB_ENOREG; 144 | } 145 | 146 | eMBErrorCode eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNDiscrete ) 147 | { 148 | return MB_ENOREG; 149 | } --------------------------------------------------------------------------------