OpENer - Open Source EtherNet/IP(TM) I/O Target Stack
2.1
|
Responsible for Endianess conversion. More...
#include "typedefs.h"
Go to the source code of this file.
Enumerations | |
enum | OpenerEndianess { kOpenerEndianessUnknown = -1, kOpENerEndianessLittle = 0, kOpENerEndianessBig = 1 } |
Functions | |
int | AddDintToMessage (const EipUint32 data, EipUint8 **const buffer) |
Write an 32Bit integer to the network buffer. More... | |
int | AddIntToMessage (const EipUint16 data, EipUint8 **const buffer) |
Write an 16Bit integer to the network buffer. More... | |
int | AddSintToMessage (const EipUint8 data, EipUint8 **const buffer) |
converts UINT8 data from host to little endian an writes it to buffer. More... | |
void | DetermineEndianess (void) |
Detects Endianess of the platform and sets global g_nOpENerPlatformEndianess variable accordingly. More... | |
int | EncapsulateIpAddress (EipUint16 port, EipUint32 address, EipByte **communication_buffer) |
Encapsulate the sockaddr information as necessary for the Common Packet Format data items. More... | |
int | FillNextNMessageOctetsWith (CipOctet value, unsigned int n, CipOctet **message) |
int | FillNextNMessageOctetsWithValueAndMoveToNextPosition (CipOctet value, unsigned int n, CipOctet **message) |
CipByte | GetByteFromMessage (const CipOctet **const buffer_address) |
EipUint32 | GetDintFromMessage (const EipUint8 **const buffer) |
Get an 32Bit integer from the network buffer. More... | |
int | GetEndianess (void) |
Return the endianess identified on system startup. More... | |
EipUint16 | GetIntFromMessage (const EipUint8 **const buffer) |
Get an 16Bit integer from the network buffer, and moves pointer beyond the 16 bit value. More... | |
EipUint8 | GetSintFromMessage (const EipUint8 **const buffer) |
Reads EIP_UINT8 from *buffer and converts little endian to host. More... | |
CipUdint | GetUdintFromMessage (const CipOctet **const buffer_address) |
CipUint | GetUintFromMessage (const CipOctet **const buffer_address) |
CipUsint | GetUsintFromMessage (const CipOctet **const buffer_address) |
CipWord | GetWordFromMessage (const CipOctet **const buffer_address) |
int | MoveMessageNOctets (const int n, const CipOctet **message_runner) |
Responsible for Endianess conversion.
Definition in file endianconv.h.
enum OpenerEndianess |
Enumerator | |
---|---|
kOpenerEndianessUnknown | |
kOpENerEndianessLittle | |
kOpENerEndianessBig |
Definition at line 15 of file endianconv.h.
void DetermineEndianess | ( | void | ) |
Detects Endianess of the platform and sets global g_nOpENerPlatformEndianess variable accordingly.
Identify if we are running on a big or little endian system and set variable.
Detects Endianess of the platform and sets global variable g_nOpENerPlatformEndianess accordingly, whereas 0 equals little endian and 1 equals big endian
Definition at line 239 of file endianconv.c.
References g_opener_platform_endianess, kOpENerEndianessBig, and kOpENerEndianessLittle.
Referenced by EncapsulationInit().
Encapsulate the sockaddr information as necessary for the Common Packet Format data items.
Converts and adds the provided port and IP address into an common packet format message
port | Port of the socket, has to be provided in big-endian |
address | IP address of the socket, has to be provided in big-endian |
communication_buffer | The message buffer for sending the message |
Definition at line 197 of file endianconv.c.
References AddDintToMessage(), AddIntToMessage(), g_opener_platform_endianess, kOpENerEndianessBig, and kOpENerEndianessLittle.
Referenced by AssembleLinearMessage(), and EncapsulateListIdentityResponseMessage().
Definition at line 264 of file endianconv.c.
Referenced by FillNextNMessageOctetsWithValueAndMoveToNextPosition().
int FillNextNMessageOctetsWithValueAndMoveToNextPosition | ( | CipOctet | value, |
unsigned int | n, | ||
CipOctet ** | message | ||
) |
Definition at line 271 of file endianconv.c.
References FillNextNMessageOctetsWith(), and MoveMessageNOctets().
Referenced by AssembleLinearMessage().
Definition at line 36 of file endianconv.c.
int GetEndianess | ( | void | ) |
Return the endianess identified on system startup.
Return the endianess identified on system startup.
Definition at line 254 of file endianconv.c.
References g_opener_platform_endianess.
Definition at line 90 of file endianconv.c.
Definition at line 64 of file endianconv.c.
Definition at line 43 of file endianconv.c.
Definition at line 71 of file endianconv.c.
int MoveMessageNOctets | ( | const int | n, |
const CipOctet ** | message_runner | ||
) |
Definition at line 258 of file endianconv.c.
Referenced by CipEpathEncodeConnectionEpath(), CipEpathGetLogicalValue(), CipEpathSetLogicalValue(), ConnectionObjectInitializeFromMessage(), DetermineDelayTime(), EncapsulateListIdentityResponseMessage(), FillNextNMessageOctetsWithValueAndMoveToNextPosition(), GetElectronicKeyFormat4FromMessage(), and SkipEncapsulationHeader().