50 #define SBG_IPV4_UNSPECIFIED_ADDR sbgIpAddr(0, 0, 0, 0) 51 #define SBG_IPV4_BROADCAST_ADDR sbgIpAddr(255, 255, 255, 255) 53 //----------------------------------------------------------------------// 67 #if SBG_CONFIG_BIG_ENDIAN == 1 68 return (a << 24) | (b << 16) | (c << 8) | d;
70 return a | (b << 8) | (c << 16) | (d << 24);
81 #if SBG_CONFIG_BIG_ENDIAN == 1 82 return (uint8_t)((ipAddr & 0xFF000000) >> 24);
84 return (uint8_t)((ipAddr & 0x000000FF));
95 #if SBG_CONFIG_BIG_ENDIAN == 1 96 return (uint8_t)((ipAddr & 0x00FF0000) >> 16);
98 return (uint8_t)((ipAddr & 0x0000FF00) >> 8);
109 #if SBG_CONFIG_BIG_ENDIAN == 1 110 return (uint8_t)((ipAddr & 0x0000FF00) >> 8);
112 return (uint8_t)((ipAddr & 0x00FF0000) >> 16);
123 #if SBG_CONFIG_BIG_ENDIAN == 1 124 return (uint8_t)((ipAddr & 0x000000FF));
126 return (uint8_t)((ipAddr & 0xFF000000) >> 24);
161 return (ipAddress & netmask);
172 return (ipAddress & ~netmask);
252 if ((firstIpAddr & netmask) == (secondIpAddr & netmask))
SBG_COMMON_LIB_API bool sbgIpNetMaskValid(sbgIpAddress netmask)
#define SBG_COMMON_LIB_API
SBG_COMMON_LIB_API void sbgNetworkIpToString(sbgIpAddress ipAddr, char *pBuffer, size_t maxSize)
SBG_INLINE bool sbgIpAddrIsSameNetwork(sbgIpAddress firstIpAddr, sbgIpAddress secondIpAddr, sbgIpAddress netmask)
SBG_INLINE sbgIpAddress sbgIpGetHostAddr(sbgIpAddress ipAddress, sbgIpAddress netmask)
SBG_INLINE bool sbgIpAddressValid(sbgIpAddress ipAddress)
SBG_INLINE sbgIpAddress sbgIpAddrWithinSubnet(sbgIpAddress ipAddress, sbgIpAddress netmask)
SBG_INLINE bool sbgIpAddressIsUnspecified(sbgIpAddress ipAddress)
SBG_INLINE uint8_t sbgIpAddrGetC(sbgIpAddress ipAddr)
SBG_INLINE sbgIpAddress sbgIpAddr(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
Main header file for SBG Systems common C library.
SBG_INLINE uint8_t sbgIpAddrGetD(sbgIpAddress ipAddr)
SBG_INLINE sbgIpAddress sbgIpGetNetworkAddr(sbgIpAddress ipAddress, sbgIpAddress netmask)
SBG_COMMON_LIB_API sbgIpAddress sbgNetworkIpFromString(const char *pBuffer)
SBG_INLINE uint8_t sbgIpAddrGetA(sbgIpAddress ipAddr)
SBG_INLINE uint8_t sbgIpAddrGetB(sbgIpAddress ipAddr)