Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

96 lignes
3.0 KiB

  1. /*******************************************************************************
  2. Company:
  3. Microchip Technology Inc.
  4. File Name:
  5. netinet_in.h
  6. Summary:
  7. Description:
  8. *******************************************************************************/
  9. // DOM-IGNORE-BEGIN
  10. /*******************************************************************************
  11. * Copyright (C) 2021 Microchip Technology Inc. and its subsidiaries.
  12. *
  13. * Subject to your compliance with these terms, you may use Microchip software
  14. * and any derivatives exclusively with Microchip products. It is your
  15. * responsibility to comply with third party license terms applicable to your
  16. * use of third party software (including open source software) that may
  17. * accompany Microchip software.
  18. *
  19. * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
  20. * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
  21. * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
  22. * PARTICULAR PURPOSE.
  23. *
  24. * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
  25. * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
  26. * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
  27. * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
  28. * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
  29. * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
  30. * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
  31. *******************************************************************************/
  32. // DOM-IGNORE-END
  33. #ifndef _NETINET_IN_H
  34. #define _NETINET_IN_H
  35. #include <stdint.h>
  36. #include <sys/types.h>
  37. // DOM-IGNORE-BEGIN
  38. #ifdef __cplusplus // Provide C++ Compatibility
  39. extern "C" {
  40. #endif
  41. // DOM-IGNORE-END
  42. typedef uint32_t in_addr_t;
  43. struct in_addr {
  44. /*!<
  45. Network Byte Order representation of the IPv4 address. For example,
  46. the address "192.168.0.10" is represented as 0x0A00A8C0.
  47. */
  48. in_addr_t s_addr;
  49. };
  50. struct sockaddr_in{
  51. uint16_t sin_family;
  52. /*!<
  53. Specifies the address family(AF).
  54. Members of AF_INET address family are IPv4 addresses.
  55. Hence,the only supported value for this is AF_INET.
  56. */
  57. uint16_t sin_port;
  58. /*!<
  59. Port number of the socket.
  60. Network sockets are identified by a pair of IP addresses and port number.
  61. Must be set in the Network Byte Order format , @ref _htons (e.g. _htons(80)).
  62. Can NOT have zero value.
  63. */
  64. struct in_addr sin_addr;
  65. /*!<
  66. IP Address of the socket.
  67. The IP address is of type @ref in_addr structure.
  68. Can be set to "0" to accept any IP address for server operation.
  69. */
  70. uint8_t sin_zero[8];
  71. /*!<
  72. Padding to make structure the same size as @ref sockaddr.
  73. */
  74. };
  75. const char *inet_ntop(int af, const void *src, char *dst, size_t size);
  76. in_addr_t inet_addr(const char *cp);
  77. // DOM-IGNORE-BEGIN
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81. // DOM-IGNORE-END
  82. #endif /* _NETINET_IN_H */