X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Flocate_host.c;h=64879eefbb797115d5037b89572205a702977611;hb=HEAD;hp=e4708cdf95a443b24bbc18ad38742ea7e0497f17;hpb=ffe458c7fb6342ac60522b9750b2ba677bc4a0a8;p=citadel.git diff --git a/citadel/locate_host.c b/citadel/locate_host.c deleted file mode 100644 index e4708cdf9..000000000 --- a/citadel/locate_host.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * locate the originating host - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "sysdep.h" -#include "citadel.h" -#include "server.h" -#include "locate_host.h" -#include "config.h" - -void locate_host(char *tbuf) -{ - struct sockaddr_in cs; - struct hostent * ch; - int len; - char *i; - int a1,a2,a3,a4; - - len = sizeof(cs); - if (getpeername(CC->client_socket, (struct sockaddr *)&cs,&len) < 0){ - strcpy(tbuf,config.c_fqdn); - return; - } - - if((ch = gethostbyaddr((char *) &cs.sin_addr, sizeof(cs.sin_addr), - AF_INET)) == NULL) { - i = (char *) &cs.sin_addr; - a1 = ((*i++)&0xff); - a2 = ((*i++)&0xff); - a3 = ((*i++)&0xff); - a4 = ((*i++)&0xff); - sprintf(tbuf,"%d.%d.%d.%d",a1,a2,a3,a4); - return; - } - - strncpy(tbuf,ch->h_name, 24); - tbuf[24] = 0; - }