home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / languages / netlib / !NetLib / arpa / h / inet next >
Encoding:
Text File  |  1995-05-23  |  2.3 KB  |  74 lines

  1. /*
  2.  * Copyright (c) 1983 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that: (1) source distributions retain this entire copyright
  7.  * notice and comment, and (2) distributions including binaries display
  8.  * the following acknowledgement:  ``This product includes software
  9.  * developed by the University of California, Berkeley and its contributors''
  10.  * in the documentation or other materials provided with the distribution
  11.  * and in all advertising materials mentioning features or use of this
  12.  * software. Neither the name of the University nor the names of its
  13.  * contributors may be used to endorse or promote products derived
  14.  * from this software without specific prior written permission.
  15.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  16.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  17.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  *
  19.  *    @(#)inet.h    5.4 (Berkeley) 6/1/90
  20.  */
  21.  
  22. #ifndef __arpa_inet_h
  23. #define __arpa_inet_h
  24.  
  25. /* Freenet programmers interface - arpa/inet.h - edited by andy 23/5/95 */
  26.  
  27. #include "netinet/in.h"
  28. #include "sys/types.h"
  29.  
  30. /*
  31.  * Check whether "cp" is a valid ascii representation
  32.  * of an Internet address and convert to a binary address.
  33.  * Returns 1 if the address is valid, 0 if not.
  34.  * This replaces inet_addr, the return value from which
  35.  * cannot distinguish between failure and a local broadcast address.
  36.  */
  37.  
  38. extern u_long inet_aton(const char * /*cp*/, struct in_addr * /*addr*/);
  39.  
  40. /*
  41.  * Convert string containing 'dotted' address into numeric
  42.  * internet address
  43.  */
  44. extern u_long inet_addr(const char */*cp*/);
  45.  
  46. /*
  47.  * Convert string containing 'dotted' address into numeric
  48.  * internet network number
  49.  */
  50. extern u_long inet_network(const char */*cp*/);
  51.  
  52. /*
  53.  * Forms an internet address from a network number and a
  54.  * local network address
  55.  */
  56. extern struct in_addr inet_makeaddr(u_long /*net*/,u_long /*lna*/);
  57.  
  58. /*
  59.  * Extract the local network address from an internet address
  60.  */
  61. extern u_long inet_lnaof(struct in_addr /*in*/);
  62.  
  63. /*
  64.  * Extract the network number from an internet address
  65.  */
  66. extern u_long inet_netof(struct in_addr /*in*/);
  67.  
  68. /*
  69.  * Format an internet address in string form
  70.  */
  71. extern char *inet_ntoa(struct in_addr /*in*/);
  72.  
  73. #endif
  74.