CITS3002 Computer Networks  
prev
next CITS3002 help3002 CITS3002 schedule  

Accessing Protocol and Service Information

There is a significant amount of 'common' knowledge about protocols, services, addressing and hosts available in many files.

Fortunately, most of this is accessible through support libraries, often provided as part of an Application Programming Interface (API).

Because, most of this information itself will be frequently requested by applications (and WWW applications here are not helping), the information is often provided by network servers.

Examples include mappings between:

  • protocol names and protocol numbers - see getprotoent().
  • host names, host addresses and host aliases - see gethostent().
  • service names and service ports - see getservent().

Because most of these functions cache their information, most return pointers to static information that must be copied by the application.

The growth of multi-threaded applications is driving the need for re-entrant versions of these functions, in which the caller provides an address into which the result is copied.


CITS3002 Computer Networks, Lecture 9, Client/server design, p13, 1st May 2024.