MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / sethtonl

Function sethtonl

GPRS/ByteVector.cpp:36–41  ·  view source on GitHub ↗

Set the char[4] array at ip to a 32-bit int value, swizzling bytes as needed for network order.

Source from the content-addressed store, hash-verified

34
35// Set the char[4] array at ip to a 32-bit int value, swizzling bytes as needed for network order.
36void sethtonl(ByteType *cp,unsigned value)
37{
38 uint32_t tmp = htonl(value);
39 ByteType *tp = (ByteType*)&tmp;
40 cp[0]=tp[0]; cp[1]=tp[1]; cp[2]=tp[2]; cp[3]=tp[3];
41}
42
43uint16_t getntohs(ByteType *cp)
44{

Callers 1

setUInt32Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected