_getshort()--Get Short Byte Quantities


  Syntax
 #include <sys/types.h>
 #include <netinet/in.h>
 #include <arpa/nameser.h>
 #include <resolv.h>

 unsigned short
          _getshort(unsigned char *message_pointer)

  Threadsafe: Yes

The _getshort() function is used to retrieve an unsigned short byte quantity.


Authorities and Locks

None.


Parameters

message_pointer
(Input) The pointer where the short integer is to be received from.

Return Value

_getshort() returns a 16-bit integer from where message_pointer is pointing.


Usage Notes

  1. DNS packets have fields that are unsigned short integers (for example, type, class, and data length). _getshort() picks these unsigned short integers out of a DNS packet and returns them.

Related Information



API introduced: V3R1
Top | UNIX-Type APIs | APIs by category