net_db.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. /* "net_db.c" network database support
  2. * Copyright (C) 1995, 96, 97, 98, 99, 2000, 2002 Free Software Foundation, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2, or (at your option)
  7. * any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this software; see the file COPYING. If not, write to
  16. * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  17. * Boston, MA 02111-1307 USA
  18. *
  19. * As a special exception, the Free Software Foundation gives permission
  20. * for additional uses of the text contained in its release of GUILE.
  21. *
  22. * The exception is that, if you link the GUILE library with other files
  23. * to produce an executable, this does not by itself cause the
  24. * resulting executable to be covered by the GNU General Public License.
  25. * Your use of that executable is in no way restricted on account of
  26. * linking the GUILE library code into it.
  27. *
  28. * This exception does not however invalidate any other reasons why
  29. * the executable file might be covered by the GNU General Public License.
  30. *
  31. * This exception applies only to the code released by the
  32. * Free Software Foundation under the name GUILE. If you copy
  33. * code from other Free Software Foundation releases into a copy of
  34. * GUILE, as the General Public License permits, the exception does
  35. * not apply to the code that you add in this way. To avoid misleading
  36. * anyone as to the status of such modified files, you must delete
  37. * this exception notice from them.
  38. *
  39. * If you write modifications of your own for GUILE, it is your choice
  40. * whether to permit this exception to apply to your modifications.
  41. * If you do not wish that, delete this exception notice. */
  42. /* Written in 1994 by Aubrey Jaffer.
  43. * Thanks to Hallvard.Tretteberg@si.sintef.no for inspiration and discussion.
  44. * Rewritten by Gary Houston to be a closer interface to the C socket library.
  45. * Split into net_db.c and socket.c.
  46. */
  47. #include <stdio.h>
  48. #include "libguile/_scm.h"
  49. #include "libguile/feature.h"
  50. #include "libguile/strings.h"
  51. #include "libguile/vectors.h"
  52. #include "libguile/validate.h"
  53. #include "libguile/net_db.h"
  54. #ifdef HAVE_STRING_H
  55. #include <string.h>
  56. #endif
  57. #include <sys/types.h>
  58. #include <sys/socket.h>
  59. #include <netdb.h>
  60. #include <netinet/in.h>
  61. #include <arpa/inet.h>
  62. /* Some systems do not declare this. Some systems do declare it, as a
  63. macro. */
  64. #ifndef h_errno
  65. extern int h_errno;
  66. #endif
  67. #ifndef STDC_HEADERS
  68. int close ();
  69. #endif /* STDC_HEADERS */
  70. #ifndef HAVE_INET_ATON
  71. /* for our definition in inet_aton.c, not usually needed. */
  72. extern int inet_aton ();
  73. #endif
  74. SCM_DEFINE (scm_inet_aton, "inet-aton", 1, 0, 0,
  75. (SCM address),
  76. "Converts a string containing an Internet host address in the traditional\n"
  77. "dotted decimal notation into an integer.\n\n"
  78. "@smalllisp\n"
  79. "(inet-aton \"127.0.0.1\") @result{} 2130706433\n\n"
  80. "@end smalllisp")
  81. #define FUNC_NAME s_scm_inet_aton
  82. {
  83. struct in_addr soka;
  84. SCM_VALIDATE_ROSTRING (1,address);
  85. if (SCM_SUBSTRP (address))
  86. address = scm_makfromstr (SCM_ROCHARS (address), SCM_ROLENGTH (address), 0);
  87. if (inet_aton (SCM_ROCHARS (address), &soka) == 0)
  88. SCM_MISC_ERROR ("bad address", SCM_EOL);
  89. return scm_ulong2num (ntohl (soka.s_addr));
  90. }
  91. #undef FUNC_NAME
  92. SCM_DEFINE (scm_inet_ntoa, "inet-ntoa", 1, 0, 0,
  93. (SCM inetid),
  94. "Converts an integer Internet host address into a string with the\n"
  95. "traditional dotted decimal representation.\n\n"
  96. "@smalllisp\n"
  97. "(inet-ntoa 2130706433) @result{} \"127.0.0.1\""
  98. "@end smalllisp")
  99. #define FUNC_NAME s_scm_inet_ntoa
  100. {
  101. struct in_addr addr;
  102. char *s;
  103. SCM answer;
  104. addr.s_addr = htonl (SCM_NUM2ULONG (1,inetid));
  105. s = inet_ntoa (addr);
  106. answer = scm_makfromstr (s, strlen (s), 0);
  107. return answer;
  108. }
  109. #undef FUNC_NAME
  110. #ifdef HAVE_INET_NETOF
  111. SCM_DEFINE (scm_inet_netof, "inet-netof", 1, 0, 0,
  112. (SCM address),
  113. "Returns the network number part of the given integer Internet address.\n\n"
  114. "@smalllisp\n"
  115. "(inet-netof 2130706433) @result{} 127\n"
  116. "@end smalllisp")
  117. #define FUNC_NAME s_scm_inet_netof
  118. {
  119. struct in_addr addr;
  120. addr.s_addr = htonl (SCM_NUM2ULONG (1,address));
  121. return scm_ulong2num ((unsigned long) inet_netof (addr));
  122. }
  123. #undef FUNC_NAME
  124. #endif
  125. #ifdef HAVE_INET_LNAOF
  126. SCM_DEFINE (scm_lnaof, "inet-lnaof", 1, 0, 0,
  127. (SCM address),
  128. "Returns the local-address-with-network part of the given Internet\n"
  129. "address.\n\n"
  130. "@smalllisp\n"
  131. "(inet-lnaof 2130706433) @result{} 1\n"
  132. "@end smalllisp")
  133. #define FUNC_NAME s_scm_lnaof
  134. {
  135. struct in_addr addr;
  136. addr.s_addr = htonl (SCM_NUM2ULONG (1,address));
  137. return scm_ulong2num ((unsigned long) inet_lnaof (addr));
  138. }
  139. #undef FUNC_NAME
  140. #endif
  141. #ifdef HAVE_INET_MAKEADDR
  142. SCM_DEFINE (scm_inet_makeaddr, "inet-makeaddr", 2, 0, 0,
  143. (SCM net, SCM lna),
  144. "Makes an Internet host address by combining the network number @var{net}\n"
  145. "with the local-address-within-network number @var{lna}.\n\n"
  146. "@smalllisp\n"
  147. "(inet-makeaddr 127 1) @result{} 2130706433\n"
  148. "@end smalllisp")
  149. #define FUNC_NAME s_scm_inet_makeaddr
  150. {
  151. struct in_addr addr;
  152. unsigned long netnum;
  153. unsigned long lnanum;
  154. #if 0 /* GJB:FIXME:: */
  155. SCM_VALIDATE_INUM_COPY (1,net,netnum);
  156. SCM_VALIDATE_INUM_COPY (2,lna,lnanum);
  157. #else
  158. netnum = SCM_NUM2ULONG (1, net);
  159. lnanum = SCM_NUM2ULONG (2, lna);
  160. #endif
  161. addr = inet_makeaddr (netnum, lnanum);
  162. return scm_ulong2num (ntohl (addr.s_addr));
  163. }
  164. #undef FUNC_NAME
  165. #endif
  166. SCM_SYMBOL (scm_host_not_found_key, "host-not-found");
  167. SCM_SYMBOL (scm_try_again_key, "try-again");
  168. SCM_SYMBOL (scm_no_recovery_key, "no-recovery");
  169. SCM_SYMBOL (scm_no_data_key, "no-data");
  170. static void scm_resolv_error (const char *subr, SCM bad_value)
  171. {
  172. #ifdef NETDB_INTERNAL
  173. if (h_errno == NETDB_INTERNAL)
  174. {
  175. /* errno supposedly contains a useful value. */
  176. scm_syserror (subr);
  177. }
  178. else
  179. #endif
  180. {
  181. SCM key;
  182. const char *errmsg;
  183. switch (h_errno)
  184. {
  185. case HOST_NOT_FOUND:
  186. key = scm_host_not_found_key;
  187. errmsg = "Unknown host";
  188. break;
  189. case TRY_AGAIN:
  190. key = scm_try_again_key;
  191. errmsg = "Host name lookup failure";
  192. break;
  193. case NO_RECOVERY:
  194. key = scm_no_recovery_key;
  195. errmsg = "Unknown server error";
  196. break;
  197. case NO_DATA:
  198. key = scm_no_data_key;
  199. errmsg = "No address associated with name";
  200. break;
  201. default:
  202. scm_misc_error (subr, "Unknown resolver error", SCM_EOL);
  203. errmsg = NULL;
  204. }
  205. #ifdef HAVE_HSTRERROR
  206. errmsg = (const char *) hstrerror (h_errno);
  207. #endif
  208. scm_error (key, subr, errmsg, scm_cons (bad_value, SCM_EOL), SCM_EOL);
  209. }
  210. }
  211. /* Should take an extra arg for address format (will be needed for IPv6).
  212. Should use reentrant facilities if available.
  213. */
  214. SCM_DEFINE (scm_gethost, "gethost", 0, 1, 0,
  215. (SCM name),
  216. "@deffnx procedure gethostbyname hostname\n"
  217. "@deffnx procedure gethostbyaddr address\n"
  218. "Look up a host by name or address, returning a host object. The\n"
  219. "@code{gethost} procedure will accept either a string name or an integer\n"
  220. "address; if given no arguments, it behaves like @code{gethostent} (see\n"
  221. "below). If a name or address is supplied but the address can not be\n"
  222. "found, an error will be thrown to one of the keys:\n"
  223. "@code{host-not-found}, @code{try-again}, @code{no-recovery} or\n"
  224. "@code{no-data}, corresponding to the equivalent @code{h_error} values.\n"
  225. "Unusual conditions may result in errors thrown to the\n"
  226. "@code{system-error} or @code{misc_error} keys.")
  227. #define FUNC_NAME s_scm_gethost
  228. {
  229. SCM ans = scm_make_vector (SCM_MAKINUM (5), SCM_UNSPECIFIED);
  230. SCM *ve = SCM_VELTS (ans);
  231. SCM lst = SCM_EOL;
  232. struct hostent *entry;
  233. struct in_addr inad;
  234. char **argv;
  235. int i = 0;
  236. if (SCM_UNBNDP (name))
  237. {
  238. #ifdef HAVE_GETHOSTENT
  239. entry = gethostent ();
  240. #else
  241. entry = NULL;
  242. #endif
  243. if (! entry)
  244. {
  245. /* As far as I can tell, there's no good way to tell whether
  246. zero means an error or end-of-file. The trick of
  247. clearing errno before calling gethostent and checking it
  248. afterwards doesn't cut it, because, on Linux, it seems to
  249. try to contact some other server (YP?) and fails, which
  250. is a benign failure. */
  251. return SCM_BOOL_F;
  252. }
  253. }
  254. else if (SCM_ROSTRINGP (name))
  255. {
  256. SCM_COERCE_SUBSTR (name);
  257. entry = gethostbyname (SCM_ROCHARS (name));
  258. }
  259. else
  260. {
  261. inad.s_addr = htonl (SCM_NUM2ULONG (1,name));
  262. entry = gethostbyaddr ((char *) &inad, sizeof (inad), AF_INET);
  263. }
  264. if (!entry)
  265. scm_resolv_error (FUNC_NAME, name);
  266. ve[0] = scm_makfromstr (entry->h_name,
  267. (scm_sizet) strlen (entry->h_name), 0);
  268. ve[1] = scm_makfromstrs (-1, entry->h_aliases);
  269. ve[2] = SCM_MAKINUM (entry->h_addrtype + 0L);
  270. ve[3] = SCM_MAKINUM (entry->h_length + 0L);
  271. if (sizeof (struct in_addr) != entry->h_length)
  272. {
  273. ve[4] = SCM_BOOL_F;
  274. return ans;
  275. }
  276. for (argv = entry->h_addr_list; argv[i]; i++);
  277. while (i--)
  278. {
  279. inad = *(struct in_addr *) argv[i];
  280. lst = scm_cons (scm_ulong2num (ntohl (inad.s_addr)), lst);
  281. }
  282. ve[4] = lst;
  283. return ans;
  284. }
  285. #undef FUNC_NAME
  286. /* In all subsequent getMUMBLE functions, when we're called with no
  287. arguments, we're supposed to traverse the tables entry by entry.
  288. However, there doesn't seem to be any documented way to distinguish
  289. between end-of-table and an error; in both cases the functions
  290. return zero. Gotta love Unix. For the time being, we clear errno,
  291. and if we get a zero and errno is set, we signal an error. This
  292. doesn't seem quite right (what if errno gets set as part of healthy
  293. operation?), but it seems to work okay. We'll see. */
  294. #if defined(HAVE_GETNETENT) && defined(HAVE_GETNETBYNAME) && defined(HAVE_GETNETBYADDR)
  295. SCM_DEFINE (scm_getnet, "getnet", 0, 1, 0,
  296. (SCM name),
  297. "@deffnx procedure getnetbyname net-name\n"
  298. "@deffnx procedure getnetbyaddr net-number\n"
  299. "Look up a network by name or net number in the network database. The\n"
  300. "@var{net-name} argument must be a string, and the @var{net-number}\n"
  301. "argument must be an integer. @code{getnet} will accept either type of\n"
  302. "argument, behaving like @code{getnetent} (see below) if no arguments are\n"
  303. "given.")
  304. #define FUNC_NAME s_scm_getnet
  305. {
  306. SCM ans;
  307. SCM *ve;
  308. struct netent *entry;
  309. ans = scm_make_vector (SCM_MAKINUM (4), SCM_UNSPECIFIED);
  310. ve = SCM_VELTS (ans);
  311. if (SCM_UNBNDP (name))
  312. {
  313. errno = 0;
  314. entry = getnetent ();
  315. if (! entry)
  316. {
  317. if (errno)
  318. SCM_SYSERROR;
  319. else
  320. return SCM_BOOL_F;
  321. }
  322. }
  323. else if (SCM_ROSTRINGP (name))
  324. {
  325. SCM_COERCE_SUBSTR (name);
  326. entry = getnetbyname (SCM_ROCHARS (name));
  327. }
  328. else
  329. {
  330. unsigned long netnum;
  331. netnum = SCM_NUM2ULONG (1, name);
  332. entry = getnetbyaddr (netnum, AF_INET);
  333. }
  334. if (!entry)
  335. SCM_SYSERROR_MSG ("no such network ~A",
  336. scm_listify (name, SCM_UNDEFINED), errno);
  337. ve[0] = scm_makfromstr (entry->n_name, (scm_sizet) strlen (entry->n_name), 0);
  338. ve[1] = scm_makfromstrs (-1, entry->n_aliases);
  339. ve[2] = SCM_MAKINUM (entry->n_addrtype + 0L);
  340. ve[3] = scm_ulong2num (entry->n_net + 0L);
  341. return ans;
  342. }
  343. #undef FUNC_NAME
  344. #endif
  345. #ifdef HAVE_GETPROTOENT
  346. SCM_DEFINE (scm_getproto, "getproto", 0, 1, 0,
  347. (SCM name),
  348. "@deffnx procedure getprotobyname name\n"
  349. "@deffnx procedure getprotobynumber number\n"
  350. "Look up a network protocol by name or by number. @code{getprotobyname}\n"
  351. "takes a string argument, and @code{getprotobynumber} takes an integer\n"
  352. "argument. @code{getproto} will accept either type, behaving like\n"
  353. "@code{getprotoent} (see below) if no arguments are supplied.")
  354. #define FUNC_NAME s_scm_getproto
  355. {
  356. SCM ans;
  357. SCM *ve;
  358. struct protoent *entry;
  359. ans = scm_make_vector (SCM_MAKINUM (3), SCM_UNSPECIFIED);
  360. ve = SCM_VELTS (ans);
  361. if (SCM_UNBNDP (name))
  362. {
  363. errno = 0;
  364. entry = getprotoent ();
  365. if (! entry)
  366. {
  367. if (errno)
  368. SCM_SYSERROR;
  369. else
  370. return SCM_BOOL_F;
  371. }
  372. }
  373. else if (SCM_ROSTRINGP (name))
  374. {
  375. SCM_COERCE_SUBSTR (name);
  376. entry = getprotobyname (SCM_ROCHARS (name));
  377. }
  378. else
  379. {
  380. unsigned long protonum;
  381. protonum = SCM_NUM2ULONG (1,name);
  382. entry = getprotobynumber (protonum);
  383. }
  384. if (!entry)
  385. SCM_SYSERROR_MSG ("no such protocol ~A",
  386. scm_listify (name, SCM_UNDEFINED), errno);
  387. ve[0] = scm_makfromstr (entry->p_name, (scm_sizet) strlen (entry->p_name), 0);
  388. ve[1] = scm_makfromstrs (-1, entry->p_aliases);
  389. ve[2] = SCM_MAKINUM (entry->p_proto + 0L);
  390. return ans;
  391. }
  392. #undef FUNC_NAME
  393. #endif
  394. static SCM
  395. scm_return_entry (struct servent *entry)
  396. {
  397. SCM ans;
  398. SCM *ve;
  399. ans = scm_make_vector (SCM_MAKINUM (4), SCM_UNSPECIFIED);
  400. ve = SCM_VELTS (ans);
  401. ve[0] = scm_makfromstr (entry->s_name, (scm_sizet) strlen (entry->s_name), 0);
  402. ve[1] = scm_makfromstrs (-1, entry->s_aliases);
  403. ve[2] = SCM_MAKINUM (ntohs (entry->s_port) + 0L);
  404. ve[3] = scm_makfromstr (entry->s_proto, (scm_sizet) strlen (entry->s_proto), 0);
  405. return ans;
  406. }
  407. #ifdef HAVE_GETSERVENT
  408. SCM_DEFINE (scm_getserv, "getserv", 0, 2, 0,
  409. (SCM name, SCM proto),
  410. "@deffnx procedure getservbyname name protocol\n"
  411. "@deffnx procedure getservbyport port protocol\n"
  412. "Look up a network service by name or by service number, and return a\n"
  413. "network service object. The @var{protocol} argument specifies the name\n"
  414. "of the desired protocol; if the protocol found in the network service\n"
  415. "database does not match this name, a system error is signalled.\n\n"
  416. "The @code{getserv} procedure will take either a service name or number\n"
  417. "as its first argument; if given no arguments, it behaves like\n"
  418. "@code{getservent} (see below).")
  419. #define FUNC_NAME s_scm_getserv
  420. {
  421. struct servent *entry;
  422. if (SCM_UNBNDP (name))
  423. {
  424. errno = 0;
  425. entry = getservent ();
  426. if (!entry)
  427. {
  428. if (errno)
  429. SCM_SYSERROR;
  430. else
  431. return SCM_BOOL_F;
  432. }
  433. return scm_return_entry (entry);
  434. }
  435. SCM_VALIDATE_ROSTRING (2,proto);
  436. SCM_COERCE_SUBSTR (proto);
  437. if (SCM_ROSTRINGP (name))
  438. {
  439. SCM_COERCE_SUBSTR (name);
  440. entry = getservbyname (SCM_ROCHARS (name), SCM_ROCHARS (proto));
  441. }
  442. else
  443. {
  444. SCM_VALIDATE_INUM (1,name);
  445. entry = getservbyport (htons (SCM_INUM (name)), SCM_ROCHARS (proto));
  446. }
  447. if (!entry)
  448. SCM_SYSERROR_MSG("no such service ~A",
  449. scm_listify (name, SCM_UNDEFINED), errno);
  450. return scm_return_entry (entry);
  451. }
  452. #undef FUNC_NAME
  453. #endif
  454. #if defined(HAVE_SETHOSTENT) && defined(HAVE_ENDHOSTENT)
  455. SCM_DEFINE (scm_sethost, "sethost", 0, 1, 0,
  456. (SCM arg),
  457. "If @var{stayopen} is omitted, this is equivalent to @code{endhostent}.\n"
  458. "Otherwise it is equivalent to @code{sethostent stayopen}.")
  459. #define FUNC_NAME s_scm_sethost
  460. {
  461. if (SCM_UNBNDP (arg))
  462. endhostent ();
  463. else
  464. sethostent (SCM_NFALSEP (arg));
  465. return SCM_UNSPECIFIED;
  466. }
  467. #undef FUNC_NAME
  468. #endif
  469. #if defined(HAVE_SETNETENT) && defined(HAVE_ENDNETENT)
  470. SCM_DEFINE (scm_setnet, "setnet", 0, 1, 0,
  471. (SCM arg),
  472. "If @var{stayopen} is omitted, this is equivalent to @code{endnetent}.\n"
  473. "Otherwise it is equivalent to @code{setnetent stayopen}.")
  474. #define FUNC_NAME s_scm_setnet
  475. {
  476. if (SCM_UNBNDP (arg))
  477. endnetent ();
  478. else
  479. setnetent (SCM_NFALSEP (arg));
  480. return SCM_UNSPECIFIED;
  481. }
  482. #undef FUNC_NAME
  483. #endif
  484. #if defined(HAVE_SETPROTOENT) && defined(HAVE_ENDPROTOENT)
  485. SCM_DEFINE (scm_setproto, "setproto", 0, 1, 0,
  486. (SCM arg),
  487. "If @var{stayopen} is omitted, this is equivalent to @code{endprotoent}.\n"
  488. "Otherwise it is equivalent to @code{setprotoent stayopen}.")
  489. #define FUNC_NAME s_scm_setproto
  490. {
  491. if (SCM_UNBNDP (arg))
  492. endprotoent ();
  493. else
  494. setprotoent (SCM_NFALSEP (arg));
  495. return SCM_UNSPECIFIED;
  496. }
  497. #undef FUNC_NAME
  498. #endif
  499. #if defined(HAVE_SETSERVENT) && defined(HAVE_ENDSERVENT)
  500. SCM_DEFINE (scm_setserv, "setserv", 0, 1, 0,
  501. (SCM arg),
  502. "If @var{stayopen} is omitted, this is equivalent to @code{endservent}.\n"
  503. "Otherwise it is equivalent to @code{setservent stayopen}.")
  504. #define FUNC_NAME s_scm_setserv
  505. {
  506. if (SCM_UNBNDP (arg))
  507. endservent ();
  508. else
  509. setservent (SCM_NFALSEP (arg));
  510. return SCM_UNSPECIFIED;
  511. }
  512. #undef FUNC_NAME
  513. #endif
  514. void
  515. scm_init_net_db ()
  516. {
  517. #ifdef INADDR_ANY
  518. scm_sysintern ("INADDR_ANY", scm_ulong2num (INADDR_ANY));
  519. #endif
  520. #ifdef INADDR_BROADCAST
  521. scm_sysintern ("INADDR_BROADCAST", scm_ulong2num (INADDR_BROADCAST));
  522. #endif
  523. #ifdef INADDR_NONE
  524. scm_sysintern ("INADDR_NONE", scm_ulong2num (INADDR_NONE));
  525. #endif
  526. #ifdef INADDR_LOOPBACK
  527. scm_sysintern ("INADDR_LOOPBACK", scm_ulong2num (INADDR_LOOPBACK));
  528. #endif
  529. scm_add_feature ("net-db");
  530. #include "libguile/net_db.x"
  531. }
  532. /*
  533. Local Variables:
  534. c-file-style: "gnu"
  535. End:
  536. */