util.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // SPDX-License-Identifier: Apache-2.0
  2. // Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /** prevent recursive inclusion **/
  15. #ifndef __UTIL_H
  16. #define __UTIL_H
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /** Includes **/
  21. #include "common.h"
  22. /** Constants/Macros **/
  23. /** Exported Structures **/
  24. /** Exported variables **/
  25. /** Exported Functions **/
  26. stm_ret_t get_ipaddr_from_str(const char *ip_s, uint32_t *ip_x);
  27. int ipv4_addr_aton(const char *cp, uint32_t *ip_uint32);
  28. char * ipv4_addr_ntoa(const uint32_t addr, char *buf, int buflen);
  29. stm_ret_t convert_mac_to_bytes(uint8_t *out, const char *s);
  30. uint8_t is_same_buff(void *buff1, void *buff2, uint16_t len);
  31. stm_ret_t get_self_ip(int iface_type, uint32_t *self_ip);
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #endif