📄 ip_notif_log_support.ex.c
字号:
"(Pkt. ID [" SIMC_PK_ID_FMT "] and Pkt. Tree ID [" SIMC_PK_ID_FMT "])\n"
"No protocol on this node has registered\n"
"itself for this multicast address.\n"
"The IP datagram is being dropped.\n"
"\n"
"THIS MESSAGE WILL NOT BE REPEATED DURING\n"
"THE REST OF THIS SIMULATION.\n"
"\n"
"POSSIBLE CAUSE(S):\n"
"1. This is a router node using RIP, IGRP or\n"
" BGP4 whereas neighboring routers' peer\n"
" interfaces are running OSPF.\n"
"2. This is an endstation that is connected\n"
" to a data link subnet that supports\n"
" multicasting AND an OSPF router is also\n"
" connected to the same data link subnet.\n"
"3. This is a router running OSPF on a\n"
" broadcast capable (eg. ethernet) interface\n"
" with other OSPF routers, and, this router\n"
" is NOT the Designated Router.\n"
"\n"
"SUGGESTIONS:\n"
"1. Set the \"Dynamic Routing Protocol\"\n"
" on all router nodes to either RIP or\n"
" OSPF.\n"
"2. If cause no. 2 or 3 is true, IGNORE this\n"
" message.\n",
addr, pkid, pktreeid);
}
FOUT
}
void
ipnl_unknown_input_iface_log_write (const int strm_index, const char* addr,
const SimT_Pk_Id pkid, const SimT_Pk_Id pktreeid)
{
InetT_Address ipaddr;
char nodename [OMSC_HNAME_MAX_LEN] = "Unknown";
/** This function prints out a log message indicating **/
/** that the interface on which a certain packet was **/
/** received could not be determined and hence it will **/
/** be dropped. **/
FIN (ipnl_unknown_input_iface_log_write (strm_index));
/* Create an IP address object corresponding to the
* address string passed in in the first parameter.
*/
ipaddr = inet_address_create (addr, InetC_Addr_Family_v4);
/* Build the hierarchical name of the node that
* has an IP interface with this address.
*/
ipnl_inet_addr_to_nodename (ipaddr, nodename);
op_prg_log_entry_write (
ip_prot_error_loghndl,
"ERROR(s):\n"
"Could not determine the IP interface corresponding\n"
"to the input stream (%d) on which the following\n"
"packet was received.\n"
" Packet ID: " SIMC_PK_ID_FMT "\n"
" Packet Tree ID: " SIMC_PK_ID_FMT "\n"
" Destination IP Address: %s\n"
"The destination IP address above corresponds\n"
"to an interface on the following node:\n"
"[%s]\n"
"\n"
"POSSIBLE CAUSE(s):\n"
"1. The interface corresponding to this stream is\n"
" incorrectly configured.\n"
"\n"
"SUGGESTION(s):\n"
"1. If the corresponding interface is marked as\n"
" 'Shutdown', ignore this message\n"
"2. Otherwise make sure that the interface \n"
" configuration is correct.\n"
"\n"
"RESULT(s):\n"
"1. The packet will be dropped.\n"
"\n"
"Note: This message will not be repeated for\n"
" this input stream on this node.\n",
strm_index, pkid, pktreeid, addr, nodename);
FOUT;
}
void
ipnl_proterr_noroute_ripospf (const char* addr,
const char* PRG_ARG_UNUSED(protocol), SimT_Pk_Id pkid, SimT_Pk_Id pktreeid)
{
InetT_Address ipaddr;
char nodename [OMSC_HNAME_MAX_LEN] = "Unknown";
/** Description of the condition flagged by this **/
/** notification log message. **/
FIN (ipnl_proterr_noroute_ripospf (addr, protocol))
/* Create an IP address object corresponding to the
* address string passed in in the first parameter.
*/
ipaddr = inet_address_create (addr, InetC_Addr_Family_Unknown);
/* Build the hierarchical name of the node that
* has an IP interface with this address.
*/
ipnl_inet_addr_to_nodename (ipaddr, nodename);
op_prg_log_entry_write (
ip_prot_error_loghndl,
"ERROR(S):\n"
"The IP routing table on this node does\n"
"not have a route to the destination\n"
"%s.\n"
"\n"
"The destination IP address above\n"
"corresponds to an interface on the\n"
"following node:\n"
"[%s]\n"
"\n"
"The corresponding IP datagram [ID " SIMC_PK_ID_FMT ",\n"
"Tree ID " SIMC_PK_ID_FMT "] is being dropped.\n"
"\n"
"The IP routing table is a composite of\n"
"routes contributed by one or any\n"
"combination of RIP, IGRP, OSPF, BGP4,\n"
"EIGRP, IS-IS and static route\n"
"configuration by the user.\n"
"\n"
"Background Traffic is not present or\n"
"is not starting at the expected time.\n"
"\n"
"POSSIBLE CAUSE(S):\n"
"1. Sufficient time has not elapsed for\n"
" dynamic routing protocol(s) to build\n"
" the routing table.\n"
"2. A configuration problem has prevented\n"
" the dynamic routing protocol(s) from\n"
" detecting a route to this destination\n"
"3. If only static (user configured) routing\n"
" is being used, the user has omitted to\n"
" set up a route to this destination.\n"
"4. If this destination belongs to another\n"
" routing domain (e.g. another Autonomous\n"
" system), this router might not have a\n"
" route to the destination unless route\n"
" redistribution is enabled between the\n"
" routing domains (e.g. between the EGP\n"
" and the IGP).\n"
"\n"
"SUGGESTIONS:\n"
"1. If GNA models are being used to\n"
" generate data traffic, check the value\n"
" of the \"Application Start Time\" attr.\n"
" If Background Traffic is being used,\n"
" check the value of the \"Background\n"
" Traffic Start Delay\" simulation\n"
" attribute. All Background Traffic\n"
" is delayed by this value. For RIP,\n"
" these values should be around 15\n"
" seconds. For OSPF, these values should\n"
" be around 100 secs. These values are\n"
" based on empirical data and may vary\n"
" with the number of IP routers in your\n"
" network model\n"
"2. Check the simulation log for previous\n"
" IP model messages. These may indicate\n"
" a configuration problem that interfered\n"
" with the operation of the dynamic\n"
" routing protocol(s).\n",
addr, nodename, pkid, pktreeid);
/* Destroy the IP address that was instantiated for
* the purposes of this debug message.
*/
inet_address_destroy (ipaddr);
FOUT
}
void
ipnl_proterr_noroute_static (const char* addr, SimT_Pk_Id pkid, SimT_Pk_Id pktreeid)
{
InetT_Address ipaddr;
char nodename [OMSC_HNAME_MAX_LEN] = "Unknown";
/** Description of the condition flagged by this **/
/** notification log message. **/
FIN (ipnl_proterr_noroute_static (addr, pkid, pktreeid))
/* Create an IP address object corresponding to the
* address string passed in in the first parameter.
*/
ipaddr = inet_address_create (addr, InetC_Addr_Family_v4);
/* Build the hierarchical name of the node that
* has an IP interface with this address.
*/
ipnl_inet_addr_to_nodename (ipaddr, nodename);
op_prg_log_entry_write (
ip_prot_error_loghndl,
"ERROR(S):\n"
"The user-defined static routing table on\n"
"this node does not have a route the\n"
"destination %s.\n"
"\n"
"The destination IP address mentioned\n"
"above corresponds to an IP interface in\n"
"the following node in the network model:\n"
"[%s]\n"
"\n"
"The IP datagram [ID " SIMC_PK_ID_FMT ", Tree ID " SIMC_PK_ID_FMT "] is\n"
"being dropped.\n"
"\n"
"POSSIBLE CAUSE(S):\n"
"Same as above.\n"
"\n"
"SUGGESTIONS:\n"
"Add a route to this destination in the\n"
"\"Internal Routing Table\" subobject of\n"
"the \"IP Routing Information\" attribute\n"
"on this node.\n",
addr, nodename, pkid, pktreeid);
/* Destroy the IP address that was instantiated for
* the purposes of this debug message.
*/
inet_address_destroy (ipaddr);
FOUT
}
void
ipnl_default_route_not_directly_connected_log_write (char* default_route_addr_str,
InetT_Addr_Family addr_family)
{
static Boolean message_already_logged = OPC_FALSE;
const char* protocol_name;
/** Writes a log message warning the user that the **/
/** default route specified for a node is not **/
/** directly connected and hence will be ignored. **/
FIN (ipnl_default_route_not_directly_connected_log_write (default_route_addr_str));
/* Do not print this message more than once. */
if (OPC_TRUE == message_already_logged)
{
FOUT;
}
if (InetC_Addr_Family_v4 == addr_family)
{
protocol_name = "IPv4";
}
else
{
protocol_name = "IPv6";
}
message_already_logged = OPC_TRUE;
op_prg_log_entry_write (
ip_config_warning_loghndl,
"WARNING(S):\n"
"The %s default route \"%s\"\n"
"specified for this node is invalid.\n"
"\n"
"REASON(s):\n"
"1. The specified default route is not directly\n"
" connected to this node. Default routes specified\n"
" should be within one ip hop from the node. i.e.\n"
" It should be in the same IP subnet as one of the\n"
" interfaces of this node.\n"
"\n"
"SUGGESTION(s):\n"
"1. Specify a valid default route.\n"
"\n"
"RESULT(s):\n"
"1. The Default route specification will be ignored.\n"
"2. This node will not be able to send packets to\n"
" nodes that are not in the same IP subnet.\n"
"NOTE: This message will not be repeated.\n",
protocol_name,
default_route_addr_str);
FOUT;
}
void
ipnl_invalid_routing_table_log_write (char* ip_addr_str)
{
/** This function prints out a log message indicating **/
/** that a loop exists in the routing table. **/
FIN (ipnl_invalid_routing_table_log_write (ip_addr_str));
op_prg_log_entry_write (
ip_prot_error_loghndl,
"ERROR(S):\n"
"Unable to route packet to the destination\n"
"%s.\n"
"\n"
"REASON(s):\n"
"1. While doing a recursive lookup to find the\n"
" next hop to reach this destination, a loop\n"
" was encountered.\n"
"\n"
"POSSIBLE CAUSE(s):\n"
"1. Routing Protocol misconfiguration.\n"
"2. Incorrect static routes.\n"
"\n"
"SUGESTION(s):\n"
"1. Export the routing table of this node and\n"
" and try to find the erroneous route(s).\n",
ip_addr_str);
FOUT;
}
void
ipnl_port_info_not_specified_in_rte_log_write (const char* dest_str, const char* nh_str,
IpT_Rte_Proc_Id proto, IpT_Port_Info port_info, IpT_Rte_Module_Data* PRG_ARG_UNUSED (iprmd_ptr))
{
char routing_protocol_name [32];
int intf_tbl_index;
int protocol;
/** The port info structure of a route table entry is **/
/** supposed to contain information about the interface **/
/** to be used to reach the next hop. If this **/
/** is not specified, ip will have to go through the **/
/** entire interface list to find out the interface **/
/** that is to be used to reach the next hop. **/
FIN (ipnl_port_info_not_specified_in_rte_log_write (dest_str, mask_str, nh_str, proto, port_info));
/* Break up the proto into the routing protocol type */
protocol = IP_CMN_RTE_TABLE_ROUTEPROC_PROTOCOL (proto);
/* Get the name of the routing protocol */
strcpy (routing_protocol_name, IpC_Dyn_Rte_Prot_Names [protocol]);
intf_tbl_index = ip_rte_intf_tbl_index_from_port_info_get (iprmd_ptr, port_info);
op_prg_log_entry_write (
ip_prot_warning_loghndl,
"WARNING(S):\n"
" The following routing table entry inserted "
" into the common route table by the \"%s\"\n"
" routing protocol did not specify the\n"
" interface through which the next hop can\n"
" be reached.\n"
" Destination: %s.\n"
" Next Hop: %s.\n"
" The next hop is in the same subnet as\n"
" interface# %d in the ip interface table\n"
"\n"
"RESULTS(S):\n"
"1. The interface to reach the next hop will\n"
" be set as %d.\n"
"\n"
"SUGGESTIONS(S);\n"
"1. If this a standard routing protocol,\n"
" please contact OPNET Technical support.\n"
"2. If this is a custom routing protocol,\n"
" make sure that the port_info element of\n"
" the route is specified correctly while\n"
" inserting the route into the common\n"
" routing table.\n",
routing_protocol_name, dest_str,
nh_str, intf_tbl_index, intf_tbl_index);
FOUT;
}
void
ipnl_invalid_port_info_log_write (const char* dest_str, const char* nh_str, IpT_Rte_Proc_Id proto,
IpT_Port_Info port_info, IpT_Rte_Module_Data* iprmd_ptr)
{
char routing_protocol_name [32];
int protocol;
/** The port info structure of a route table entry is **/
/** supposed to contain information about the interface **/
/** to be used to reach the next hop. This function is **/
/** called if the next hop of the route is not reachable**/
/** through the specified interface. **/
FIN (ipnl_invalid_port_info_in_route_table_entry_log_write (src_protocol));
/* Break up the proto into the routing protocol type */
protocol = IP_CMN_RTE_TABLE_ROUTEPROC_PROTOCOL (proto);
/* Get the name of the routing protocol */
strcpy (rou
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -