NetSim Source Code Help
Loading...
Searching...
No Matches
CSMACD.h
Go to the documentation of this file.
1/************************************************************************************
2* Copyright (C) 2020 *
3* TETCOS, Bangalore. India *
4* *
5* Tetcos owns the intellectual property rights in the Product and its content. *
6* The copying, redistribution, reselling or publication of any or all of the *
7* Product or its content without express prior written consent of Tetcos is *
8* prohibited. Ownership and / or any other right relating to the software and all *
9* intellectual property rights therein shall remain at all times with Tetcos. *
10* *
11* Author: Shashi Kant Suman *
12* *
13* ---------------------------------------------------------------------------------*/
14#ifndef _NETSIM_CSMACD_H_
15#define _NETSIM_CSMACD_H_
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20 ///For MSVC compiler. For GCC link via Linker command
21#pragma comment(lib,"CSMACDlib.lib")
22#pragma comment(lib,"Metrics.lib")
23#pragma comment(lib,"NetworkStack.lib")
24
25#include "CSMACD_enum.h"
26
27#define CSMACD_MAC_OVERHEAD 26 //Bytes
28#define CSMACD_PHY_OVERHEAD 0
29
31
32 typedef enum
33 {
37
38 typedef enum
39 {
42 }MAC_STATE;
43
44 typedef struct stru_CSMACD_MacVar
45 {
47 double dSlotTime;
48 unsigned int nRetryLimit;
49
51 unsigned int nRetryCount;
53 double waittime;
56#define CSMACD_MAC(devid,ifid) ((PCSMACD_MACVAR)DEVICE_MACVAR(devid,ifid))
57#define CSMACD_CURRMAC (CSMACD_MAC(pstruEventDetails->nDeviceId,pstruEventDetails->nInterfaceId))
58
59 typedef struct struc_CSMACD_PhyVar
60 {
64#define CSMACD_PHY(devid,ifid) (PCSMACD_PHYVAR)DEVICE_PHYVAR(devid,ifid)
65#define CSMACD_CURRPHY CSMACD_PHY(pstruEventDetails->nDeviceId,pstruEventDetails->nInterfaceId)
66
67
68 bool isMediumIdle();
74
75#ifdef __cplusplus
76}
77#endif
78#endif //_NETSIM_CSMACD_H_
void fn_NetSim_CSMACD_PhyIn()
Definition: CSMACD_Phy.c:162
FILE * file_contention
Definition: CSMACD.h:30
struct struc_CSMACD_PhyVar CSMACD_PHYVAR
void fn_NetSim_CSMACS_PersistanceWait()
Definition: CSMACDMac.c:129
void fn_NetSim_CSMACD_MacIn()
Definition: CSMACDMac.c:123
struct stru_CSMACD_MacVar * PCSMACD_MACVAR
FILE * file_collision
Definition: CSMACD.h:30
bool isMediumIdle()
Definition: CSMACD_Phy.c:17
LINK_STATE
Definition: CSMACD.h:33
@ LinkState_DOWN
Definition: CSMACD.h:34
@ LinkState_UP
Definition: CSMACD.h:35
struct struc_CSMACD_PhyVar * PCSMACD_PHYVAR
void fn_NetSim_CSMACD_MacOut()
Definition: CSMACDMac.c:65
void fn_NetSim_CSMACD_PhyOut()
Definition: CSMACD_Phy.c:113
struct stru_CSMACD_MacVar CSMACD_MACVAR
MAC_STATE
Definition: CSMACD.h:39
@ Busy
Definition: CSMACD.h:41
@ Idle
Definition: CSMACD.h:40
NetSim_PACKET * currentPacket
Definition: CSMACD.h:52
double waittime
Definition: CSMACD.h:53
MAC_STATE macState
Definition: CSMACD.h:50
unsigned int nRetryLimit
Definition: CSMACD.h:48
double dPersistance
Definition: CSMACD.h:46
double dSlotTime
Definition: CSMACD.h:47
unsigned int nRetryCount
Definition: CSMACD.h:51
LINK_STATE link_state
Definition: CSMACD.h:61