initial http parsing

This commit is contained in:
2024-11-11 00:50:39 +01:00
parent 7db494eaaf
commit e5e40c795c
17 changed files with 176 additions and 32 deletions

29
include/utils/utils.h Normal file
View File

@@ -0,0 +1,29 @@
#ifndef __UTILS_H__
#define __UTILS_H__
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
/**
* @brief Prints each IP address associated with a host
*
* @param hostname[in] Hostname
* @param port[in] Port
*/
void print_ips(const char *hostname, const char *port);
/**
* @brief Retrieves the client ip from the sockaddr_storage and put it in the ip str
*
* @param sa[in] The sockaddr_storage of the client
* @param ip[out] The IP of the client
*/
void get_client_ip(struct sockaddr_storage *sa, char *ip);
#endif