Files
Eric Kohl 07d30c679e [TCPIP] Read the interface metric from the registry or use the automatic metric feature
- Read the interface metric from the registry.
- Assign an automatic metric to an interface if a registry value is not available.
- Determine the automatic metric from the link speed. The metric for the loopback interface is always 1.
2026-03-14 21:10:56 +01:00

54 lines
1.4 KiB
C

/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS TCP/IP protocol driver
* FILE: include/router.h
* PURPOSE: IP routing definitions
*/
#pragma once
#include <neighbor.h>
/* Forward Information Base Entry */
typedef struct _FIB_ENTRY {
LIST_ENTRY ListEntry; /* Entry on list */
OBJECT_FREE_ROUTINE Free; /* Routine used to free resources for the object */
IP_ADDRESS NetworkAddress; /* Address of network */
IP_ADDRESS Netmask; /* Netmask of network */
PNEIGHBOR_CACHE_ENTRY Router; /* Pointer to NCE of router to use */
UINT Metric; /* Cost of this route */
} FIB_ENTRY, *PFIB_ENTRY;
PFIB_ENTRY RouterAddRoute(
PIP_ADDRESS NetworkAddress,
PIP_ADDRESS Netmask,
PNEIGHBOR_CACHE_ENTRY Router,
UINT Metric);
PNEIGHBOR_CACHE_ENTRY RouterGetRoute(PIP_ADDRESS Destination);
NTSTATUS RouterRemoveRoute(PIP_ADDRESS Target, PIP_ADDRESS Router);
PFIB_ENTRY RouterCreateRoute(
PIP_ADDRESS NetworkAddress,
PIP_ADDRESS Netmask,
PIP_ADDRESS RouterAddress,
PIP_INTERFACE Interface);
NTSTATUS RouterStartup(
VOID);
NTSTATUS RouterShutdown(
VOID);
VOID RouterRemoveRoutesForInterface(PIP_INTERFACE Interface);
UINT CountFIBs(PIP_INTERFACE IF);
UINT CopyFIBs( PIP_INTERFACE IF, PFIB_ENTRY Target );
UINT ProcessAutoMetric(PIP_INTERFACE Interface);
/* EOF */