[Unit]
Description=Intelligent Network Monitoring service
-After=dbus.service network-pre.target systemd-sysusers.service net-config.service
-Before=network.target multi-user.target shutdown.target
+After=net-config.service connman.service
[Service]
Type=dbus
Name: inm-manager
Summary: INM(Intelligent Network Monitoring) daemon
-Version: 0.0.34
+Version: 0.0.35
Release: 1
Group: Network & Connectivity/Other
License: Apache-2.0
SupportGatewayMonitoring=True
SupportRtnlMonitoring=false
SupportArpMonitoring=True
-SupportIfaceMonitoring=True
+SupportIfaceMonitoring=false
SupportRetryTxRateMonitoring=false
\ No newline at end of file
static int __inm_check_congestion_status(int *status)
{
+ __INM_FUNC_ENTER__;
double prev_transmit = -1;
double curr_transmit = -1;
double prev_retrans = -1;
if (buffer)
free(buffer);
*status = retrans_rate;
+ __INM_FUNC_EXIT__;
return 0;
}
static gboolean __sock_channel_io_cb(GIOChannel *source,
GIOCondition condition, gpointer data)
{
+ INM_LOGI("");
inm_gio_channel_s *gio_channel;
ares_socket_t read_fd = ARES_SOCKET_BAD;
ares_socket_t write_fd = ARES_SOCKET_BAD;
write_fd = gio_channel->fd;
/* We should think about when do we call this? */
+
ares_process_fd(gio_channel->ares_ch, read_fd, write_fd);
if (g_default_dns_lookup_data->is_lookup_finished)
__destroy_default_dns_lookup_data();
-
+ INM_LOGI("");
return TRUE;
}
if (g_p_gdbus_mon->watching_cb[INM_DBUS_TYPE_STC])
g_p_gdbus_mon->watching_cb[INM_DBUS_TYPE_STC](FALSE);
}
+ __INM_FUNC_EXIT__;
}
static inline const gchar *__get_bus_name(inm_gdbus_type type)
static void __nl_message(void *buf, size_t length, gpointer user_data)
{
- INM_LOGE("");
+ __INM_FUNC_ENTER__;
while (length > 0) {
struct nlmsghdr *hdr = buf;
iface_mon_data_s *data = (iface_mon_data_s *)user_data;
data->cb((char *)ifname, status, data->cb_user_data);
}
}
-
+ INM_LOGI("hdr->nlmsg_len %d", hdr->nlmsg_len);
length -= hdr->nlmsg_len;
buf += hdr->nlmsg_len;
}
+ __INM_FUNC_EXIT__;
}
static gboolean __inm_netlink_event(GIOChannel *channel, GIOCondition cond, gpointer user_data)
static void __inmmanager_print_ies(inmmanager_mon_data_s *data, unsigned char *ie, int ielen)
{
+ __INM_FUNC_ENTER__;
while (ielen >= 2 && ielen >= ie[1]) {
if (ie[0] < ARRAY_SIZE(ie_printers) &&
ie_printers[ie[0]].name) {
ielen -= ie[1] + 2;
ie += ie[1] + 2;
}
+ __INM_FUNC_EXIT__;
}
static inmmanager_chan_info_s *__inmmanager_find_chan(inmmanager_chan_intf_info_s *intf_info, int freq)
static gboolean __inmmanager_send_netlink_cmd(gpointer user_data)
{
+ __INM_FUNC_ENTER__;
int err;
struct nl_msg *msg;
inmmanager_mon_data_s *data = (inmmanager_mon_data_s*)user_data;
}
/** Receive the kernel message. */
- while (err > 0)
+ while (err > 0) {
nl_recvmsgs(global->socket, global->cb);
+ }
INM_LOGI("Kernel message received");
out:
nlmsg_free(msg);
+ __INM_FUNC_EXIT__;
return TRUE;
}
static unsigned short __checksum(unsigned short *buf, int len)
{
+ __INM_FUNC_ENTER__;
int sum = 0;
int left = len;
u_short *word = buf;
sum = (sum >> 16) + (sum & 0xffff);
sum += (sum >> 16);
-
+ __INM_FUNC_EXIT__;
return (unsigned short)(~sum);
}