Callbacks and routing with TTL subtraction;

This commit is contained in:
2026-06-11 17:53:03 +02:00
parent 85e77c9dc1
commit 2bed12a231
6 changed files with 90 additions and 13 deletions

View File

@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <forward/routetable.h>
#include <forward/route.h>
#include <forward/if/interface.h>
#include <iputils.h>
@@ -20,8 +21,8 @@ int main(void) {
Log_Info("Route tables initialized successfully");
}
interface_v4_t* iface = Interface_Create_v4("0.0.0.0", NULL, NULL);
interface_v6_t* iface6 = Interface_Create_v6("::", NULL, NULL);
interface_v4_t* iface = Interface_Create_v4("0.0.0.0", Route_Processv4, NULL);
interface_v6_t* iface6 = Interface_Create_v6("::", Route_Processv6, NULL);
if (!iface || !iface6) {
Log_Err("Failed to create interfaces");
RouteTable_Cleanup();
@@ -99,7 +100,8 @@ int main(void) {
}
RouteTable_Cleanup();
Interface_Cleanup();
Interface_Destroy_v4(iface);
Interface_Destroy_v6(iface6);
Log_Cleanup();