Back to index

webcit  8.12-dfsg
locate_host.c File Reference
#include "webcit.h"
#include "webserver.h"

Go to the source code of this file.


void locate_host (StrBuf *tbuf, int client_socket)

Function Documentation

void locate_host ( StrBuf *  tbuf,
int  client_socket 

Definition at line 21 of file locate_host.c.

       struct sockaddr_in6 clientaddr;
       unsigned int addrlen = sizeof(clientaddr);
       char clienthost[NI_MAXHOST] = "";

       getpeername(client_socket, (struct sockaddr *)&clientaddr, &addrlen);
       getnameinfo((struct sockaddr *)&clientaddr, addrlen, clienthost, sizeof(clienthost), NULL, 0, 0);
        StrBufAppendBufPlain(tbuf, clienthost, -1, 0);
       syslog(9, "Client is at %s\n", clienthost);

Here is the caller graph for this function: