26#include "Satellite_MAC.h"
28void satellite_ut_set_gateway(ptrSATELLITE_UT_MAC utMac)
30 if (!utMac->szGatewayName)
32 fnNetSimError(
"Gateway is not setup for UT %d-%d.\n"
33 "Press any key to terminate simulation.\n",
34 utMac->utId, utMac->utIf);
39 utMac->gatewayId = fn_NetSim_Stack_GetDeviceId_asName(utMac->szGatewayName);
40 if (!utMac->gatewayId)
42 fnNetSimError(
"Gateway is not correctly setup for UT %d-%d.\n"
43 "Gateway = %s is not an gateway device\n"
44 "Press any key to terminate simulation.\n",
45 utMac->utId, utMac->utIf, utMac->szGatewayName);
50 utMac->gatewayIf = fn_NetSim_Stack_GetConnectedInterface(utMac->utId, utMac->utIf,
52 if (!utMac->gatewayIf)
54 fnNetSimError(
"%s Gateway is not connected to UT %d-%d.\n"
55 "Press any key to terminate simulation.\n",
56 utMac->szGatewayName, utMac->utId, utMac->utIf);
61 if (DEVICE_MACLAYER(utMac->gatewayId, utMac->gatewayIf)->nMacProtocolId != MAC_PROTOCOL_SATELLITE)
63 fnNetSimError(
"Gateway %s not running satellite protocol.\n"
64 "Press any key to terminate simulation.\n",
65 utMac->szGatewayName);
70 ptrSATELLITE_PROTODATA pd = DEVICE_MACVAR(utMac->gatewayId, utMac->gatewayIf);
71 if (pd->deviceType != SATELLITE_DEVICETYPE_SATELLITE_GATEWAY)
73 fnNetSimError(
"Gateway %s is not a satellite gateway device.\n"
74 "Press any key to terminate simulation.\n",
75 utMac->szGatewayName);
81bool isSatelliteInterface(NETSIM_ID d, NETSIM_ID in)
83 if (!DEVICE_INTERFACE(d, in))
85 if (!DEVICE_INTERFACE(d, in)->pstruMACLayer)
87 if (DEVICE_MACLAYER(d, in)->nMacProtocolId == MAC_PROTOCOL_SATELLITE)