comparison lib-src/gnuserv.c @ 458:c33ae14dd6d0 r21-2-44

Import from CVS: tag r21-2-44
author cvs
date Mon, 13 Aug 2007 11:42:25 +0200
parents e7ef97881643
children 223736d75acb
comparison
equal deleted inserted replaced
457:4b9290a33024 458:c33ae14dd6d0
376 #endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */ 376 #endif /* INTERNET_DOMAIN_SOCKETS || UNIX_DOMAIN_SOCKETS */
377 377
378 378
379 #ifdef INTERNET_DOMAIN_SOCKETS 379 #ifdef INTERNET_DOMAIN_SOCKETS
380 struct entry { 380 struct entry {
381 u_long host_addr; 381 unsigned long host_addr;
382 struct entry *next; 382 struct entry *next;
383 }; 383 };
384 384
385 struct entry *permitted_hosts[TABLE_SIZE]; 385 struct entry *permitted_hosts[TABLE_SIZE];
386 386
448 448
449 /* 449 /*
450 permitted -- return whether a given host is allowed to connect to the server. 450 permitted -- return whether a given host is allowed to connect to the server.
451 */ 451 */
452 static int 452 static int
453 permitted (u_long host_addr, int fd) 453 permitted (unsigned long host_addr, int fd)
454 { 454 {
455 int key; 455 int key;
456 struct entry *entry; 456 struct entry *entry;
457 457
458 char auth_protocol[128]; 458 char auth_protocol[128];
558 /* 558 /*
559 add_host -- add the given host to the list of permitted hosts, provided it isn't 559 add_host -- add the given host to the list of permitted hosts, provided it isn't
560 already there. 560 already there.
561 */ 561 */
562 static void 562 static void
563 add_host (u_long host_addr) 563 add_host (unsigned long host_addr)
564 { 564 {
565 int key; 565 int key;
566 struct entry *new_entry; 566 struct entry *new_entry;
567 567
568 if (!permitted(host_addr, -1)) 568 if (!permitted(host_addr, -1))
594 setup_table (void) 594 setup_table (void)
595 { 595 {
596 FILE *host_file; 596 FILE *host_file;
597 char *file_name; 597 char *file_name;
598 char hostname[HOSTNAMSZ]; 598 char hostname[HOSTNAMSZ];
599 u_int host_addr; 599 unsigned int host_addr;
600 int i, hosts=0; 600 int i, hosts=0;
601 601
602 /* Make sure every entry is null */ 602 /* Make sure every entry is null */
603 for (i=0; i<TABLE_SIZE; i++) 603 for (i=0; i<TABLE_SIZE; i++)
604 permitted_hosts[i] = NULL; 604 permitted_hosts[i] = NULL;