librepsheet  6.2.0
TheRepsheetcorelogiclibrary
 All Data Structures Files Functions Pages
Functions
xff.c File Reference
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
#include "repsheet.h"
#include "xff.h"

Functions

int remote_address (char *connected_address, char *xff_header, char *address)
 

Detailed Description

Author
Aaron Bedra
Date
12/09/2014

Function Documentation

int remote_address ( char *  connected_address,
char *  xff_header,
char *  address 
)

Determines the IP address of the actor. If X-Forwarded-For has information, the function takes the first address in the string. If no XFF information is provided the function returns the connected_address.

Parameters
connected_addressThe IP of the connection to the server
xff_headerThe contents of the X-Forwarded-For header
addressThe string to store the resulting address