Functions
sbgNetwork.c File Reference
#include "sbgNetwork.h"
#include <swap/sbgSwap.h>
Include dependency graph for sbgNetwork.c:

Go to the source code of this file.

Functions

SBG_COMMON_LIB_API bool sbgIpNetMaskValid (sbgIpAddress netmask)
 
SBG_COMMON_LIB_API sbgIpAddress sbgNetworkIpFromString (const char *pBuffer)
 
SBG_COMMON_LIB_API void sbgNetworkIpToString (sbgIpAddress ipAddr, char *pBuffer, size_t maxSize)
 

Function Documentation

◆ sbgIpNetMaskValid()

SBG_COMMON_LIB_API bool sbgIpNetMaskValid ( sbgIpAddress  netmask)

Check if an IpV4 netmask is valid, the mask should be contiguous (1111 followed by 0)

Parameters
[in]netmaskThe netmask stored in an uint32_t (host endianness).
Returns
true if the netmask is valid ie contiguous.

Definition at line 81 of file sbgNetwork.c.

◆ sbgNetworkIpFromString()

SBG_COMMON_LIB_API sbgIpAddress sbgNetworkIpFromString ( const char *  pBuffer)

Convert an ip address stored in a string of the form A.B.C.D to an sbgIpAddress object.

Parameters
[in]pBufferIP address as a string of the form A.B.C.D
Returns
IP address parsed from the string or 0.0.0.0 if the IP is invalid.

Definition at line 35 of file sbgNetwork.c.

◆ sbgNetworkIpToString()

SBG_COMMON_LIB_API void sbgNetworkIpToString ( sbgIpAddress  ipAddr,
char *  pBuffer,
size_t  maxSize 
)

Convert an ip to a string of the form A.B.C.D

Parameters
[in]ipAddrIP address to convert to a string.
[out]pBufferPointer on an allocated buffer than can hold ip address as a string.
[in]maxSizeMaximum number of chars that can be stored in pBuffer including the NULL char.

Definition at line 14 of file sbgNetwork.c.



sbg_driver
Author(s): SBG Systems
autogenerated on Sat Sep 3 2022 02:53:36