📄 ip_notif_log_support.ex.c
字号:
" 2. If this node model was manually modified,\n"
" recreate it using Device Creator.\n",
num_cattr_rows, total_num_phy_intf);
FOUT;
}
void
ipnl_cfgwarn_compcfg (int intf_index, int subintf_row_num)
{
char subintf_name_str[128];
/** Description of the condition flagged by this **/
/** notification log message. **/
FIN (ipnl_cfgwarn_compcfg (intf_index, subintf_row_num))
if (IPC_SUBINTF_PHYS_INTF == subintf_row_num)
{
/* This is the physical interface. */
/* Set the subintf_name_str to the null string */
strcpy (subintf_name_str, "");
}
else
{
/* This is a subinterface. Create an appropriate*/
/* string for output */
sprintf (subintf_name_str, "subinterface %d of ", subintf_row_num);
}
op_prg_log_entry_write (
ip_config_warning_loghndl,
"WARNING:\n"
" Could not apply TCP/IP Header Compression\n"
" to the datagram to be forwarded through\n"
" %s the interface %d.\n"
"Forwarding the datagram uncompressed.\n"
"\n"
"CAUSE:\n"
" The size of the datagram is greater than\n"
" the mtu of the interface.\n"
"\n"
"NOTE:\n"
" TCP/IP Header Compression is a compression\n"
" scheme used for IP datagrams with\n"
" relatively small payload transferred on\n"
" slow links.\n"
"\n"
"SUGGESTIONS:\n"
" 1) Reduce the size of IP datagram by\n"
" reducing the application size.\n"
" 2) Increase the mtu of interface %d\n"
" 3) Use another compression method for\n"
" interface %d\n",
intf_index, subintf_name_str, intf_index, intf_index);
FOUT
}
void
ipnl_unnumbered_interface_made_auto_assigned (char* iface_name)
{
/** Detected an unnumbered interface that is not **/
/** running ospf. it will be made auto assigned. **/
FIN (ipnl_unnumbered_interface_made_auto_assigned (iface_name));
op_prg_log_entry_write (
ip_config_error_loghndl,
"ERROR(S):\n"
" The interface %s of this node was configured as\n"
" \"Unnumbered\", but the routing protocol on this\n"
" interface was not set to OSPF. Currently \n"
" all unnumbered interfaces are required\n"
" to run ospf as the only routing protocol.\n"
"\n"
"SUGGESTION(s):\n"
"1. Set the address of this interface to \"Auto Assigned\"\n"
"2. Manually assign a valid IP address to this interface.\n"
"3. Set the routing protocol on this interface to ospf.\n"
"\n"
"RESULT(s):\n"
"1. The address of this interface will be set to\n"
" \"Auto Assigned\".\n",
iface_name);
FOUT;
}
void
ipnl_cfgwarn_unnumbered_intf_not_dumb (Objid node_id, const char* iface_name)
{
static OmsT_Log_Handle oms_log_handle = OMSC_LOG_HANDLE_INVALID;
char node_hname [OMSC_HNAME_MAX_LEN];
/** Encountered an unnumbered interface that does not seem **/
/** to be point to point. Write a summary log message waring**/
/** the user that such interfaces might not function **/
/** correctly unless the lower layer can ensure that the **/
/** the interface is actually point to point. **/
FIN (ipnl_cfgwarn_unnumbered_intf_not_dumb (node_id, iface_name));
/* If this the first time this function is being called, */
/* create an oms_log handle for the log message. */
if (OMSC_LOG_HANDLE_INVALID == oms_log_handle)
{
oms_log_handle = oms_log_handle_create (OpC_Log_Category_Configuration,
"IP", "Model_Configuration_Warning", 100, op_sim_time (),
"WARNING(S):\n"
"1. Encountered at least one unnumbered interface that\n"
" has a lower layer or is a radio interface and hence\n"
" might not be point-to-point. Only point-to-point\n"
" interfaces can be unnumbered. The list of all such\n"
" interfaces in the network are given at end of this\n"
" log message.\n"
"\n"
"SUGGESTION(S):\n"
"1. For each of the following interfaces, the lower\n"
" layer/radio transceiver configuration must be\n"
" such that at any instant of time, it can only\n"
" reach one other interface.\n"
"\n"
"RESULT(S):\n"
"1. If any of these interfaces is not point-to-point\n"
" the interface might not work correctly\n\n", "");
}
/* Write out the node name and the interface name. */
oms_tan_hname_get (node_id, node_hname);
oms_log_message_append (oms_log_handle, "%-30s: %s\n", node_hname, iface_name);
FOUT;
}
void
ipnl_invalid_unnumbered_source_intf_log_write (const char* unnumbered_intf_name, const char* src_intf_name)
{
/** The source interface specified for an unnumbered interface is **/
/** invalid. Write a log message warning the user that the interface**/
/** will be disabled. **/
FIN (ipnl_invalid_unnumbered_source_intf_log_write ( unnumbered_intf_name, src_intf_name));
op_prg_log_entry_write (
ip_config_error_loghndl,
"ERROR(S):\n"
" The interface \"%s\", referenced by the\n"
" unnumbered interface \"%s\", is invalid.\n"
"\n"
"POSSIBLE CAUSE(S):\n"
"1. There is no interface named \"%s\" on this node.\n"
"2. The interface exists, but it is not connected\n"
" and its address is set to 'Auto Assigned'.\n"
"3. Its address is set to 'No IP Address'.\n"
"4. The interface was ignored because of a\n"
" configuration error.\n"
"\n"
"SUGGESTION(S):\n"
"1. Make sure that the specified interface exists\n"
" and is assigned a valid IPv4 address.\n"
"2. Look for any earlier log messages that might\n"
" explain why the interface was ignored.\n"
"\n"
"RESULT(S):\n"
"1. The interface \"%s\" will be ignored.",
src_intf_name, unnumbered_intf_name, src_intf_name,
unnumbered_intf_name);
FOUT;
}
void
ipnl_protwarn_pkformat (SimT_Pk_Id pkid, SimT_Pk_Id pktreeid, const char* pkformat)
{
/** Description of the condition flagged by this **/
/** notification log message. **/
FIN (ipnl_protwarn_pkformat (pkid, pktreeid, pkformat))
op_prg_log_entry_write (
ip_prot_warning_loghndl,
"WARNING(S):\n"
" A packet with the wrong format has been\n"
" received by the IP model.\n"
" \tRcvd. Packet ID\t\t= " SIMC_PK_ID_FMT "\n"
" \tRcvd. Packet Tree ID\t= " SIMC_PK_ID_FMT "\n"
" \tRcvd. Packet Format\t= %s\n"
"\n"
" Expected Packet Format is \"ip_dgram_v4\".\n"
"\n"
"POSSIBLE CAUSE(S):\n"
" The underlying data link protocol(s) have\n"
" routed the packet incorrectly to IP.\n"
" Examples of data link protocols are ATM\n"
" Frame Relay and Ethernet.\n"
"\n"
"SUGGESTIONS:\n"
" Check the simulation log for messages from\n"
" data link models that may indicate a\n"
" possible problem.\n",
pkid, pktreeid, pkformat);
FOUT
}
void
ipnl_protwarn_mcast_no_major_port_specified (Packet* pkptr, InetT_Address dest_addr)
{
char dest_addr_str [IPC_ADDR_STR_LEN];
/** Reports a log message to indicate that no major and **/
/** minor information is specified for the multicast packet.**/
FIN (ipnl_protwarn_mcast_no_major_port_specified (pkptr, dest_addr));
/* Get a printable version of the address. */
inet_address_print (dest_addr_str, dest_addr);
op_prg_log_entry_write (
ip_prot_warning_loghndl,
"WARNING(S):\n"
" Application joining the multicast\n"
" group [%s], did not specify\n"
" the major port information for the\n"
" multicast packet [Pkt ID: " SIMC_PK_ID_FMT ",\n"
" Pkt Tree ID: " SIMC_PK_ID_FMT "].\n"
"\n"
"ACTION(S):\n"
" Sending the multicast packet on\n"
" the 0th major port.\n"
"\n"
"SUGGESTION(S):\n"
" Specify the major and minor port\n"
" values for the packet that needs to be\n"
" multicasted in the ICI\n"
" ip_encap_req.v4.\n"
"\n",
dest_addr_str, op_pk_id (pkptr), op_pk_tree_id (pkptr));
FOUT;
}
void
ipnl_protwarn_mcast_custom_invalid_application_req (void)
{
/** Reports a log message to indicate that a **/
/** Join/Leave request cannot be received from **/
/** an application when custom multicast routing**/
/** protocol is being used. **/
FIN (ipnl_protwarn_mcast_custom_invalid_application_req (void));
op_prg_log_entry_write (
ip_prot_warning_loghndl,
"WARNING(S):\n"
" Received a Join or Leave IP multicast\n"
" group request for the standard IGMP model\n"
" from the application layer. However, custom\n"
" multicast routing protocol is specified.\n"
"\n"
"ACTION(S):\n"
" Ignoring this request from the application.\n"
"\n"
"POSSIBLE CAUSE(S):\n"
" Custom multicast routing protocol is being\n"
" used and application is sending a Join/Leave\n"
" IP multicast group request to standard IGMP,\n"
" but standard IGMP is disabled.\n"
"\n"
"SUGGESTION(S):\n"
" When custom multicast routing protocol is being\n"
" used, application should send Join/Leave IP\n"
" multicast group request to custom IGMP model.\n"
"\n");
FOUT;
}
void
ipnl_protwarn_mcast_invalid_application_req (void)
{
/** Reports a log message to indicate that an **/
/** invalid request has been received from **/
/** an multicast application **/
FIN (ipnl_protwarn_mcast_invalid_application_req (void));
op_prg_log_entry_write (
ip_prot_warning_loghndl,
"WARNING(S):\n"
" Expecting a Join or Leave IP multicast\n"
" group request from the application, but\n"
" received an invalid request.\n"
"\n"
"ACTION(S):\n"
" Ignoring this request from the application.\n"
"\n"
"POSSIBLE CAUSE(S):\n"
" The application has used wrong value\n"
" for the request type. The valid values\n"
" are:\n"
" IpC_Igmp_Host_Join_Req and\n"
" IpC_Igmp_Host_Leave_Req\n"
" Note: These constants are defined in\n"
" ip_igmp_support.h include file\n"
"\n"
"SUGGESTION(S):\n"
" Use the above mentioned constants for\n"
" the request type.\n"
"\n");
FOUT;
}
void
ipnl_protwarn_mcast_invalid_intf (const char* intf_name)
{
/** Reports a log message to indicate that multicast **/
/** is disabled on the given interface **/
FIN (ipnl_protwarn_mcast_invalid_intf (intf_name));
op_prg_log_entry_write (
ip_prot_warning_loghndl,
"WARNING(S):\n"
" An application is trying to Join/Leave an\n"
" IP multicast group on the IP interface, %s,\n"
" but this interface is not enabled for\n"
" multicasting.\n"
"\n"
"ACTION(S):\n"
" Ignoring the Join/Leave request received\n"
" from the application.\n"
"\n"
"POSSIBLE CAUSE(S):\n"
" 1. The IP interface, %s is not enabled for\n"
" IP multicasting.\n"
" 2. The IP interface, %s is not connected\n"
" 3. The interface number, %s is an invalid\n"
"\n"
"SUGGESTION(S):\n"
" Make sure that the IP interface specified in\n"
" the Join/Leave request:\n"
" a) Is enabled for IP multicasting. This can\n"
" be done by enabling \"Multicast Mode\" \n"
" in \"IP Host Parameters.\n"
" b) Is connected to a link.\n"
" c) Is a valid interface number.\n"
"\n",
intf_name, intf_name, intf_name, intf_name);
FOUT;
}
void
ipnl_protwarn_mcast_rte_cannot_join_leave_grp (char* ip_addr_str, int ip_intf_num)
{
/** Reports a log message to indicate that an application in **/
/** a multicast router cannot Join or Leave a multicast group **/
FIN (ipnl_protwarn_mcast_rte_cannot_join_leave_grp (ip_addr_str, ip_intf_num));
op_prg_log_entry_write (
ip_prot_warning_loghndl,
"WARNING(S):\n"
" An application in a multicast router is trying\n"
" to Join/Leave the multicast group, %s\n"
" on the IP interface, %d. Applications in multicast\n"
" routers cannot Join/Leave a multicast group. Only\n"
" applications on multicast hosts are allowed to\n"
" Join/Leave a group.\n"
"\n"
"ACTION(S):\n"
" Ignoring the Join/Leave request received from\n"
" the application.\n"
"\n",
ip_addr_str, ip_intf_num);
FOUT;
}
void
ipnl_protwarn_mcast_cannot_fwd_pkt_to_intf (Packet* pkptr, char* intf_name)
{
/** Reports a log message to indicate that a multicast **/
/** packet cannot be forwarded to an IP interface **/
FIN (ipnl_protwarn_mcast_cannot_fwd_pkt_to_intf (pkptr, intf_name));
op_prg_log_entry_write (
ip_prot_warning_loghndl,
"WARNING(S):\n"
" The IP multicast packet [Pkt ID: " SIMC_PK_ID_FMT ",\n"
" Pkt Tree ID: " SIMC_PK_ID_FMT "] cannot be forwarded\n"
" to the IP interface, %s.\n"
"\n"
"ACTION(S):\n"
" Discarding the IP multicast packet.\n"
"\n"
"POSSIBLE CAUSE(S):\n"
" 1. The IP interface, %s is not enabled\n"
" for IP multicasting.\n"
" 2. The IP interface, %s is not connected\n"
" to any link.\n"
" 3. The IP interface number, %s is an\n"
" invalid interface number.\n"
"\n"
"SUGGESTION(S):\n"
" 1. If this node is a router, add the interface \n"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -