Comtrol eCos User Manual

Page 550

Advertising
background image

Chapter 38. TCP/IP Library Reference

and sa2.

RETURN VALUES

If sa1 and sa2 are for the same address, net_addrcmp() returns 0.

The sa_len fields are compared first.

If they do not match,

net_addrcmp() returns -1 or 1 if sa1->sa_len is less than or greater than

sa2->sa_len, respectively.

Next, the sa_family members are compared.

If they do not match,

net_addrcmp() returns -1 or 1 if sa1->sa_family is less than or greater

than sa2->sa_family, respectively.

Lastly, if each socket address structure’s sa_len and sa_family fields

match, the protocol-specific data (the sa_data field) is compared.

If

there’s a match, both sa1 and sa2 must refer to the same address, and 0

is returned; otherwise, a value >0 or

<

0 is returned.

HISTORY

A net_addrcmp() function was added in OpenBSD 2.5.

BSD

July 3, 1999

BSD

ns

NS(3)

System Library Functions Manual

NS(3)

NAME

ns_addr, ns_ntoa - Xerox NS(tm) address conversion routines

SYNOPSIS

#include

<

sys/types.h>

#include

<

netns/ns.h>

struct ns_addr

ns_addr(char *cp);

char *

ns_ntoa(struct ns_addr ns);

DESCRIPTION

The routine ns_addr() interprets character strings representing XNS

addresses, returning binary information suitable for use in system calls.

The routine ns_ntoa() takes XNS addresses and returns ASCII strings rep-

resenting the address in a notation in common use in the Xerox Develop-

ment Environment:

<

network number>.

<

host number>.

<

port number>

Trailing zero fields are suppressed, and each number is printed in hex-

adecimal, in a format suitable for input to ns_addr().

Any fields lack-

ing super-decimal digits will have a trailing ‘H’ appended.

446

Advertising