_getshort Subroutine

Purpose

Retrieves short byte quantities.

Library

Standard C Library (libc.a)

Syntax

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

unsigned short getshort ( MessagePtr)
u_char *MessagePtr;

Description

The _getshort subroutine gets quantities from the byte stream or arbitrary byte boundaries.

The _getshort subroutine is one of a set of subroutines that form the resolver, a set of functions that resolve domain names. Global information used by the resolver subroutines is kept in the _res data structure. The /usr/include/resolv.h file contains the _res structure definition.

All applications containing the _getshort subroutine must be compiled with the _BSD macro set to a specific value. Acceptable values are 43 and 44. In addition, all socket applications must include the BSD libbsd.a library.

Parameters

Item Description
MessagePtr Specifies a pointer into the byte stream.

Return Values

The _getshort subroutine returns an unsigned short (16-bit) value.

Files

Item Description
/etc/resolv.conf                      Defines name server and domain names.