_putshort()--Put Short Byte Quantities


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

 void  _putshort(unsigned short short_integer,
                 unsigned char  *message_pointer)

  Threadsafe: Yes

The _putshort() function is used to put an unsigned short byte quantity into a byte stream.


Authorities and Locks

None.


Parameters

unsigned short short_int
(Input) The 16-bit integer to be put into the byte stream.

unsigned char *message_pointer
(Input) The pointer to where the short_integer is to be put.

Return Value

_putshort() puts a 16-bit integer into message_pointer.


Usage Notes

DNS packets have fields that are unsigned short integers (for example, type, class, and data length). _putshort() is generally used to put these fields into a DNS packet.


Related Information



API introduced: V3R1

[ Back to top | UNIX-Type APIs | APIs by category ]