├── README.md ├── modbus ├── modbus_client_pdu.c ├── modbus_server_transport.h ├── modbus_client_misc.h ├── modbus_server_security.h └── modbus_client_transport.h ├── drivers ├── mac │ ├── rm57_eth_driver.c │ ├── am335x_eth_driver.c │ ├── tms570_eth_driver.c │ └── omapl138_eth_driver.c ├── wifi │ ├── cc33xx_driver.h │ ├── esp32_wifi_driver.h │ ├── esp8266_driver.h │ ├── wf200_driver.h │ ├── bcm43362_driver.h │ ├── winc1500_driver.h │ └── winc3400_driver.h ├── loopback │ └── loopback_driver.h ├── usb_rndis │ ├── usbd_rndis.h │ └── rndis_debug.h └── pcap │ └── pcap_driver.h ├── lldp ├── lldp_fsm.h ├── lldp_debug.h ├── lldp_procedures.h ├── lldp_tx_fsm.h ├── lldp_ext_pno.h ├── lldp_rx_fsm.h └── lldp_misc.h ├── syslog ├── syslog_client_misc.h └── syslog_client_misc.c ├── core ├── bsd_socket_misc.h ├── tcp_timer.h ├── socket_misc.h └── ethernet_misc.h ├── mibs ├── lldp_mib_impl.h ├── snmp_mpd_mib_impl.h ├── mib2_impl.h ├── mib2_impl_udp.h ├── udp_mib_impl.h ├── mib2_impl_if.h ├── mib2_impl_tcp.h ├── snmp_framework_mib_module.h ├── mib2_impl_ip.h ├── snmp_mpd_mib_module.h ├── mib2_impl_sys.c ├── snmp_framework_mib_impl.h ├── snmp_community_mib_impl.h ├── tcp_mib_impl.h ├── snmp_usm_mib_impl.h ├── udp_mib_module.h ├── snmp_vacm_mib_module.h ├── mib2_impl_sys.h └── snmp_community_mib_module.h ├── coap ├── coap_client_observe.h ├── coap_server_transport.h ├── coap_client_block.h ├── coap_server_misc.h ├── coap_debug.h ├── coap_client_transport.h └── coap_client_misc.h ├── snmp ├── snmp_agent_dispatch.h ├── snmp_agent_pdu.h ├── snmp_agent_object.h ├── snmp_agent_misc.h └── snmp_agent_trap.h ├── http ├── mime.h ├── http_server_auth.h ├── ssi.h ├── http_client_transport.h └── http_client_misc.h ├── llmnr ├── llmnr_common.c └── llmnr_responder.h ├── web_socket ├── web_socket_auth.h ├── web_socket_frame.h └── web_socket_transport.h ├── ipv6 ├── slaac_misc.h ├── ipv6_pmtu.h ├── ndp_router_adv_misc.h ├── ndp_cache.h └── ndp_misc.h ├── smtp ├── smtp_client_auth.h ├── smtp_client_transport.h └── smtp_client_misc.h ├── ftp ├── ftp_server_control.h ├── ftp_server_transport.h ├── ftp_server_data.h ├── ftp_client_transport.h ├── ftp_server_misc.h └── ftp_client_misc.h ├── ipv4 ├── arp_cache.h └── auto_ip_misc.h ├── dns └── dns_debug.h ├── echo └── echo_server_misc.h ├── sntp └── sntp_client_misc.h ├── dhcp ├── dhcp_client_fsm.h └── dhcp_debug.h ├── netbios └── nbns_responder.h ├── dhcpv6 └── dhcpv6_client_fsm.h ├── mqtt └── mqtt_client_transport.h ├── mld └── mld_debug.h ├── ppp ├── ppp_debug.h ├── ppp_misc.h └── ppp_hdlc.h ├── igmp └── igmp_debug.h ├── mqtt_sn └── mqtt_sn_client_transport.h ├── ntp └── ntp_debug.h └── nts └── nts_debug.h /README.md: -------------------------------------------------------------------------------- 1 | # CycloneTCP 2 | Dual IPv4/IPv6 Stack 3 | -------------------------------------------------------------------------------- /modbus/modbus_client_pdu.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oryx-Embedded/CycloneTCP/HEAD/modbus/modbus_client_pdu.c -------------------------------------------------------------------------------- /drivers/mac/rm57_eth_driver.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oryx-Embedded/CycloneTCP/HEAD/drivers/mac/rm57_eth_driver.c -------------------------------------------------------------------------------- /drivers/mac/am335x_eth_driver.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oryx-Embedded/CycloneTCP/HEAD/drivers/mac/am335x_eth_driver.c -------------------------------------------------------------------------------- /drivers/mac/tms570_eth_driver.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oryx-Embedded/CycloneTCP/HEAD/drivers/mac/tms570_eth_driver.c -------------------------------------------------------------------------------- /drivers/mac/omapl138_eth_driver.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oryx-Embedded/CycloneTCP/HEAD/drivers/mac/omapl138_eth_driver.c -------------------------------------------------------------------------------- /lldp/lldp_fsm.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lldp_fsm.h 3 | * @brief LLDP state machine 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _LLDP_FSM_H 32 | #define _LLDP_FSM_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "lldp/lldp.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //LLDP related functions 44 | void lldpInitFsm(LldpAgentContext *context); 45 | void lldpFsm(LldpAgentContext *context); 46 | void lldpFsmError(LldpAgentContext *context); 47 | 48 | //C++ guard 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /syslog/syslog_client_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file syslog_client_misc.h 3 | * @brief Helper functions for Syslog client 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SYSLOG_CLIENT_MISC_H 32 | #define _SYSLOG_CLIENT_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "syslog/syslog_client.h" 37 | #include "date_time.h" 38 | 39 | //C++ guard 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | //Syslog client related functions 45 | size_t syslogClientFormatTimestamp(time_t time, char_t *buffer); 46 | 47 | //C++ guard 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /core/bsd_socket_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file bsd_socket_misc.h 3 | * @brief Helper function for BSD socket API 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _BSD_SOCKET_MISC_H 32 | #define _BSD_SOCKET_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "core/bsd_socket.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //BSD socket related functions 44 | void socketSetErrnoCode(Socket *socket, uint_t errnoCode); 45 | void socketTranslateErrorCode(Socket *socket, error_t errorCode); 46 | 47 | //C++ guard 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /mibs/lldp_mib_impl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lldp_mib_impl.h 3 | * @brief LLDP MIB module implementation 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _LLDP_MIB_IMPL_H 32 | #define _LLDP_MIB_IMPL_H 33 | 34 | //Dependencies 35 | #include "mibs/mib_common.h" 36 | #include "lldp/lldp.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //LLDP MIB related functions 44 | error_t lldpMibInit(void); 45 | 46 | void lldpMibLock(void); 47 | void lldpMibUnlock(void); 48 | 49 | error_t lldpMibSetLldpAgentContext(LldpAgentContext *context); 50 | 51 | //C++ guard 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /mibs/snmp_mpd_mib_impl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file snmp_mpd_mib_impl.h 3 | * @brief SNMP MPD MIB module implementation 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SNMP_MPD_MIB_IMPL_H 32 | #define _SNMP_MPD_MIB_IMPL_H 33 | 34 | //Dependencies 35 | #include "mibs/mib_common.h" 36 | 37 | //C++ guard 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | //SNMP MPD MIB related functions 43 | error_t snmpMpdMibInit(void); 44 | error_t snmpMpdMibLoad(void *context); 45 | void snmpMpdMibUnload(void *context); 46 | void snmpMpdMibLock(void); 47 | void snmpMpdMibUnlock(void); 48 | 49 | //C++ guard 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /core/tcp_timer.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tcp_timer.h 3 | * @brief TCP timer management 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _TCP_TIMER_H 32 | #define _TCP_TIMER_H 33 | 34 | //C++ guard 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | //TCP timer related functions 40 | void tcpTick(void); 41 | 42 | void tcpCheckRetransmitTimer(Socket *socket); 43 | void tcpCheckPersistTimer(Socket *socket); 44 | void tcpCheckKeepAliveTimer(Socket *socket); 45 | void tcpCheckOverrideTimer(Socket *socket); 46 | void tcpCheckFinWait2Timer(Socket *socket); 47 | void tcpCheckTimeWaitTimer(Socket *socket); 48 | 49 | //C++ guard 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /coap/coap_client_observe.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file coap_client_observe.h 3 | * @brief CoAP observe 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _COAP_CLIENT_OBSERVE_H 32 | #define _COAP_CLIENT_OBSERVE_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "coap/coap_client.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //CoAP client related functions 44 | error_t coapClientProcessNotification(CoapClientRequest *request, 45 | const CoapMessage *response); 46 | 47 | bool_t coapClientCheckSequenceNumber(CoapClientRequest *request, 48 | uint32_t v2, systime_t t2); 49 | 50 | //C++ guard 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /mibs/mib2_impl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mib2_impl.h 3 | * @brief MIB-II module implementation 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _MIB2_IMPL_H 32 | #define _MIB2_IMPL_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "mibs/mib2_module.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //MIB-II related functions 44 | error_t mib2Init(void); 45 | 46 | void mib2InitSysGroup(Mib2SysGroup *sysGroup); 47 | void mib2InitIfGroup(Mib2IfGroup *ifGroup); 48 | void mib2InitIpGroup(Mib2IpGroup *ipGroup); 49 | void mib2InitTcpGroup(Mib2TcpGroup *tcpGroup); 50 | void mib2InitSnmpGroup(Mib2SnmpGroup *snmpGroup); 51 | 52 | //C++ guard 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /snmp/snmp_agent_dispatch.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file snmp_agent_dispatch.h 3 | * @brief SNMP message dispatching 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SNMP_AGENT_DISPATCH_H 32 | #define _SNMP_AGENT_DISPATCH_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "snmp/snmp_agent.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //SNMP agent related functions 44 | error_t snmpProcessMessage(SnmpAgentContext *context); 45 | 46 | error_t snmpv1ProcessMessage(SnmpAgentContext *context); 47 | error_t snmpv2cProcessMessage(SnmpAgentContext *context); 48 | error_t snmpv3ProcessMessage(SnmpAgentContext *context); 49 | 50 | //C++ guard 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /http/mime.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mime.h 3 | * @brief MIME (Multipurpose Internet Mail Extensions) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _MIME_H 32 | #define _MIME_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | 37 | //Custom MIME types 38 | #ifndef MIME_CUSTOM_TYPES 39 | #define MIME_CUSTOM_TYPES 40 | #endif 41 | 42 | //C++ guard 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | 48 | /** 49 | * @brief MIME type 50 | **/ 51 | 52 | typedef struct 53 | { 54 | const char_t *extension; 55 | const char_t *type; 56 | } MimeType; 57 | 58 | 59 | //MIME related functions 60 | const char_t *mimeGetType(const char_t *filename); 61 | 62 | //C++ guard 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /llmnr/llmnr_common.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file llmnr_common.c 3 | * @brief Definitions common to LLMNR client and responder 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | //Switch to the appropriate trace level 32 | #define TRACE_LEVEL LLMNR_TRACE_LEVEL 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "llmnr/llmnr_client.h" 37 | #include "llmnr/llmnr_responder.h" 38 | #include "llmnr/llmnr_common.h" 39 | #include "debug.h" 40 | 41 | //Check TCP/IP stack configuration 42 | #if (LLMNR_CLIENT_SUPPORT == ENABLED || LLMNR_RESPONDER_SUPPORT == ENABLED) 43 | 44 | //LLMNR IPv6 multicast group (ff02::1:3) 45 | const Ipv6Addr LLMNR_IPV6_MULTICAST_ADDR = 46 | IPV6_ADDR(0xFF02, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0003); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /mibs/mib2_impl_udp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mib2_impl_udp.h 3 | * @brief MIB-II module implementation (UDP group) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _MIB2_IMPL_UDP_H 32 | #define _MIB2_IMPL_UDP_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "mibs/mib2_module.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //MIB-II related functions 44 | error_t mib2GetUdpEntry(const MibObject *object, const uint8_t *oid, 45 | size_t oidLen, MibVariant *value, size_t *valueLen); 46 | 47 | error_t mib2GetNextUdpEntry(const MibObject *object, const uint8_t *oid, 48 | size_t oidLen, uint8_t *nextOid, size_t *nextOidLen); 49 | 50 | //C++ guard 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /mibs/udp_mib_impl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file udp_mib_impl.h 3 | * @brief UDP MIB module implementation 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _UDP_MIB_IMPL_H 32 | #define _UDP_MIB_IMPL_H 33 | 34 | //Dependencies 35 | #include "mibs/mib_common.h" 36 | 37 | //C++ guard 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | //UDP MIB related functions 43 | error_t udpMibInit(void); 44 | 45 | error_t udpMibGetUdpEndpointEntry(const MibObject *object, const uint8_t *oid, 46 | size_t oidLen, MibVariant *value, size_t *valueLen); 47 | 48 | error_t udpMibGetNextUdpEndpointEntry(const MibObject *object, const uint8_t *oid, 49 | size_t oidLen, uint8_t *nextOid, size_t *nextOidLen); 50 | 51 | //C++ guard 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /web_socket/web_socket_auth.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file web_socket_auth.h 3 | * @brief HTTP authentication for WebSockets 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _WEB_SOCKET_AUTH_H 32 | #define _WEB_SOCKET_AUTH_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "web_socket/web_socket.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //WebSocket related functions 44 | error_t webSocketParseAuthenticateField(WebSocket *webSocket, char_t *value); 45 | 46 | size_t webSocketAddAuthorizationField(WebSocket *webSocket, char_t *output); 47 | 48 | void webSocketConvertArrayToHexString(const uint8_t *input, 49 | size_t inputLen, char_t *output); 50 | 51 | //C++ guard 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /coap/coap_server_transport.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file coap_server_transport.h 3 | * @brief Transport protocol abstraction layer 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _COAP_SERVER_TRANSPORT_H 32 | #define _COAP_SERVER_TRANSPORT_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "coap/coap_server.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //CoAP server related functions 44 | error_t coapServerAcceptSession(CoapServerContext *context, 45 | CoapDtlsSession *session, const IpAddr *remoteIpAddr, uint16_t remotePort); 46 | 47 | error_t coapServerDemultiplexSession(CoapServerContext *context); 48 | 49 | void coapServerDeleteSession(CoapDtlsSession *session); 50 | 51 | //C++ guard 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /snmp/snmp_agent_pdu.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file snmp_agent_pdu.h 3 | * @brief SNMP agent (PDU processing) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SNMP_AGENT_PDU_H 32 | #define _SNMP_AGENT_PDU_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "snmp/snmp_agent.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //SNMP agent related functions 44 | error_t snmpProcessPdu(SnmpAgentContext *context); 45 | 46 | error_t snmpProcessGetRequestPdu(SnmpAgentContext *context); 47 | error_t snmpProcessGetBulkRequestPdu(SnmpAgentContext *context); 48 | error_t snmpProcessSetRequestPdu(SnmpAgentContext *context); 49 | 50 | error_t snmpFormatReportPdu(SnmpAgentContext *context, error_t errorIndication); 51 | 52 | //C++ guard 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /web_socket/web_socket_frame.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file web_socket_frame.h 3 | * @brief WebSocket frame parsing and formatting 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _WEB_SOCKET_FRAME_H 32 | #define _WEB_SOCKET_FRAME_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "web_socket/web_socket.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //WebSocket related functions 44 | error_t webSocketFormatFrameHeader(WebSocket *webSocket, 45 | bool_t fin, WebSocketFrameType type, size_t payloadLen); 46 | 47 | error_t webSocketParseFrameHeader(WebSocket *webSocket, 48 | const WebSocketFrame *frame, WebSocketFrameType *type); 49 | 50 | error_t webSocketFormatCloseFrame(WebSocket *webSocket); 51 | 52 | //C++ guard 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /ipv6/slaac_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file slaac_misc.h 3 | * @brief Helper functions for SLAAC 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SLAAC_MISC_H 32 | #define _SLAAC_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ipv6/slaac.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //SLAAC related functions 44 | void slaacLinkChangeEvent(SlaacContext *context); 45 | 46 | void slaacParseRouterAdv(SlaacContext *context, 47 | NdpRouterAdvMessage *message, size_t length); 48 | 49 | void slaacParsePrefixInfoOption(SlaacContext *context, 50 | NdpPrefixInfoOption *option); 51 | 52 | error_t slaacGenerateLinkLocalAddr(SlaacContext *context); 53 | 54 | void slaacDumpConfig(SlaacContext *context); 55 | 56 | //C++ guard 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /smtp/smtp_client_auth.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file smtp_client_auth.h 3 | * @brief SMTP authentication mechanism 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SMTP_CLIENT_AUTH_H 32 | #define _SMTP_CLIENT_AUTH_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "smtp/smtp_client.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //SMTP client related functions 44 | error_t smtpClientLoginAuth(SmtpClientContext *context, 45 | const char_t *username, const char_t *password); 46 | 47 | error_t smtpClientPlainAuth(SmtpClientContext *context, 48 | const char_t *username, const char_t *password); 49 | 50 | error_t smtpClientCramMd5Auth(SmtpClientContext *context, 51 | const char_t *username, const char_t *password); 52 | 53 | //C++ guard 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /ftp/ftp_server_control.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ftp_server_control.h 3 | * @brief FTP control connection 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _FTP_SERVER_CONTROL_H 32 | #define _FTP_SERVER_CONTROL_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ftp/ftp_server.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //FTP server related functions 44 | void ftpServerRegisterControlChannelEvents(FtpClientConnection *connection, 45 | SocketEventDesc *eventDesc); 46 | 47 | void ftpServerProcessControlChannelEvents(FtpClientConnection *connection, 48 | uint_t eventFlags); 49 | 50 | void ftpServerAcceptControlChannel(FtpServerContext *context); 51 | void ftpServerCloseControlChannel(FtpClientConnection *connection); 52 | 53 | //C++ guard 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /ipv4/arp_cache.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file arp_cache.h 3 | * @brief ARP cache management 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _ARP_CACHE_H 32 | #define _ARP_CACHE_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ipv4/arp.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //ARP related functions 44 | void arpChangeState(ArpCacheEntry *entry, ArpState newState); 45 | 46 | ArpCacheEntry *arpCreateEntry(NetInterface *interface); 47 | ArpCacheEntry *arpFindEntry(NetInterface *interface, Ipv4Addr ipAddr); 48 | 49 | void arpFlushCache(NetInterface *interface); 50 | 51 | void arpSendQueuedPackets(NetInterface *interface, ArpCacheEntry *entry); 52 | void arpFlushQueuedPackets(NetInterface *interface, ArpCacheEntry *entry); 53 | 54 | //C++ guard 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /lldp/lldp_debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lldp_debug.h 3 | * @brief Data logging functions for debugging purpose (LLDP) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _LLDP_DEBUG_H 32 | #define _LLDP_DEBUG_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "lldp/lldp.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | 44 | /** 45 | * @brief Parameter value/name binding 46 | **/ 47 | 48 | typedef struct 49 | { 50 | uint_t value; 51 | const char_t *name; 52 | } LldpParamName; 53 | 54 | 55 | //LLDP agent related functions 56 | void lldpDumpDataUnit(LldpDataUnit *lldpdu); 57 | void lldpDumpTlv(const LldpTlv *tlv); 58 | 59 | const char_t *lldpGetParamName(uint_t value, const LldpParamName *paramList, 60 | size_t paramListLen); 61 | 62 | //C++ guard 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /ipv6/ipv6_pmtu.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ipv6_pmtu.h 3 | * @brief Path MTU Discovery for IPv6 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _IPV6_PMTU_H 32 | #define _IPV6_PMTU_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | 37 | //Path MTU discovery support 38 | #ifndef IPV6_PMTU_SUPPORT 39 | #define IPV6_PMTU_SUPPORT ENABLED 40 | #elif (IPV6_PMTU_SUPPORT != ENABLED && IPV6_PMTU_SUPPORT != DISABLED) 41 | #error IPV6_PMTU_SUPPORT parameter is not valid 42 | #endif 43 | 44 | //C++ guard 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | //Path MTU discovery related functions 50 | size_t ipv6GetPathMtu(NetInterface *interface, const Ipv6Addr *destAddr); 51 | 52 | void ipv6UpdatePathMtu(NetInterface *interface, 53 | const Ipv6Addr *destAddr, size_t tentativePathMtu); 54 | 55 | //C++ guard 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /dns/dns_debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file dns_debug.h 3 | * @brief Data logging functions for debugging purpose (DNS) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _DNS_DEBUG_H 32 | #define _DNS_DEBUG_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "dns/dns_common.h" 37 | #include "debug.h" 38 | 39 | //C++ guard 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | //Check current trace level 45 | #if (DNS_TRACE_LEVEL >= TRACE_LEVEL_DEBUG) 46 | void dnsDumpMessage(const DnsHeader *message, size_t length); 47 | size_t dnsDumpQuestion(const DnsHeader *message, size_t length, size_t pos, char_t *buffer); 48 | size_t dnsDumpResourceRecord(const DnsHeader *message, size_t length, size_t pos, char_t *buffer); 49 | #else 50 | #define dnsDumpMessage(message, length) 51 | #endif 52 | 53 | //C++ guard 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /lldp/lldp_procedures.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lldp_procedures.h 3 | * @brief LLDP state machine procedures 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _LLDP_PROCEDURES_H 32 | #define _LLDP_PROCEDURES_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "lldp/lldp.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //LLDP agent related functions 44 | void lldpMibConstrInfoLldpdu(LldpPortEntry *port); 45 | void lldpMibConstrShutdownLldpdu(LldpPortEntry *port); 46 | void lldpTxFrame(LldpPortEntry *port); 47 | void lldpTxInitializeLLDP(LldpPortEntry *port); 48 | void lldpMibDeleteObjects(LldpPortEntry *port); 49 | void lldpMibUpdateObjects(LldpPortEntry *port); 50 | void lldpRxInitializeLLDP(LldpPortEntry *port); 51 | void lldpRxProcessFrame(LldpPortEntry *port); 52 | 53 | //C++ guard 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /lldp/lldp_tx_fsm.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lldp_tx_fsm.h 3 | * @brief LLDP transmit state machine 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _LLDP_TX_FSM_H 32 | #define _LLDP_TX_FSM_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "lldp/lldp.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | 44 | /** 45 | * @brief LLDP transmit states 46 | **/ 47 | 48 | typedef enum 49 | { 50 | LLDP_STATE_TX_LLDP_INITIALIZE = 0, 51 | LLDP_STATE_TX_IDLE = 1, 52 | LLDP_STATE_TX_SHUTDOWN_FRAME = 2, 53 | LLDP_STATE_TX_INFO_FRAME = 3 54 | } LldpTxState; 55 | 56 | 57 | //LLDP related functions 58 | void lldpInitTxFsm(LldpPortEntry *port); 59 | void lldpTxFsm(LldpPortEntry *port); 60 | void lldpChangeTxState(LldpPortEntry *port, LldpTxState newState); 61 | 62 | //C++ guard 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /mibs/mib2_impl_if.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mib2_impl_if.h 3 | * @brief MIB-II module implementation (Interface group) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _MIB2_IMPL_IF_H 32 | #define _MIB2_IMPL_IF_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "mibs/mib2_module.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //MIB-II related functions 44 | error_t mib2SetIfEntry(const MibObject *object, const uint8_t *oid, 45 | size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit); 46 | 47 | error_t mib2GetIfEntry(const MibObject *object, const uint8_t *oid, 48 | size_t oidLen, MibVariant *value, size_t *valueLen); 49 | 50 | error_t mib2GetNextIfEntry(const MibObject *object, const uint8_t *oid, 51 | size_t oidLen, uint8_t *nextOid, size_t *nextOidLen); 52 | 53 | //C++ guard 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /ipv4/auto_ip_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file auto_ip_misc.h 3 | * @brief Helper functions for Auto-IP 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _AUTO_IP_MISC_H 32 | #define _AUTO_IP_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ipv4/auto_ip.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //Tick counter to handle periodic operations 44 | extern systime_t autoIpTickCounter; 45 | 46 | //Auto-IP related functions 47 | void autoIpTick(AutoIpContext *context); 48 | void autoIpLinkChangeEvent(AutoIpContext *context); 49 | 50 | void autoIpChangeState(AutoIpContext *context, AutoIpState newState, 51 | systime_t delay); 52 | 53 | void autoIpGenerateAddr(Ipv4Addr *ipAddr); 54 | 55 | void autoIpResetConfig(AutoIpContext *context); 56 | void autoIpDumpConfig(AutoIpContext *context); 57 | 58 | //C++ guard 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /http/http_server_auth.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file http_server_auth.h 3 | * @brief HTTP authentication 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _HTTP_SERVER_AUTH_H 32 | #define _HTTP_SERVER_AUTH_H 33 | 34 | //Dependencies 35 | #include "http/http_server.h" 36 | 37 | //C++ guard 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | //HTTP authentication related functions 43 | bool_t httpCheckPassword(HttpConnection *connection, 44 | const char_t *password, HttpAuthMode mode); 45 | 46 | void httpParseAuthorizationField(HttpConnection *connection, char_t *value); 47 | size_t httpAddAuthenticateField(HttpConnection *connection, char_t *output); 48 | 49 | error_t httpGenerateNonce(HttpServerContext *context, 50 | char_t *output, size_t *length); 51 | 52 | error_t httpVerifyNonce(HttpServerContext *context, 53 | const char_t *nonce, const char_t *nc); 54 | 55 | //C++ guard 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /coap/coap_client_block.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file coap_client_block.h 3 | * @brief CoAP block-wise transfer 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _COAP_CLIENT_BLOCK_H 32 | #define _COAP_CLIENT_BLOCK_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "coap/coap_client.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //CoAP client related functions 44 | error_t coapClientSetTxBlockSize(CoapClientRequest *request, uint_t blockSize); 45 | error_t coapClientSetRxBlockSize(CoapClientRequest *request, uint_t blockSize); 46 | 47 | error_t coapClientWriteBody(CoapClientRequest *request, const void *data, 48 | size_t length, size_t *written, bool_t last); 49 | 50 | error_t coapClientReadBody(CoapClientRequest *request, void *data, 51 | size_t size, size_t *received); 52 | 53 | CoapBlockSize coapClientGetMaxBlockSize(void); 54 | 55 | //C++ guard 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /echo/echo_server_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file echo_server_misc.h 3 | * @brief Helper functions for Echo server 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _ECHO_SERVER_MISC_H 32 | #define _ECHO_SERVER_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "echo/echo_server.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //Echo server related functions 44 | void echoServerTick(EchoServerContext *context); 45 | 46 | void echoServerAcceptTcpConnection(EchoServerContext *context); 47 | 48 | void echoServerRegisterTcpConnectionEvents(EchoTcpConnection *connection, 49 | SocketEventDesc *eventDesc); 50 | 51 | void echoServerProcessTcpConnectionEvents(EchoTcpConnection *connection); 52 | void echoServerCloseTcpConnection(EchoTcpConnection *connection); 53 | 54 | void echoServerProcessUdpDatagram(EchoServerContext *context); 55 | 56 | //C++ guard 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /snmp/snmp_agent_object.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file snmp_agent_object.h 3 | * @brief MIB object access 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SNMP_AGENT_OBJECT_H 32 | #define _SNMP_AGENT_OBJECT_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "snmp/snmp_agent.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //SNMP agent related functions 44 | error_t snmpSetObjectValue(SnmpAgentContext *context, 45 | const SnmpMessage *message, SnmpVarBind *var, bool_t commit); 46 | 47 | error_t snmpGetObjectValue(SnmpAgentContext *context, 48 | const SnmpMessage *message, SnmpVarBind *var); 49 | 50 | error_t snmpGetNextObject(SnmpAgentContext *context, 51 | const SnmpMessage *message, SnmpVarBind *var); 52 | 53 | error_t snmpFindMibObject(SnmpAgentContext *context, 54 | const uint8_t *oid, size_t oidLen, const MibObject **object); 55 | 56 | //C++ guard 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /coap/coap_server_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file coap_server_misc.h 3 | * @brief Helper functions for CoAP server 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _COAP_SERVER_MISC_H 32 | #define _COAP_SERVER_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "coap/coap_server.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //CoAP server related functions 44 | void coapServerTick(CoapServerContext *context); 45 | 46 | error_t coapServerProcessRequest(CoapServerContext *context, 47 | const uint8_t *data, size_t length); 48 | 49 | error_t coapServerRejectRequest(CoapServerContext *context); 50 | 51 | error_t coapServerInitResponse(CoapServerContext *context); 52 | 53 | error_t coapServerSendResponse(CoapServerContext *context, 54 | const void *data, size_t length); 55 | 56 | error_t coapServerFormatReset(CoapServerContext *context, uint16_t mid); 57 | 58 | //C++ guard 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /ftp/ftp_server_transport.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ftp_server_transport.h 3 | * @brief Transport protocol abstraction layer 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _FTP_SERVER_TRANSPORT_H 32 | #define _FTP_SERVER_TRANSPORT_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ftp/ftp_server.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //FTP server related functions 44 | error_t ftpServerOpenSecureChannel(FtpServerContext *context, 45 | FtpServerChannel *channel, size_t txBufferSize, size_t rxBufferSize); 46 | 47 | error_t ftpServerEstablishSecureChannel(FtpServerChannel *channel); 48 | 49 | error_t ftpServerWriteChannel(FtpServerChannel *channel, const void *data, 50 | size_t length, size_t *written, uint_t flags); 51 | 52 | error_t ftpServerReadChannel(FtpServerChannel *channel, void *data, 53 | size_t size, size_t *received, uint_t flags); 54 | 55 | //C++ guard 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /lldp/lldp_ext_pno.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lldp_ext_pno.h 3 | * @brief PROFINET extension 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _LLDP_EXT_PNO_H 32 | #define _LLDP_EXT_PNO_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "lldp/lldp.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | 44 | /** 45 | * @brief PROFINET subtypes 46 | **/ 47 | 48 | typedef enum 49 | { 50 | LLDP_PNO_SUBTYPE_RESERVED = 0, ///= TRACE_LEVEL_DEBUG) 58 | void mldDumpMessage(const MldMessage *message, size_t length); 59 | #else 60 | #define mldDumpMessage(message, length) 61 | #endif 62 | 63 | void mldDumpQueryV2(const MldListenerQueryV2 *message, size_t length); 64 | void mldDumpReportV2(const MldListenerReportV2 *message, size_t length); 65 | 66 | void mldDumpMulticastAddrRecord(const MldMcastAddrRecord *record, 67 | size_t length); 68 | 69 | const char_t *mldGetParamName(uint_t value, const MldParamName *paramList, 70 | size_t paramListLen); 71 | 72 | //C++ guard 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /drivers/wifi/bcm43362_driver.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file bcm43362_driver.h 3 | * @brief BCM43362 Wi-Fi controller 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _BCM43362_DRIVER_H 32 | #define _BCM43362_DRIVER_H 33 | 34 | //Dependencies 35 | #include "core/nic.h" 36 | 37 | //C++ guard 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | //BCM43362 driver (STA mode) 43 | extern const NicDriver bcm43362StaDriver; 44 | //BCM43362 driver (AP mode) 45 | extern const NicDriver bcm43362ApDriver; 46 | 47 | //BCM43362 related functions 48 | error_t bcm43362Init(NetInterface *interface); 49 | 50 | void bcm43362Tick(NetInterface *interface); 51 | 52 | void bcm43362EnableIrq(NetInterface *interface); 53 | void bcm43362DisableIrq(NetInterface *interface); 54 | bool_t bcm43362IrqHandler(void); 55 | void bcm43362EventHandler(NetInterface *interface); 56 | 57 | error_t bcm43362SendPacket(NetInterface *interface, 58 | const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary); 59 | 60 | error_t bcm43362UpdateMacAddrFilter(NetInterface *interface); 61 | 62 | void bcm43362AppWifiEvent(uint8_t msgType, void *msg); 63 | void bcm43362AppEthEvent(uint8_t msgType, void *msg, void *ctrlBuf); 64 | 65 | //C++ guard 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /ftp/ftp_client_transport.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ftp_client_transport.h 3 | * @brief Transport protocol abstraction layer 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _FTP_CLIENT_TRANSPORT_H 32 | #define _FTP_CLIENT_TRANSPORT_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ftp/ftp_client.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //FTP client related functions 44 | error_t ftpClientOpenChannel(FtpClientContext *context, 45 | FtpClientChannel *channel, size_t txBufferSize, size_t rxBufferSize); 46 | 47 | error_t ftpClientOpenSecureChannel(FtpClientContext *context, 48 | FtpClientChannel *channel, size_t txBufferSize, size_t rxBufferSize); 49 | 50 | error_t ftpClientEstablishSecureChannel(FtpClientChannel *channel); 51 | 52 | error_t ftpClientShutdownChannel(FtpClientChannel *channel); 53 | 54 | void ftpClientCloseChannel(FtpClientChannel *channel); 55 | 56 | error_t ftpClientWriteChannel(FtpClientChannel *channel, const void *data, 57 | size_t length, size_t *written, uint_t flags); 58 | 59 | error_t ftpClientReadChannel(FtpClientChannel *channel, void *data, 60 | size_t size, size_t *received, uint_t flags); 61 | 62 | //C++ guard 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /ppp/ppp_debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ppp_debug.h 3 | * @brief Data logging functions for debugging purpose (PPP) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _DHCP_DEBUG_H 32 | #define _DHCP_DEBUG_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ppp/ppp.h" 37 | #include "ppp/lcp.h" 38 | #include "ppp/ipcp.h" 39 | #include "debug.h" 40 | 41 | //C++ guard 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | //Check current trace level 47 | #if (PPP_TRACE_LEVEL >= TRACE_LEVEL_DEBUG) 48 | error_t pppDumpPacket(const PppPacket *packet, size_t length, PppProtocol protocol); 49 | error_t lcpDumpPacket(const PppPacket *packet, size_t length); 50 | error_t ncpDumpPacket(const PppPacket *packet, size_t length, PppProtocol protocol); 51 | error_t papDumpPacket(const PppPacket *packet, size_t length); 52 | error_t chapDumpPacket(const PppPacket *packet, size_t length); 53 | error_t lcpDumpOptions(const PppOption *option, size_t length); 54 | error_t ipcpDumpOptions(const PppOption *option, size_t length); 55 | error_t ipv6cpDumpOptions(const PppOption *option, size_t length); 56 | #else 57 | #define pppDumpPacket(packet, length, protocol) 58 | #endif 59 | 60 | //C++ guard 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /smtp/smtp_client_transport.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file smtp_client_transport.h 3 | * @brief Transport protocol abstraction layer 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SMTP_CLIENT_TRANSPORT_H 32 | #define _SMTP_CLIENT_TRANSPORT_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "smtp/smtp_client.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //SMTP client related functions 44 | error_t smtpClientOpenConnection(SmtpClientContext *context); 45 | 46 | error_t smtpClientEstablishConnection(SmtpClientContext *context, 47 | const IpAddr *serverIpAddr, uint16_t serverPort); 48 | 49 | error_t smtpClientOpenSecureConnection(SmtpClientContext *context); 50 | error_t smtpClientEstablishSecureConnection(SmtpClientContext *context); 51 | 52 | error_t smtpClientShutdownConnection(SmtpClientContext *context); 53 | void smtpClientCloseConnection(SmtpClientContext *context); 54 | 55 | error_t smtpClientSendData(SmtpClientContext *context, const void *data, 56 | size_t length, size_t *written, uint_t flags); 57 | 58 | error_t smtpClientReceiveData(SmtpClientContext *context, void *data, 59 | size_t size, size_t *received, uint_t flags); 60 | 61 | //C++ guard 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /ipv6/ndp_cache.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ndp_cache.h 3 | * @brief Neighbor and destination cache management 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _NDP_CACHE_H 32 | #define _NDP_CACHE_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ipv6/ndp.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //NDP related functions 44 | void ndpChangeState(NdpNeighborCacheEntry *entry, NdpState newState); 45 | 46 | NdpNeighborCacheEntry *ndpCreateNeighborCacheEntry(NetInterface *interface); 47 | 48 | NdpNeighborCacheEntry *ndpFindNeighborCacheEntry(NetInterface *interface, 49 | const Ipv6Addr *ipAddr); 50 | 51 | void ndpUpdateNeighborCache(NetInterface *interface); 52 | void ndpFlushNeighborCache(NetInterface *interface); 53 | 54 | uint_t ndpSendQueuedPackets(NetInterface *interface, NdpNeighborCacheEntry *entry); 55 | void ndpFlushQueuedPackets(NetInterface *interface, NdpNeighborCacheEntry *entry); 56 | 57 | NdpDestCacheEntry *ndpCreateDestCacheEntry(NetInterface *interface); 58 | 59 | NdpDestCacheEntry *ndpFindDestCacheEntry(NetInterface *interface, 60 | const Ipv6Addr *destAddr); 61 | 62 | void ndpFlushDestCache(NetInterface *interface); 63 | 64 | //C++ guard 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /dhcp/dhcp_debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file dhcp_debug.h 3 | * @brief Data logging functions for debugging purpose (DHCP) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _DHCP_DEBUG_H 32 | #define _DHCP_DEBUG_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "dhcp/dhcp_common.h" 37 | #include "debug.h" 38 | 39 | //C++ guard 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | //Check current trace level 45 | #if (DHCP_TRACE_LEVEL >= TRACE_LEVEL_DEBUG) 46 | error_t dhcpDumpMessage(const DhcpMessage *message, size_t length); 47 | error_t dhcpDumpMessageType(const DhcpOption *option); 48 | error_t dhcpDumpParamRequestList(const DhcpOption *option); 49 | error_t dhcpDumpBoolean(const DhcpOption *option); 50 | error_t dhcpDumpInt8(const DhcpOption *option); 51 | error_t dhcpDumpInt16(const DhcpOption *option); 52 | error_t dhcpDumpInt32(const DhcpOption *option); 53 | error_t dhcpDumpString(const DhcpOption *option); 54 | error_t dhcpDumpIpv4Addr(const DhcpOption *option); 55 | error_t dhcpDumpIpv4AddrList(const DhcpOption *option); 56 | error_t dhcpDumpRawData(const DhcpOption *option); 57 | #else 58 | #define dhcpDumpMessage(message, length) 59 | #endif 60 | 61 | //C++ guard 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /igmp/igmp_debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file igmp_debug.h 3 | * @brief Data logging functions for debugging purpose (IGMP) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _IGMP_DEBUG_H 32 | #define _IGMP_DEBUG_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "igmp/igmp_common.h" 37 | #include "debug.h" 38 | 39 | //C++ guard 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | 45 | /** 46 | * @brief Parameter value/name binding 47 | **/ 48 | 49 | typedef struct 50 | { 51 | uint_t value; 52 | const char_t *name; 53 | } IgmpParamName; 54 | 55 | 56 | //Check current trace level 57 | #if (IGMP_TRACE_LEVEL >= TRACE_LEVEL_DEBUG) 58 | void igmpDumpMessage(const IgmpMessage *message, size_t length); 59 | #else 60 | #define igmpDumpMessage(message, length) 61 | #endif 62 | 63 | void igmpDumpMembershipQueryV3(const IgmpMembershipQueryV3 *message, 64 | size_t length); 65 | 66 | void igmpDumpMessageMembershipReportV3(const IgmpMembershipReportV3 *message, 67 | size_t length); 68 | 69 | void igmpDumpGroupRecord(const IgmpGroupRecord *record, 70 | size_t length); 71 | 72 | const char_t *igmpGetParamName(uint_t value, const IgmpParamName *paramList, 73 | size_t paramListLen); 74 | 75 | //C++ guard 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /mqtt_sn/mqtt_sn_client_transport.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mqtt_sn_client_transport.h 3 | * @brief Transport protocol abstraction layer 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _MQTT_SN_CLIENT_TRANSPORT_H 32 | #define _MQTT_SN_CLIENT_TRANSPORT_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "mqtt_sn/mqtt_sn_client.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //MQTT-SN related functions 44 | error_t mqttSnClientOpenConnection(MqttSnClientContext *context, bool_t secure); 45 | error_t mqttSnClientEstablishConnection(MqttSnClientContext *context); 46 | error_t mqttSnClientShutdownConnection(MqttSnClientContext *context); 47 | void mqttSnClientCloseConnection(MqttSnClientContext *context); 48 | 49 | error_t mqttSnClientBroadcastDatagram(MqttSnClientContext *context, 50 | const IpAddr *destIpAddr, uint16_t destPort, const void *data, 51 | size_t length); 52 | 53 | error_t mqttSnClientSendDatagram(MqttSnClientContext *context, 54 | const void *data, size_t length); 55 | 56 | error_t mqttSnClientReceiveDatagram(MqttSnClientContext *context, 57 | IpAddr *srcIpAddr, uint16_t *srcPort, void *data, size_t size, 58 | size_t *received, systime_t timeout); 59 | 60 | //C++ guard 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /ftp/ftp_server_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ftp_server_misc.h 3 | * @brief Helper functions for FTP server 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _FTP_SERVER_MISC_H 32 | #define _FTP_SERVER_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ftp/ftp_server.h" 37 | 38 | //Time constant 39 | #define FTP_SERVER_180_DAYS (180 * 86400) 40 | 41 | //C++ guard 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | //FTP server related functions 47 | void ftpServerTick(FtpServerContext *context); 48 | 49 | uint16_t ftpServerGetPassivePort(FtpServerContext *context); 50 | 51 | error_t ftpServerGetPath(FtpClientConnection *connection, 52 | const char_t *inputPath, char_t *outputPath, size_t maxLen); 53 | 54 | uint_t ftpServerGetFilePermissions(FtpClientConnection *connection, 55 | const char_t *path); 56 | 57 | size_t ftpServerFormatDirEntry(const FsDirEntry *dirEntry, uint_t perm, 58 | char_t *buffer); 59 | 60 | const char_t *ftpServerStripRootDir(FtpServerContext *context, 61 | const char_t *path); 62 | 63 | const char_t *ftpServerStripUserRootDir(FtpClientConnection *connection, 64 | const char_t *path); 65 | 66 | void ftpServerCloseConnection(FtpClientConnection *connection); 67 | 68 | //C++ guard 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /ppp/ppp_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ppp_misc.h 3 | * @brief PPP miscellaneous functions 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _PPP_MISC_H 32 | #define _PPP_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ppp/ppp.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //PPP related functions 44 | error_t pppSendConfigureAckNak(PppContext *context, 45 | const PppConfigurePacket *configureReqPacket, PppProtocol protocol, PppCode code); 46 | 47 | error_t pppSendTerminateReq(PppContext *context, 48 | uint8_t identifier, PppProtocol protocol); 49 | 50 | error_t pppSendTerminateAck(PppContext *context, 51 | uint8_t identifier, PppProtocol protocol); 52 | 53 | error_t pppSendCodeRej(PppContext *context, const PppPacket *packet, 54 | uint8_t identifier, PppProtocol protocol); 55 | 56 | error_t pppSendProtocolRej(PppContext *context, uint8_t identifier, 57 | uint16_t protocol, const uint8_t *information, size_t length); 58 | 59 | error_t pppSendEchoRep(PppContext *context, 60 | const PppEchoPacket *echoReqPacket, PppProtocol protocol); 61 | 62 | error_t pppAddOption(PppConfigurePacket *packet, uint8_t optionType, 63 | const void *optionValue, uint8_t optionLen); 64 | 65 | //C++ guard 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /mibs/snmp_mpd_mib_module.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file snmp_mpd_mib_module.h 3 | * @brief SNMP MPD MIB module 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SNMP_MPD_MIB_MODULE_H 32 | #define _SNMP_MPD_MIB_MODULE_H 33 | 34 | //Dependencies 35 | #include "mibs/mib_common.h" 36 | 37 | //SNMP MPD MIB module support 38 | #ifndef SNMP_MPD_MIB_SUPPORT 39 | #define SNMP_MPD_MIB_SUPPORT DISABLED 40 | #elif (SNMP_MPD_MIB_SUPPORT != ENABLED && SNMP_MPD_MIB_SUPPORT != DISABLED) 41 | #error SNMP_MPD_MIB_SUPPORT parameter is not valid 42 | #endif 43 | 44 | //Macro definitions 45 | #if (SNMP_MPD_MIB_SUPPORT == ENABLED) 46 | #define SNMP_MPD_MIB_INC_COUNTER32(name, value) snmpMpdMibBase.name += value 47 | #else 48 | #define SNMP_MPD_MIB_INC_COUNTER32(name, value) 49 | #endif 50 | 51 | //C++ guard 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | 57 | /** 58 | * @brief SNMP MPD MIB base 59 | **/ 60 | 61 | typedef struct 62 | { 63 | uint32_t snmpUnknownSecurityModels; 64 | uint32_t snmpInvalidMsgs; 65 | uint32_t snmpUnknownPDUHandlers; 66 | } SnmpMpdMibBase; 67 | 68 | 69 | //SNMP MPD MIB related constants 70 | extern SnmpMpdMibBase snmpMpdMibBase; 71 | extern const MibObject snmpMpdMibObjects[]; 72 | extern const MibModule snmpMpdMibModule; 73 | 74 | //C++ guard 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /ntp/ntp_debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ntp_debug.h 3 | * @brief Data logging functions for debugging purpose (NTP) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _NTP_DEBUG_H 32 | #define _NTP_DEBUG_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ntp/ntp_common.h" 37 | #include "debug.h" 38 | 39 | //C++ guard 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | 45 | /** 46 | * @brief Parameter value/name binding 47 | **/ 48 | 49 | typedef struct 50 | { 51 | uint_t value; 52 | const char_t *name; 53 | } NtpParamName; 54 | 55 | 56 | //Check current trace level 57 | #if (NTP_TRACE_LEVEL >= TRACE_LEVEL_DEBUG) 58 | void ntpDumpPacket(const NtpHeader *packet, size_t length); 59 | void ntpDumpExtensions(const uint8_t *extension, size_t length); 60 | #else 61 | #define ntpDumpPacket(packet, length) 62 | #define ntpDumpExtensions(extension, length) 63 | #endif 64 | 65 | void ntpDumpExtension(const NtpExtension *extension, size_t length); 66 | 67 | void ntpDumpNtsAeadExtension(const NtpNtsAeadExtension *extension, 68 | size_t length); 69 | 70 | void ntpDumpTimestamp(const NtpTimestamp *timestamp); 71 | 72 | const char_t *ntpGetParamName(uint_t value, const NtpParamName *paramList, 73 | size_t paramListLen); 74 | 75 | //C++ guard 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /snmp/snmp_agent_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file snmp_agent_misc.h 3 | * @brief Helper functions for SNMP agent 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SNMP_AGENT_MISC_H 32 | #define _SNMP_AGENT_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "snmp/snmp_agent.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //SNMP agent related functions 44 | void snmpLockMib(SnmpAgentContext *context); 45 | void snmpUnlockMib(SnmpAgentContext *context); 46 | 47 | SnmpUserEntry *snmpCreateCommunityEntry(SnmpAgentContext *context); 48 | 49 | SnmpUserEntry *snmpFindCommunityEntry(SnmpAgentContext *context, 50 | const char_t *community, size_t length); 51 | 52 | error_t snmpParseVarBinding(const uint8_t *p, 53 | size_t length, SnmpVarBind *var, size_t *consumed); 54 | 55 | error_t snmpWriteVarBinding(SnmpAgentContext *context, const SnmpVarBind *var); 56 | error_t snmpCopyVarBindingList(SnmpAgentContext *context); 57 | 58 | error_t snmpWriteTrapVarBindingList(SnmpAgentContext *context, 59 | uint_t genericTrapType, uint_t specificTrapCode, 60 | const SnmpTrapObject *objectList, uint_t objectListSize); 61 | 62 | error_t snmpTranslateStatusCode(SnmpMessage *message, error_t status, uint_t index); 63 | 64 | //C++ guard 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /mibs/mib2_impl_sys.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mib2_impl_sys.c 3 | * @brief MIB-II module implementation (System group) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | //Switch to the appropriate trace level 32 | #define TRACE_LEVEL SNMP_TRACE_LEVEL 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "mibs/mib_common.h" 37 | #include "mibs/mib2_module.h" 38 | #include "mibs/mib2_impl.h" 39 | #include "mibs/mib2_impl_sys.h" 40 | #include "core/crypto.h" 41 | #include "encoding/asn1.h" 42 | #include "encoding/oid.h" 43 | #include "debug.h" 44 | 45 | //Check TCP/IP stack configuration 46 | #if (MIB2_SUPPORT == ENABLED && MIB2_SYS_GROUP_SUPPORT == ENABLED) 47 | 48 | 49 | /** 50 | * @brief Get sysUpTime object value 51 | * @param[in] object Pointer to the MIB object descriptor 52 | * @param[in] oid Object identifier (object name and instance identifier) 53 | * @param[in] oidLen Length of the OID, in bytes 54 | * @param[out] value Object value 55 | * @param[in,out] valueLen Length of the object value, in bytes 56 | * @return Error code 57 | **/ 58 | 59 | error_t mib2GetSysUpTime(const MibObject *object, const uint8_t *oid, 60 | size_t oidLen, MibVariant *value, size_t *valueLen) 61 | { 62 | //Get object value 63 | value->timeTicks = osGetSystemTime64() / 10; 64 | 65 | //Successful processing 66 | return NO_ERROR; 67 | } 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /mibs/snmp_framework_mib_impl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file snmp_framework_mib_impl.h 3 | * @brief SNMP FRAMEWORK MIB module implementation 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SNMP_FRAMEWORK_MIB_IMPL_H 32 | #define _SNMP_FRAMEWORK_MIB_IMPL_H 33 | 34 | //Dependencies 35 | #include "mibs/mib_common.h" 36 | 37 | //C++ guard 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | //SNMP FRAMEWORK MIB related functions 43 | error_t snmpFrameworkMibInit(void); 44 | error_t snmpFrameworkMibLoad(void *context); 45 | void snmpFrameworkMibUnload(void *context); 46 | void snmpFrameworkMibLock(void); 47 | void snmpFrameworkMibUnlock(void); 48 | 49 | error_t snmpFrameworkMibGetSnmpEngineID(const MibObject *object, 50 | const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen); 51 | 52 | error_t snmpFrameworkMibGetSnmpEngineBoots(const MibObject *object, 53 | const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen); 54 | 55 | error_t snmpFrameworkMibGetSnmpEngineTime(const MibObject *object, 56 | const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen); 57 | 58 | error_t snmpFrameworkMibGetSnmpEngineMaxMessageSize(const MibObject *object, 59 | const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen); 60 | 61 | //C++ guard 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /smtp/smtp_client_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file smtp_client_misc.h 3 | * @brief Helper functions for SMTP client 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SMTP_CLIENT_MISC_H 32 | #define _SMTP_CLIENT_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "smtp/smtp_client.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //SMTP client related functions 44 | void smtpClientChangeState(SmtpClientContext *context, 45 | SmtpClientState newState); 46 | 47 | error_t smtpClientSendCommand(SmtpClientContext *context, 48 | SmtpClientReplyCallback callback); 49 | 50 | error_t smtpClientFormatCommand(SmtpClientContext *context, 51 | const char_t *command, const char_t *argument); 52 | 53 | error_t smtpClientParseEhloReply(SmtpClientContext *context, 54 | char_t *replyLine); 55 | 56 | error_t smtpClientFormatMailHeader(SmtpClientContext *context, 57 | const SmtpMailAddr *from, const SmtpMailAddr *recipients, 58 | uint_t numRecipients, const char_t *subject); 59 | 60 | error_t smtpClientFormatMultipartHeader(SmtpClientContext *context, 61 | const char_t *filename, const char_t *contentType, 62 | const char_t *contentTransferEncoding, bool_t last); 63 | 64 | error_t smtpClientCheckTimeout(SmtpClientContext *context); 65 | 66 | //C++ guard 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /mibs/snmp_community_mib_impl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file snmp_community_mib_impl.h 3 | * @brief SNMP COMMUNITY MIB module implementation 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @section Description 28 | * 29 | * The SNMP-MIB describes managed objects which describe the behavior 30 | * of an SNMP entity. Refer to RFC 3418 for more details 31 | * 32 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 33 | * @version 2.5.4 34 | **/ 35 | 36 | #ifndef _SNMP_COMMUNITY_MIB_IMPL_H 37 | #define _SNMP_COMMUNITY_MIB_IMPL_H 38 | 39 | //Dependencies 40 | #include "mibs/mib_common.h" 41 | 42 | //C++ guard 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | //SNMP COMMUNITY MIB related functions 48 | error_t snmpCommunityMibInit(void); 49 | error_t snmpCommunityMibLoad(void *context); 50 | void snmpCommunityMibUnload(void *context); 51 | void snmpCommunityMibLock(void); 52 | void snmpCommunityMibUnlock(void); 53 | 54 | error_t snmpCommunityMibSetCommunityEntry(const MibObject *object, const uint8_t *oid, 55 | size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit); 56 | 57 | error_t snmpCommunityMibGetCommunityEntry(const MibObject *object, const uint8_t *oid, 58 | size_t oidLen, MibVariant *value, size_t *valueLen); 59 | 60 | error_t snmpCommunityMibGetNextCommunityEntry(const MibObject *object, const uint8_t *oid, 61 | size_t oidLen, uint8_t *nextOid, size_t *nextOidLen); 62 | 63 | //C++ guard 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /mibs/tcp_mib_impl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tcp_mib_impl.h 3 | * @brief TCP MIB module implementation 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _TCP_MIB_IMPL_H 32 | #define _TCP_MIB_IMPL_H 33 | 34 | //Dependencies 35 | #include "mibs/mib_common.h" 36 | 37 | //C++ guard 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | //TCP MIB related functions 43 | error_t tcpMibInit(void); 44 | 45 | error_t tcpMibGetTcpCurrEstab(const MibObject *object, const uint8_t *oid, 46 | size_t oidLen, MibVariant *value, size_t *valueLen); 47 | 48 | error_t tcpMibSetTcpConnectionEntry(const MibObject *object, const uint8_t *oid, 49 | size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit); 50 | 51 | error_t tcpMibGetTcpConnectionEntry(const MibObject *object, const uint8_t *oid, 52 | size_t oidLen, MibVariant *value, size_t *valueLen); 53 | 54 | error_t tcpMibGetNextTcpConnectionEntry(const MibObject *object, const uint8_t *oid, 55 | size_t oidLen, uint8_t *nextOid, size_t *nextOidLen); 56 | 57 | error_t tcpMibGetTcpListenerEntry(const MibObject *object, const uint8_t *oid, 58 | size_t oidLen, MibVariant *value, size_t *valueLen); 59 | 60 | error_t tcpMibGetNextTcpListenerEntry(const MibObject *object, const uint8_t *oid, 61 | size_t oidLen, uint8_t *nextOid, size_t *nextOidLen); 62 | 63 | //C++ guard 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /core/socket_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file socket_misc.h 3 | * @brief Helper functions for sockets 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SOCKET_MISC_H 32 | #define _SOCKET_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "core/socket.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //Socket related functions 44 | Socket *socketAllocate(uint_t type, uint_t protocol); 45 | 46 | void socketRegisterEvents(Socket *socket, OsEvent *event, uint_t eventMask); 47 | void socketUnregisterEvents(Socket *socket); 48 | uint_t socketGetEvents(Socket *socket); 49 | 50 | bool_t socketMulticastFilter(Socket *socket, const IpAddr *destAddr, 51 | const IpAddr *srcAddr); 52 | 53 | SocketMulticastGroup *socketCreateMulticastGroupEntry(Socket *socket, 54 | const IpAddr *groupAddr); 55 | 56 | SocketMulticastGroup *socketFindMulticastGroupEntry(Socket *socket, 57 | const IpAddr *groupAddr); 58 | 59 | void socketDeleteMulticastGroupEntry(SocketMulticastGroup *group); 60 | 61 | error_t socketAddMulticastSrcAddr(SocketMulticastGroup *group, 62 | const IpAddr *srcAddr); 63 | 64 | void socketRemoveMulticastSrcAddr(SocketMulticastGroup *group, 65 | const IpAddr *srcAddr); 66 | 67 | int_t socketFindMulticastSrcAddr(SocketMulticastGroup *group, 68 | const IpAddr *srcAddr); 69 | 70 | //C++ guard 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /snmp/snmp_agent_trap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file snmp_agent_trap.h 3 | * @brief SNMP trap notifications 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SNMP_AGENT_TRAP_H 32 | #define _SNMP_AGENT_TRAP_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "snmp/snmp_agent.h" 37 | 38 | //Trap notification support 39 | #ifndef SNMP_AGENT_TRAP_SUPPORT 40 | #define SNMP_AGENT_TRAP_SUPPORT ENABLED 41 | #elif (SNMP_AGENT_TRAP_SUPPORT != ENABLED && SNMP_AGENT_TRAP_SUPPORT != DISABLED) 42 | #error SNMP_AGENT_TRAP_SUPPORT parameter is not valid 43 | #endif 44 | 45 | //C++ guard 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | 51 | /** 52 | * @brief Object descriptor for trap notifications 53 | **/ 54 | 55 | typedef struct 56 | { 57 | uint8_t oid[SNMP_MAX_OID_SIZE]; 58 | size_t oidLen; 59 | } SnmpTrapObject; 60 | 61 | 62 | //SNMP trap related functions 63 | error_t snmpFormatTrapMessage(SnmpAgentContext *context, SnmpVersion version, 64 | const char_t *userName, uint_t genericTrapType, uint_t specificTrapCode, 65 | const SnmpTrapObject *objectList, uint_t objectListSize); 66 | 67 | error_t snmpFormatTrapPdu(SnmpAgentContext *context, SnmpVersion version, 68 | const char_t *userName, uint_t genericTrapType, uint_t specificTrapCode, 69 | const SnmpTrapObject *objectList, uint_t objectListSize); 70 | 71 | //C++ guard 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /drivers/loopback/loopback_driver.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file loopback_driver.h 3 | * @brief Loopback interface driver 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _LOOPBACK_DRIVER_H 32 | #define _LOOPBACK_DRIVER_H 33 | 34 | //Dependencies 35 | #include "core/nic.h" 36 | 37 | //Queue size 38 | #ifndef LOOPBACK_DRIVER_QUEUE_SIZE 39 | #define LOOPBACK_DRIVER_QUEUE_SIZE 6 40 | #elif (LOOPBACK_DRIVER_QUEUE_SIZE < 1) 41 | #error LOOPBACK_DRIVER_QUEUE_SIZE parameter is not valid 42 | #endif 43 | 44 | 45 | /** 46 | * @brief Loopback interface queue entry 47 | **/ 48 | 49 | typedef struct 50 | { 51 | size_t length; 52 | uint8_t data[ETH_MTU]; 53 | } LoopbackDriverQueueEntry; 54 | 55 | 56 | //Loopback interface driver 57 | extern const NicDriver loopbackDriver; 58 | 59 | //Loopback interface related functions 60 | error_t loopbackDriverInit(NetInterface *interface); 61 | 62 | void loopbackDriverTick(NetInterface *interface); 63 | 64 | void loopbackDriverEnableIrq(NetInterface *interface); 65 | void loopbackDriverDisableIrq(NetInterface *interface); 66 | void loopbackDriverEventHandler(NetInterface *interface); 67 | 68 | error_t loopbackDriverSendPacket(NetInterface *interface, 69 | const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary); 70 | 71 | error_t loopbackDriverReceivePacket(NetInterface *interface); 72 | 73 | error_t loopbackDriverUpdateMacAddrFilter(NetInterface *interface); 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /ftp/ftp_client_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ftp_client_misc.h 3 | * @brief Helper functions for FTP client 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _FTP_CLIENT_MISC_H 32 | #define _FTP_CLIENT_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ftp/ftp_client.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //FTP client related functions 44 | void ftpClientChangeState(FtpClientContext *context, FtpClientState newState); 45 | 46 | error_t ftpClientSendCommand(FtpClientContext *context); 47 | 48 | error_t ftpClientFormatCommand(FtpClientContext *context, 49 | const char_t *command, const char_t *argument); 50 | 51 | error_t ftpClientFormatPortCommand(FtpClientContext *context, 52 | const IpAddr *ipAddr, uint16_t port); 53 | 54 | error_t ftpClientFormatPasvCommand(FtpClientContext *context); 55 | error_t ftpClientParsePasvReply(FtpClientContext *context, uint16_t *port); 56 | 57 | error_t ftpClientParsePwdReply(FtpClientContext *context, char_t *path, 58 | size_t maxLen); 59 | 60 | error_t ftpClientParseDirEntry(char_t *line, FtpDirEntry *dirEntry); 61 | 62 | error_t ftpClientInitDataTransfer(FtpClientContext *context, bool_t direction); 63 | error_t ftpClientTerminateDataTransfer(FtpClientContext *context); 64 | 65 | error_t ftpClientCheckTimeout(FtpClientContext *context); 66 | 67 | //C++ guard 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /mibs/snmp_usm_mib_impl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file snmp_usm_mib_impl.h 3 | * @brief SNMP USM MIB module implementation 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SNMP_USM_MIB_IMPL_H 32 | #define _SNMP_USM_MIB_IMPL_H 33 | 34 | //Dependencies 35 | #include "mibs/mib_common.h" 36 | 37 | //C++ guard 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | //SNMP USM MIB related functions 43 | error_t snmpUsmMibInit(void); 44 | error_t snmpUsmMibLoad(void *context); 45 | void snmpUsmMibUnload(void *context); 46 | void snmpUsmMibLock(void); 47 | void snmpUsmMibUnlock(void); 48 | 49 | error_t snmpUsmMibSetUserSpinLock(const MibObject *object, const uint8_t *oid, 50 | size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit); 51 | 52 | error_t snmpUsmMibGetUserSpinLock(const MibObject *object, const uint8_t *oid, 53 | size_t oidLen, MibVariant *value, size_t *valueLen); 54 | 55 | error_t snmpUsmMibSetUserEntry(const MibObject *object, const uint8_t *oid, 56 | size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit); 57 | 58 | error_t snmpUsmMibGetUserEntry(const MibObject *object, const uint8_t *oid, 59 | size_t oidLen, MibVariant *value, size_t *valueLen); 60 | 61 | error_t snmpUsmMibGetNextUserEntry(const MibObject *object, const uint8_t *oid, 62 | size_t oidLen, uint8_t *nextOid, size_t *nextOidLen); 63 | 64 | //C++ guard 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /mibs/udp_mib_module.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file udp_mib_module.h 3 | * @brief UDP MIB module 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _UDP_MIB_MODULE_H 32 | #define _UDP_MIB_MODULE_H 33 | 34 | //Dependencies 35 | #include "mibs/mib_common.h" 36 | 37 | //UDP MIB module support 38 | #ifndef UDP_MIB_SUPPORT 39 | #define UDP_MIB_SUPPORT DISABLED 40 | #elif (UDP_MIB_SUPPORT != ENABLED && UDP_MIB_SUPPORT != DISABLED) 41 | #error UDP_MIB_SUPPORT parameter is not valid 42 | #endif 43 | 44 | //Macro definitions 45 | #if (UDP_MIB_SUPPORT == ENABLED) 46 | #define UDP_MIB_INC_COUNTER32(name, value) udpMibBase.name += value 47 | #define UDP_MIB_INC_COUNTER64(name, value) udpMibBase.name += value 48 | #else 49 | #define UDP_MIB_INC_COUNTER32(name, value) 50 | #define UDP_MIB_INC_COUNTER64(name, value) 51 | #endif 52 | 53 | //C++ guard 54 | #ifdef __cplusplus 55 | extern "C" { 56 | #endif 57 | 58 | 59 | /** 60 | * @brief UDP MIB base 61 | **/ 62 | 63 | typedef struct 64 | { 65 | uint32_t udpInDatagrams; 66 | uint32_t udpNoPorts; 67 | uint32_t udpInErrors; 68 | uint32_t udpOutDatagrams; 69 | uint64_t udpHCInDatagrams; 70 | uint64_t udpHCOutDatagrams; 71 | } UdpMibBase; 72 | 73 | 74 | //UDP MIB related constants 75 | extern UdpMibBase udpMibBase; 76 | extern const MibObject udpMibObjects[]; 77 | extern const MibModule udpMibModule; 78 | 79 | //C++ guard 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /coap/coap_client_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file coap_client_misc.h 3 | * @brief Helper functions for CoAP client 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _COAP_CLIENT_MISC_H 32 | #define _COAP_CLIENT_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "coap/coap_client.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //CoAP client related functions 44 | error_t coapClientProcessEvents(CoapClientContext *context, systime_t timeout); 45 | error_t coapClientProcessRequestEvents(CoapClientRequest *request); 46 | 47 | error_t coapClientChangeRequestState(CoapClientRequest *request, 48 | CoapRequestState newState); 49 | 50 | error_t coapClientMatchResponse(const CoapClientRequest *request, 51 | const CoapMessage *response); 52 | 53 | error_t coapClientProcessResponse(CoapClientRequest *request, 54 | const CoapMessage *response); 55 | 56 | error_t coapClientRejectResponse(CoapClientContext *context, 57 | const CoapMessage *response); 58 | 59 | error_t coapClientSendAck(CoapClientContext *context, uint16_t mid); 60 | error_t coapClientSendReset(CoapClientContext *context, uint16_t mid); 61 | 62 | void coapClientGenerateMessageId(CoapClientContext *context, 63 | CoapMessageHeader *header); 64 | 65 | void coapClientGenerateToken(CoapClientContext *context, 66 | CoapMessageHeader *header); 67 | 68 | //C++ guard 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /ipv6/ndp_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ndp_misc.h 3 | * @brief Helper functions for NDP (Neighbor Discovery Protocol) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _NDP_MISC_H 32 | #define _NDP_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "ipv6/ndp.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //NDP related functions 44 | void ndpParsePrefixInfoOption(NetInterface *interface, NdpPrefixInfoOption *option); 45 | 46 | void ndpUpdateAddrList(NetInterface *interface); 47 | void ndpUpdatePrefixList(NetInterface *interface); 48 | void ndpUpdateDefaultRouterList(NetInterface *interface); 49 | 50 | error_t ndpSelectDefaultRouter(NetInterface *interface, 51 | const Ipv6Addr *unreachableAddr, Ipv6Addr *addr); 52 | 53 | bool_t ndpIsFirstHopRouter(NetInterface *interface, 54 | const Ipv6Addr *destAddr, const Ipv6Addr *nextHop); 55 | 56 | error_t ndpSelectNextHop(NetInterface *interface, const Ipv6Addr *destAddr, 57 | const Ipv6Addr *unreachableNextHop, Ipv6Addr *nextHop, bool_t dontRoute); 58 | 59 | void ndpUpdateNextHop(NetInterface *interface, const Ipv6Addr *nextHop); 60 | 61 | void ndpAddOption(void *message, size_t *messageLen, uint8_t type, 62 | const void *value, size_t length); 63 | 64 | void *ndpGetOption(uint8_t *options, size_t length, uint8_t type); 65 | 66 | error_t ndpCheckOptions(const uint8_t *options, size_t length); 67 | 68 | //C++ guard 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /mibs/snmp_vacm_mib_module.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file snmp_vacm_mib_module.h 3 | * @brief SNMP VACM MIB module 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _SNMP_VACM_MIB_MODULE_H 32 | #define _SNMP_VACM_MIB_MODULE_H 33 | 34 | //Dependencies 35 | #include "mibs/mib_common.h" 36 | #include "snmp/snmp_agent.h" 37 | 38 | //SNMP VACM MIB module support 39 | #ifndef SNMP_VACM_MIB_SUPPORT 40 | #define SNMP_VACM_MIB_SUPPORT DISABLED 41 | #elif (SNMP_VACM_MIB_SUPPORT != ENABLED && SNMP_VACM_MIB_SUPPORT != DISABLED) 42 | #error SNMP_VACM_MIB_SUPPORT parameter is not valid 43 | #endif 44 | 45 | //Support for SET operations 46 | #ifndef SNMP_VACM_MIB_SET_SUPPORT 47 | #define SNMP_VACM_MIB_SET_SUPPORT DISABLED 48 | #elif (SNMP_VACM_MIB_SET_SUPPORT != ENABLED && SNMP_VACM_MIB_SET_SUPPORT != DISABLED) 49 | #error SNMP_VACM_MIB_SET_SUPPORT parameter is not valid 50 | #endif 51 | 52 | //C++ guard 53 | #ifdef __cplusplus 54 | extern "C" { 55 | #endif 56 | 57 | 58 | /** 59 | * @brief SNMP VACM MIB base 60 | **/ 61 | 62 | typedef struct 63 | { 64 | SnmpAgentContext *context; 65 | int32_t vacmViewSpinLock; 66 | SnmpGroupEntry tempGroupEntry; 67 | SnmpAccessEntry tempAccessEntry; 68 | SnmpViewEntry tempViewEntry; 69 | } SnmpVacmMibBase; 70 | 71 | 72 | //SNMP VACM MIB related constants 73 | extern SnmpVacmMibBase snmpVacmMibBase; 74 | extern const MibObject snmpVacmMibObjects[]; 75 | extern const MibModule snmpVacmMibModule; 76 | 77 | //C++ guard 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /nts/nts_debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file nts_debug.h 3 | * @brief Data logging functions for debugging purpose (NTS) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _NTS_DEBUG_H 32 | #define _NTS_DEBUG_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "nts/nts_common.h" 37 | #include "debug.h" 38 | 39 | //C++ guard 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | 45 | /** 46 | * @brief Parameter value/name binding 47 | **/ 48 | 49 | typedef struct 50 | { 51 | uint_t value; 52 | const char_t *name; 53 | } NtsParamName; 54 | 55 | 56 | //Check current trace level 57 | #if (NTS_TRACE_LEVEL >= TRACE_LEVEL_DEBUG) 58 | void ntsDumpNtsKeRecords(const uint8_t *records, size_t length); 59 | void ntsDumpNtsKeRecord(const NtsKeRecord *record, size_t length); 60 | #else 61 | #define ntsDumpNtsKeRecords(records, length) 62 | #define ntsDumpNtsKeRecord(record, length) 63 | #endif 64 | 65 | void ntsDumpNtsNextProtoNegoRecord(const uint8_t *body, size_t length); 66 | void ntsDumpAeadAlgoNegoRecord(const uint8_t *body, size_t length); 67 | void ntsDumpNtpv4ServerNegoRecord(const uint8_t *body, size_t length); 68 | void ntsDumpNtpv4PortNegoRecord(const uint8_t *body, size_t length); 69 | void ntsDumpErrorRecord(const uint8_t *body, size_t length); 70 | void ntsDumpWarningRecord(const uint8_t *body, size_t length); 71 | 72 | const char_t *ntsGetParamName(uint_t value, const NtsParamName *paramList, 73 | size_t paramListLen); 74 | 75 | //C++ guard 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /core/ethernet_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ethernet_misc.h 3 | * @brief Helper functions for Ethernet 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _ETHERNET_MISC_H 32 | #define _ETHERNET_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "core/ethernet.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //Ethernet related constants 44 | extern const uint8_t ethPadding[64]; 45 | 46 | //Ethernet related functions 47 | error_t ethPadFrame(NetBuffer *buffer, size_t *length); 48 | 49 | error_t ethEncodeVlanTag(NetBuffer *buffer, size_t *offset, uint16_t vlanId, 50 | int8_t vlanPcp, int8_t vlanDei, uint16_t type); 51 | 52 | error_t ethDecodeVlanTag(const uint8_t *frame, size_t length, uint16_t *vlanId, 53 | uint16_t *type); 54 | 55 | error_t ethCheckDestAddr(NetInterface *interface, const MacAddr *macAddr); 56 | bool_t ethTrapIgmpPacket(EthHeader *header, uint8_t *data, size_t length); 57 | 58 | void ethUpdateInStats(NetInterface *interface, const MacAddr *destMacAddr); 59 | 60 | void ethUpdateOutStats(NetInterface *interface, const MacAddr *destMacAddr, 61 | size_t length); 62 | 63 | void ethUpdateErrorStats(NetInterface *interface, error_t error); 64 | 65 | uint32_t ethCalcCrc(const void *data, size_t length); 66 | uint32_t ethCalcCrcEx(const NetBuffer *buffer, size_t offset, size_t length); 67 | 68 | error_t ethCheckCrc(NetInterface *interface, const uint8_t *frame, 69 | size_t length); 70 | 71 | //C++ guard 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /lldp/lldp_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lldp_misc.h 3 | * @brief Helper functions for LLDP 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _LLDP_MISC_H 32 | #define _LLDP_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "lldp/lldp.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //LLDP multicast address (refer to IEEE Std 802.1AB-2005, section 8.1) 44 | extern const MacAddr LLDP_MULTICAST_ADDR; 45 | 46 | //LLDP agent related functions 47 | void lldpTick(LldpAgentContext *context); 48 | 49 | void lldpProcessFrame(LldpAgentContext *context); 50 | 51 | error_t lldpCheckDataUnit(LldpPortEntry *port, LldpDataUnit *lldpdu); 52 | 53 | LldpNeighborEntry *lldpCreateNeighborEntry(LldpAgentContext *context); 54 | 55 | LldpNeighborEntry *lldpFindNeighborEntry(LldpAgentContext *context, 56 | LldpDataUnit *lldpdu); 57 | 58 | void lldpDeleteNeighborEntry(LldpNeighborEntry *entry); 59 | 60 | bool_t lldpGetLinkState(LldpAgentContext *context, uint_t portIndex); 61 | 62 | error_t lldpAcceptMulticastAddr(LldpAgentContext *context); 63 | error_t lldpDropMulticastAddr(LldpAgentContext *context); 64 | 65 | void lldpGeneratePortAddr(LldpPortEntry *port); 66 | 67 | error_t lldpGetMsapId(LldpDataUnit *lldpdu, LldpMsapId *msapId); 68 | bool_t lldpCompareMsapId(const LldpMsapId *msapId1, const LldpMsapId *msapId2); 69 | 70 | void lldpSomethingChangedLocal(LldpAgentContext *context); 71 | void lldpDecrementTimer(uint_t *x); 72 | 73 | //C++ guard 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /llmnr/llmnr_responder.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file llmnr_responder.h 3 | * @brief LLMNR responder (Link-Local Multicast Name Resolution) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _LLMNR_RESPONDER_H 32 | #define _LLMNR_RESPONDER_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "core/udp.h" 37 | #include "dns/dns_common.h" 38 | #include "llmnr/llmnr_common.h" 39 | 40 | //LLMNR responder support 41 | #ifndef LLMNR_RESPONDER_SUPPORT 42 | #define LLMNR_RESPONDER_SUPPORT DISABLED 43 | #elif (LLMNR_RESPONDER_SUPPORT != ENABLED && LLMNR_RESPONDER_SUPPORT != DISABLED) 44 | #error LLMNR_RESPONDER_SUPPORT parameter is not valid 45 | #endif 46 | 47 | //C++ guard 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | //LLMNR related functions 53 | error_t llmnrResponderInit(NetInterface *interface); 54 | 55 | void llmnrProcessQuery(NetInterface *interface, 56 | const IpPseudoHeader *pseudoHeader, const UdpHeader *udpHeader, 57 | const NetBuffer *buffer, size_t offset, const NetRxAncillary *ancillary, 58 | void *param); 59 | 60 | error_t llmnrSendResponse(NetInterface *interface, const IpAddr *destIpAddr, 61 | uint16_t destPort, uint16_t id, uint16_t qtype, uint16_t qclass); 62 | 63 | error_t llmnrFormatIpv4AddrRecord(NetInterface *interface, 64 | LlmnrHeader *message, size_t *length, Ipv4Addr ipv4Addr); 65 | 66 | error_t llmnrFormatIpv6AddrRecord(NetInterface *interface, 67 | LlmnrHeader *message, size_t *length, const Ipv6Addr *ipv6Addr); 68 | 69 | //C++ guard 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /http/http_client_misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file http_client_misc.h 3 | * @brief Helper functions for HTTP client 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _HTTP_CLIENT_MISC_H 32 | #define _HTTP_CLIENT_MISC_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "http/http_client.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //HTTP client related functions 44 | void httpClientChangeState(HttpClientContext *context, 45 | HttpClientState newState); 46 | 47 | void httpClientChangeRequestState(HttpClientContext *context, 48 | HttpRequestState newState); 49 | 50 | error_t httpClientFormatRequestHeader(HttpClientContext *context); 51 | 52 | error_t httpClientFormatChunkSize(HttpClientContext *context, size_t length); 53 | 54 | error_t httpClientParseStatusLine(HttpClientContext *context, char_t *line, 55 | size_t length); 56 | 57 | error_t httpClientParseHeaderField(HttpClientContext *context, char_t *line, 58 | size_t length); 59 | 60 | error_t httpClientParseConnectionField(HttpClientContext *context, 61 | const char_t *value); 62 | 63 | error_t httpClientParseTransferEncodingField(HttpClientContext *context, 64 | const char_t *value); 65 | 66 | error_t httpClientParseContentLengthField(HttpClientContext *context, 67 | const char_t *value); 68 | 69 | error_t httpClientParseChunkSize(HttpClientContext *context, char_t *line, 70 | size_t length); 71 | 72 | error_t httpClientCheckTimeout(HttpClientContext *context); 73 | 74 | //C++ guard 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /drivers/wifi/winc1500_driver.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file winc1500_driver.h 3 | * @brief WINC1500 Wi-Fi controller 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _WINC1500_DRIVER_H 32 | #define _WINC1500_DRIVER_H 33 | 34 | //Dependencies 35 | #include "core/nic.h" 36 | 37 | //TX buffer size 38 | #ifndef WINC1500_TX_BUFFER_SIZE 39 | #define WINC1500_TX_BUFFER_SIZE 1600 40 | #elif (WINC1500_TX_BUFFER_SIZE != 1600) 41 | #error WINC1500_TX_BUFFER_SIZE parameter is not valid 42 | #endif 43 | 44 | //RX buffer size 45 | #ifndef WINC1500_RX_BUFFER_SIZE 46 | #define WINC1500_RX_BUFFER_SIZE 1600 47 | #elif (WINC1500_RX_BUFFER_SIZE != 1600) 48 | #error WINC1500_RX_BUFFER_SIZE parameter is not valid 49 | #endif 50 | 51 | //C++ guard 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | //WINC1500 driver 57 | extern const NicDriver winc1500Driver; 58 | 59 | //WINC1500 related functions 60 | error_t winc1500Init(NetInterface *interface); 61 | 62 | void winc1500Tick(NetInterface *interface); 63 | 64 | void winc1500EnableIrq(NetInterface *interface); 65 | void winc1500DisableIrq(NetInterface *interface); 66 | bool_t winc1500IrqHandler(void); 67 | void winc1500EventHandler(NetInterface *interface); 68 | 69 | error_t winc1500SendPacket(NetInterface *interface, 70 | const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary); 71 | 72 | error_t winc1500UpdateMacAddrFilter(NetInterface *interface); 73 | 74 | void winc1500AppWifiEvent(uint8_t msgType, void *msg); 75 | void winc1500AppEthEvent(uint8_t msgType, void *msg, void *ctrlBuf); 76 | 77 | //C++ guard 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /drivers/wifi/winc3400_driver.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file winc3400_driver.h 3 | * @brief WINC3400 Wi-Fi controller 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _WINC3400_DRIVER_H 32 | #define _WINC3400_DRIVER_H 33 | 34 | //Dependencies 35 | #include "core/nic.h" 36 | 37 | //TX buffer size 38 | #ifndef WINC3400_TX_BUFFER_SIZE 39 | #define WINC3400_TX_BUFFER_SIZE 1600 40 | #elif (WINC3400_TX_BUFFER_SIZE != 1600) 41 | #error WINC3400_TX_BUFFER_SIZE parameter is not valid 42 | #endif 43 | 44 | //RX buffer size 45 | #ifndef WINC3400_RX_BUFFER_SIZE 46 | #define WINC3400_RX_BUFFER_SIZE 1600 47 | #elif (WINC3400_RX_BUFFER_SIZE != 1600) 48 | #error WINC3400_RX_BUFFER_SIZE parameter is not valid 49 | #endif 50 | 51 | //C++ guard 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | //WINC3400 driver 57 | extern const NicDriver winc3400Driver; 58 | 59 | //WINC3400 related functions 60 | error_t winc3400Init(NetInterface *interface); 61 | 62 | void winc3400Tick(NetInterface *interface); 63 | 64 | void winc3400EnableIrq(NetInterface *interface); 65 | void winc3400DisableIrq(NetInterface *interface); 66 | bool_t winc3400IrqHandler(void); 67 | void winc3400EventHandler(NetInterface *interface); 68 | 69 | error_t winc3400SendPacket(NetInterface *interface, 70 | const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary); 71 | 72 | error_t winc3400UpdateMacAddrFilter(NetInterface *interface); 73 | 74 | void winc3400AppWifiEvent(uint8_t msgType, void *msg); 75 | void winc3400AppEthEvent(uint8_t msgType, void *msg, void *ctrlBuf); 76 | 77 | //C++ guard 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /drivers/usb_rndis/usbd_rndis.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file usbd_rndis.h 3 | * @brief USB RNDIS class 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _USB_RNDIS_H 32 | #define _USB_RNDIS_H 33 | 34 | //Dependencies 35 | #include "usbd_ioreq.h" 36 | 37 | //USB endpoints 38 | #define RNDIS_NOTIFICATION_EP 0x81 39 | #define RNDIS_DATA_IN_EP 0x82 40 | #define RNDIS_DATA_OUT_EP 0x03 41 | 42 | //Endpoint maximum packet size 43 | #define RNDIS_NOTIFICATION_EP_MPS 64 44 | #define RNDIS_DATA_IN_EP_MPS_FS 64 45 | #define RNDIS_DATA_OUT_EP_MPS_FS 64 46 | #define RNDIS_DATA_IN_EP_MPS_HS 512 47 | #define RNDIS_DATA_OUT_EP_MPS_HS 512 48 | 49 | //RNDIS Class specific requests 50 | #define RNDIS_SEND_ENCAPSULATED_COMMAND 0x00 51 | #define RNDIS_GET_ENCAPSULATED_RESPONSE 0x01 52 | 53 | //Global variables 54 | extern USBD_HandleTypeDef USBD_Device; 55 | extern USBD_ClassTypeDef usbdRndisClass; 56 | #define USBD_RNDIS_CLASS &usbdRndisClass 57 | 58 | //RNDIS related functions 59 | uint8_t usbdRndisInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx); 60 | uint8_t usbdRndisDeInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx); 61 | uint8_t usbdRndisSetup(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 62 | uint8_t usbdRndisEp0RxReady(USBD_HandleTypeDef *pdev); 63 | uint8_t usbdRndisDataIn(USBD_HandleTypeDef *pdev, uint8_t epnum); 64 | uint8_t usbdRndisDataOut(USBD_HandleTypeDef *pdev, uint8_t epnum); 65 | uint8_t *usbdRndisGetHighSpeedConfigDesc(uint16_t *length); 66 | uint8_t *usbdRndisGetFullSpeedConfigDesc(uint16_t *length); 67 | uint8_t *usbdRndisGetOtherSpeedConfigDesc(uint16_t *length); 68 | uint8_t *usbdRndisGetDeviceQualifierDesc(uint16_t *length); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /mibs/mib2_impl_sys.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mib2_impl_sys.h 3 | * @brief MIB-II module implementation (System group) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _MIB2_IMPL_SYS_H 32 | #define _MIB2_IMPL_SYS_H 33 | 34 | //Dependencies 35 | #include "core/net.h" 36 | #include "mibs/mib2_module.h" 37 | 38 | //C++ guard 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | //MIB-II related functions 44 | error_t mib2GetSysObjectID(const MibObject *object, const uint8_t *oid, 45 | size_t oidLen, MibVariant *value, size_t *valueLen); 46 | 47 | error_t mib2GetSysUpTime(const MibObject *object, const uint8_t *oid, 48 | size_t oidLen, MibVariant *value, size_t *valueLen); 49 | 50 | error_t mib2SetSysContact(const MibObject *object, const uint8_t *oid, 51 | size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit); 52 | 53 | error_t mib2GetSysContact(const MibObject *object, const uint8_t *oid, 54 | size_t oidLen, MibVariant *value, size_t *valueLen); 55 | 56 | error_t mib2SetSysName(const MibObject *object, const uint8_t *oid, 57 | size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit); 58 | 59 | error_t mib2GetSysName(const MibObject *object, const uint8_t *oid, 60 | size_t oidLen, MibVariant *value, size_t *valueLen); 61 | 62 | error_t mib2SetSysLocation(const MibObject *object, const uint8_t *oid, 63 | size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit); 64 | 65 | error_t mib2GetSysLocation(const MibObject *object, const uint8_t *oid, 66 | size_t oidLen, MibVariant *value, size_t *valueLen); 67 | 68 | //C++ guard 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /ppp/ppp_hdlc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ppp_hdlc.h 3 | * @brief PPP HDLC driver 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _PPP_HDLC_H 32 | #define _PPP_HDLC_H 33 | 34 | //Dependencies 35 | #include "core/nic.h" 36 | 37 | //C++ guard 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | //PPP HDLC driver 43 | extern const NicDriver pppHdlcDriver; 44 | 45 | //PPP HDLC driver related functions 46 | error_t pppHdlcDriverInit(NetInterface *interface); 47 | 48 | void pppHdlcDriverTick(NetInterface *interface); 49 | 50 | void pppHdlcDriverEnableIrq(NetInterface *interface); 51 | void pppHdlcDriverDisableIrq(NetInterface *interface); 52 | void pppHdlcDriverEventHandler(NetInterface *interface); 53 | 54 | error_t pppHdlcDriverSendPacket(NetInterface *interface, 55 | const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary); 56 | 57 | error_t pppHdlcDriverReceivePacket(NetInterface *interface); 58 | 59 | error_t pppHdlcDriverUpdateMacAddrFilter(NetInterface *interface); 60 | 61 | error_t pppHdlcDriverSendAtCommand(NetInterface *interface, const char_t *data); 62 | 63 | error_t pppHdlcDriverReceiveAtCommand(NetInterface *interface, char_t *data, 64 | size_t size); 65 | 66 | error_t pppHdlcDriverPurgeTxBuffer(PppContext *context); 67 | error_t pppHdlcDriverPurgeRxBuffer(PppContext *context); 68 | 69 | void pppHdlcDriverWriteTxQueue(PppContext *context, uint8_t c); 70 | uint8_t pppHdlcDriverReadRxQueue(PppContext *context); 71 | 72 | bool_t pppHdlcDriverReadTxQueue(NetInterface *interface, int_t *c); 73 | bool_t pppHdlcDriverWriteRxQueue(NetInterface *interface, uint8_t c); 74 | 75 | //C++ guard 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /mibs/snmp_community_mib_module.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file snmp_community_mib_module.h 3 | * @brief SNMP COMMUNITY MIB module 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @section Description 28 | * 29 | * The SNMP-MIB describes managed objects which describe the behavior 30 | * of an SNMP entity. Refer to RFC 3418 for more details 31 | * 32 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 33 | * @version 2.5.4 34 | **/ 35 | 36 | #ifndef _SNMP_COMMUNITY_MIB_MODULE_H 37 | #define _SNMP_COMMUNITY_MIB_MODULE_H 38 | 39 | //Dependencies 40 | #include "mibs/mib_common.h" 41 | #include "snmp/snmp_agent.h" 42 | 43 | //SNMP COMMUNITY MIB module support 44 | #ifndef SNMP_COMMUNITY_MIB_SUPPORT 45 | #define SNMP_COMMUNITY_MIB_SUPPORT DISABLED 46 | #elif (SNMP_COMMUNITY_MIB_SUPPORT != ENABLED && SNMP_COMMUNITY_MIB_SUPPORT != DISABLED) 47 | #error SNMP_COMMUNITY_MIB_SUPPORT parameter is not valid 48 | #endif 49 | 50 | //Support for SET operations 51 | #ifndef SNMP_COMMUNITY_MIB_SET_SUPPORT 52 | #define SNMP_COMMUNITY_MIB_SET_SUPPORT DISABLED 53 | #elif (SNMP_COMMUNITY_MIB_SET_SUPPORT != ENABLED && SNMP_COMMUNITY_MIB_SET_SUPPORT != DISABLED) 54 | #error SNMP_COMMUNITY_MIB_SET_SUPPORT parameter is not valid 55 | #endif 56 | 57 | //C++ guard 58 | #ifdef __cplusplus 59 | extern "C" { 60 | #endif 61 | 62 | 63 | /** 64 | * @brief SNMP COMMUNITY MIB base 65 | **/ 66 | 67 | typedef struct 68 | { 69 | SnmpAgentContext *context; 70 | SnmpUserEntry tempCommunity; 71 | } SnmpCommunityMibBase; 72 | 73 | 74 | //SNMP COMMUNITY MIB related constants 75 | extern SnmpCommunityMibBase snmpCommunityMibBase; 76 | extern const MibObject snmpCommunityMibObjects[]; 77 | extern const MibModule snmpCommunityMibModule; 78 | 79 | //C++ guard 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /drivers/usb_rndis/rndis_debug.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file rndis_debug.h 3 | * @brief RNDIS (Remote Network Driver Interface Specification) 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _RNDIS_DEBUG_H 32 | #define _RNDIS_DEBUG_H 33 | 34 | //Dependencies 35 | #include "rndis.h" 36 | 37 | 38 | /** 39 | * @brief Value/name pair 40 | **/ 41 | 42 | typedef struct 43 | { 44 | uint32_t value; 45 | const char_t *name; 46 | } RndisValueName; 47 | 48 | 49 | //RNDIS related functions 50 | error_t rndisDumpMsg(const RndisMsg *message, size_t length); 51 | error_t rndisDumpPacketMsg(const RndisPacketMsg *message, size_t length); 52 | error_t rndisDumpInitializeMsg(const RndisInitializeMsg *message, size_t length); 53 | error_t rndisDumpHaltMsg(const RndisHaltMsg *message, size_t length); 54 | error_t rndisDumpQueryMsg(const RndisQueryMsg *message, size_t length); 55 | error_t rndisDumpSetMsg(const RndisSetMsg *message, size_t length); 56 | error_t rndisDumpResetMsg(const RndisResetMsg *message, size_t length); 57 | error_t rndisDumpIndicateStatusMsg(const RndisIndicateStatusMsg *message, size_t length); 58 | error_t rndisDumpKeepAliveMsg(const RndisKeepAliveMsg *message, size_t length); 59 | 60 | error_t rndisDumpInitializeCmplt(const RndisInitializeCmplt *message, size_t length); 61 | error_t rndisDumpQueryCmplt(const RndisQueryCmplt *message, size_t length); 62 | error_t rndisDumpSetCmplt(const RndisSetCmplt *message, size_t length); 63 | error_t rndisDumpResetCmplt(const RndisResetCmplt *message, size_t length); 64 | error_t rndisDumpKeepAliveCmplt(const RndisKeepAliveCmplt *message, size_t length); 65 | 66 | const char_t *rndisFindName(uint32_t value, const RndisValueName *table, size_t size); 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /syslog/syslog_client_misc.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file syslog_client_misc.c 3 | * @brief Helper functions for Syslog client 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | //Switch to the appropriate trace level 32 | #define TRACE_LEVEL SYSLOG_TRACE_LEVEL 33 | 34 | //Dependencies 35 | #include "syslog/syslog_client.h" 36 | #include "syslog/syslog_client_misc.h" 37 | #include "debug.h" 38 | 39 | //Check TCP/IP stack configuration 40 | #if (SYSLOG_CLIENT_SUPPORT == ENABLED) 41 | 42 | 43 | /** 44 | * @brief Format timestamp 45 | * @param[in] time Unix timestamp 46 | * @param[out] buffer Buffer where to store the formatted string 47 | * @return Length of the formatted string 48 | **/ 49 | 50 | size_t syslogClientFormatTimestamp(time_t time, char_t *buffer) 51 | { 52 | size_t n; 53 | DateTime dateTime; 54 | 55 | //Abbreviated months 56 | static const char_t months[13][4] = 57 | { 58 | " ", 59 | "Jan", 60 | "Feb", 61 | "Mar", 62 | "Apr", 63 | "May", 64 | "Jun", 65 | "Jul", 66 | "Aug", 67 | "Sep", 68 | "Oct", 69 | "Nov", 70 | "Dec" 71 | }; 72 | 73 | //Convert Unix timestamp to date 74 | convertUnixTimeToDate(time, &dateTime); 75 | 76 | //The format of the timestamp field is Mmm dd hh:mm:ss. If the day of the 77 | //month is less than 10, then it must be represented as a space and then the 78 | //number (refer to RFC 3164, section 4.1.2) 79 | n = osSprintf(buffer, "%s %2" PRIu8 " %02" PRIu8 ":%02" PRIu8 ":%02" PRIu8, 80 | months[dateTime.month], dateTime.day, dateTime.hours, dateTime.minutes, 81 | dateTime.seconds); 82 | 83 | //Return the length of the formatted string 84 | return n; 85 | } 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /drivers/pcap/pcap_driver.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file pcap_driver.h 3 | * @brief PCAP driver 4 | * 5 | * @section License 6 | * 7 | * SPDX-License-Identifier: GPL-2.0-or-later 8 | * 9 | * Copyright (C) 2010-2025 Oryx Embedded SARL. All rights reserved. 10 | * 11 | * This file is part of CycloneTCP Open. 12 | * 13 | * This program is free software; you can redistribute it and/or 14 | * modify it under the terms of the GNU General Public License 15 | * as published by the Free Software Foundation; either version 2 16 | * of the License, or (at your option) any later version. 17 | * 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program; if not, write to the Free Software Foundation, 25 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | * 27 | * @author Oryx Embedded SARL (www.oryx-embedded.com) 28 | * @version 2.5.4 29 | **/ 30 | 31 | #ifndef _PCAP_DRIVER_H 32 | #define _PCAP_DRIVER_H 33 | 34 | //Dependencies 35 | #include "core/nic.h" 36 | 37 | //Maximum packet size 38 | #ifndef PCAP_DRIVER_MAX_PACKET_SIZE 39 | #define PCAP_DRIVER_MAX_PACKET_SIZE 1536 40 | #elif (PCAP_DRIVER_MAX_PACKET_SIZE < 1) 41 | #error PCAP_DRIVER_MAX_PACKET_SIZE parameter is not valid 42 | #endif 43 | 44 | //Maximum number of packets in the receive queue 45 | #ifndef PCAP_DRIVER_QUEUE_SIZE 46 | #define PCAP_DRIVER_QUEUE_SIZE 64 47 | #elif (PCAP_DRIVER_QUEUE_SIZE < 1) 48 | #error PCAP_DRIVER_QUEUE_SIZE parameter is not valid 49 | #endif 50 | 51 | //Receive timeout in milliseconds 52 | #ifndef PCAP_DRIVER_TIMEOUT 53 | #define PCAP_DRIVER_TIMEOUT 1 54 | #elif (PCAP_DRIVER_TIMEOUT < 1) 55 | #error PCAP_DRIVER_TIMEOUT parameter is not valid 56 | #endif 57 | 58 | //C++ guard 59 | #ifdef __cplusplus 60 | extern "C" { 61 | #endif 62 | 63 | //PCAP driver 64 | extern const NicDriver pcapDriver; 65 | 66 | //PCAP related functions 67 | error_t pcapDriverInit(NetInterface *interface); 68 | 69 | void pcapDriverTick(NetInterface *interface); 70 | 71 | void pcapDriverEnableIrq(NetInterface *interface); 72 | void pcapDriverDisableIrq(NetInterface *interface); 73 | 74 | void pcapDriverEventHandler(NetInterface *interface); 75 | 76 | error_t pcapDriverSendPacket(NetInterface *interface, 77 | const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary); 78 | 79 | error_t pcapDriverUpdateMacAddrFilter(NetInterface *interface); 80 | 81 | void pcapDriverTask(NetInterface *interface); 82 | 83 | //C++ guard 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | 88 | #endif 89 | --------------------------------------------------------------------------------