- get_interface_by_address() added - HTTP server initials added - code added to strip away padding on processing the IP layer by shrinking overall packet size - load of TCP fixes and improvements - TCP stream interface added - TCP window destroy() added and some bugs fixed
29 lines
677 B
C
29 lines
677 B
C
//
|
|
// Created by epagris on 2023.11.22..
|
|
//
|
|
|
|
#include <stddef.h>
|
|
#include "http_server.h"
|
|
#include "../dynmem.h"
|
|
#include "../utils.h"
|
|
#include "../prefab/conn_blocks/tcp_connblock.h"
|
|
#include "../global_state.h"
|
|
|
|
HttpServer *http_new(ip4_addr addr, uint16_t port) {
|
|
// acquire interface
|
|
EthInterface * intf = get_interface_by_address(addr);
|
|
if (intf == NULL) {
|
|
ERROR("Unknown interface!\n");
|
|
return NULL;
|
|
}
|
|
|
|
// allocate instance
|
|
HttpServer * http = (HttpServer *) dynmem_alloc(sizeof(HttpServer));
|
|
ASSERT_NULL(http);
|
|
|
|
// open server connection
|
|
//http->serverConn = tcp_new_connblock(intf, addr, port, );
|
|
|
|
return http;
|
|
}
|