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

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

Function Documentation

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 (host endianness).
Returns
true if the netmask is valid ie contiguous.

Definition at line 81 of file sbgNetwork.c.

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.

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):
autogenerated on Sun Jan 27 2019 03:42:20