NetSim Source Code Help
Loading...
Searching...
No Matches
Ethernet_Mac.c File Reference
#include "main.h"
#include "Ethernet.h"
#include "Ethernet_enum.h"
#include "../Firewall/Firewall.h"
Include dependency graph for Ethernet_Mac.c:

Go to the source code of this file.

Macros

#define ETHERNET_FRAME_HEADER_LEN   26
 

Functions

NETSIM_ID find_forward_interface (ptrETH_LAN lan, NetSim_PACKET *packet)
 
void send_to_phy (NETSIM_ID d, NETSIM_ID in, NetSim_PACKET *packet, double time)
 
static void add_mac_header (NetSim_PACKET *packet, double time)
 
static int packet_arrive_from_network_layer ()
 
int fn_NetSim_Ethernet_HandleMacOut ()
 
static bool validate_mac_frame (ptrETH_LAN lan, PNETSIM_MACADDRESS mac)
 
void check_move_frame_up (NETSIM_ID d, NETSIM_ID in, ptrETH_LAN lan, NetSim_PACKET *packet, double time)
 
static void forward_packet_to_other_protocol (NETSIM_ID d, NETSIM_ID in, NetSim_PACKET *packet, double time)
 
void forward_frame (NETSIM_ID d, NETSIM_ID in, ptrETH_LAN lan, NetSim_PACKET *packet, double time)
 
static bool decide_move_up (ptrETH_LAN lan, PNETSIM_MACADDRESS destMAC, SWITCHING_TECHNIQUE sw)
 
static void ethernet_mac_process_frame ()
 
int fn_NetSim_Ethernet_HandleMacIn ()
 

Macro Definition Documentation

◆ ETHERNET_FRAME_HEADER_LEN

#define ETHERNET_FRAME_HEADER_LEN   26

Definition at line 29 of file Ethernet_Mac.c.

Function Documentation

◆ add_mac_header()

static void add_mac_header ( NetSim_PACKET packet,
double  time 
)
static

Definition at line 62 of file Ethernet_Mac.c.

Here is the caller graph for this function:

◆ check_move_frame_up()

void check_move_frame_up ( NETSIM_ID  d,
NETSIM_ID  in,
ptrETH_LAN  lan,
NetSim_PACKET packet,
double  time 
)

Definition at line 187 of file Ethernet_Mac.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decide_move_up()

static bool decide_move_up ( ptrETH_LAN  lan,
PNETSIM_MACADDRESS  destMAC,
SWITCHING_TECHNIQUE  sw 
)
static

Definition at line 313 of file Ethernet_Mac.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ethernet_mac_process_frame()

static void ethernet_mac_process_frame ( )
static

Definition at line 324 of file Ethernet_Mac.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_forward_interface()

NETSIM_ID find_forward_interface ( ptrETH_LAN  lan,
NetSim_PACKET packet 
)

Definition at line 31 of file Ethernet_Mac.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Ethernet_HandleMacIn()

int fn_NetSim_Ethernet_HandleMacIn ( )

Definition at line 364 of file Ethernet_Mac.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fn_NetSim_Ethernet_HandleMacOut()

int fn_NetSim_Ethernet_HandleMacOut ( )

Definition at line 145 of file Ethernet_Mac.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ forward_frame()

void forward_frame ( NETSIM_ID  d,
NETSIM_ID  in,
ptrETH_LAN  lan,
NetSim_PACKET packet,
double  time 
)

Definition at line 252 of file Ethernet_Mac.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ forward_packet_to_other_protocol()

static void forward_packet_to_other_protocol ( NETSIM_ID  d,
NETSIM_ID  in,
NetSim_PACKET packet,
double  time 
)
static

Definition at line 222 of file Ethernet_Mac.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ packet_arrive_from_network_layer()

static int packet_arrive_from_network_layer ( )
static

Definition at line 76 of file Ethernet_Mac.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_to_phy()

void send_to_phy ( NETSIM_ID  d,
NETSIM_ID  in,
NetSim_PACKET packet,
double  time 
)

Definition at line 41 of file Ethernet_Mac.c.

◆ validate_mac_frame()

static bool validate_mac_frame ( ptrETH_LAN  lan,
PNETSIM_MACADDRESS  mac 
)
static

Definition at line 162 of file Ethernet_Mac.c.

Here is the call graph for this function:
Here is the caller graph for this function: