X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Flocate_host.c;h=64879eefbb797115d5037b89572205a702977611;hb=HEAD;hp=d3c194adc2a5658f6a025f0a0732ee2894b9a487;hpb=54b54a07b29cd57a19728f468e19cf887cda3873;p=citadel.git diff --git a/citadel/locate_host.c b/citadel/locate_host.c deleted file mode 100644 index d3c194adc..000000000 --- a/citadel/locate_host.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * locate the originating host - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "sysdep.h" -#include "citadel.h" -#include "server.h" - -struct config config; - -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; - }