Innomatix Support / InnomatixSupport
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers NBO.h Source File

NBO.h

00001 /*******************************************************************
00002  *
00003  *  File: NBO.h
00004  *
00005  *  Description: Library to get Network to Host byte order and 
00006  *                   vice versa.
00007  *
00008  *  Copyright 2015 Innomatix, LLC., All Rights Reserved
00009  *
00010  *  THIS DOCUMENT AND ITS CONTENTS ARE INTELLECTUAL PROPERTY
00011  *  OF INNOMATIX, LLC.  ANY DUPLICATION IN PART OR WHOLE
00012  *  WITHOUT PRIOR WRITTEN CONSENT IS STRICTLY PROHIBITED.
00013  *
00014  ********************************************************************/
00015 #ifndef _NBO_H_
00016 #define _NBO_H_
00017 
00018 #include <stdint.h>
00019 
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023 
00024 
00025 /**
00026 * Function to aid the MessageBuilders and ParseHelpers Libraries. It allows user 
00027 *    to get a 32 bit number in Network Byte Order to host byte order (little endian).
00028 *   
00029 * @param network - 32 bit number in network byte order.
00030 * @retval host - the 32 bit number in host byte order.
00031 ***************************************************************************************/
00032 uint32_t ntohl( uint32_t network);
00033 
00034 /**
00035 * Function to aid the MessageBuilders and ParseHelpers Libraries. It allows user 
00036 *   to get a 32 bit number in host byte order (little endian) to network byte order.
00037 *   
00038 * @param host - 32 bit number in host byte order.
00039 * @retval network - the 32 bit number network byte order.
00040 **************************************************************************************/
00041 uint32_t htonl( uint32_t host);
00042 
00043 /**
00044 * Function to aid the MessageBuilders and ParseHelpers Libraries. It allows user 
00045 *   to get a 16 bit number host byte order (little endian) to network byte order.
00046 *   
00047 * @param host - 16 bit number in host byte order.
00048 * @retval network - the 16 bit number in network byte order.
00049 **************************************************************************************/
00050 uint16_t htons( uint16_t host);
00051 
00052 /**
00053 * Function to aid the MessageBuilders and ParseHelpers Libraries. It allows user 
00054 *    to get a 16 bit number in Network Byte Order to host byte order (little endian).
00055 *   
00056 * @param network - 16 bit number in network byte order.
00057 * @retval host - the 16 bit number in host byte order.
00058 **************************************************************************************/
00059 uint16_t ntohs( uint16_t network);
00060 
00061 
00062 #ifdef __cplusplus
00063 }
00064 #endif
00065 
00066 #endif // _NBO_H__