-
added 8 commits
-
5625f6f2...cab8791f - 7 commits from branch
GNOME:master
- b2e590a4 - Fix merge conflict in jhbuild_modif branch
Toggle commit list -
5625f6f2...cab8791f - 7 commits from branch
-
changed the description
Toggle commit list -
-
added 78 commits
- 8bd537f6 - Add directory traversal of /proc
- a9cad964 - Add file parsing for /proc/net/tcp
- 193190f9 - Add parsing of network connections from /proc/net/ files
- 27add439 - Add test for netsocket.c
- 0482134a - Add hashTable to store inode and pid
- 53394f32 - Add test for proc_inode_parse.c
- d6963d4f - Add glib version of dir traversal
- 295119c3 - dev_handles : Open pcap handles for network interfaces
- 72f85edc - Test for checking the opened pcap handles for network devices
- f8a584ec - Change the dir name approach to GFile
- 053936c4 - GFile changes in the args
- 0c311572 - Add GError for error handling
- 016c3746 - Switched to GINT_TO_POINTER
- 670736c1 - Replace malloc with g_slice_new
- fffd2464 - Minor changes in test file
- aba855b2 - Fix warning
- 5be88740 - coding style fixes
- 1e57f5ba - Add Interface's local address
- 99959fa3 - Add local address to interfaces
- ba33364f - Add functions for manipulating packets
- 6a85c65f - Add connections details to keep track of relevant packets
- 4a5b9bc2 - Add process details to track corresponding connections
- 0b5560fc - Add callback for tcp
- ea04658b - Add more packet functions
- 5b95d02b - Add hash table for socket details and inode
- 9aa44716 - Add packet processing functions
- 515b4a59 - Modifications in packet function prototypes
- a2a6f67c - Fix struct member name issues
- 24c67dd9 - Add structs for network stats output
- 5b1cfa22 - Add main testing file
- c3e87809 - Redefinition issues fixed
- d90c5516 - Add packet hash to packet struct
- bda2f65b - dev_handles.c : Modify packet processing functions
- f739c742 - dev_handles.h: Add definition of packet headers
- 215e0874 - connection: Modify the connection matching functions
- 55478d8a - This commit has to be broken down into patches
- bfecdbbe - Separate the headers and tests
- 99937f69 - add missing files to Makefile
- 5d66652a - Add Gio dependency
- 97188a52 - Add Symbols to MakeFile
- d47b8dfa - Add LIBGTOP prefix to header guards
- 632e5de0 - Change Process_list to GSList
- 399bc42e - Change Conn_list to GSList
- a0d8a145 - Replace u_int data types by their GLib alternatives
- 56932f95 - Change Packet_list to GSList
- 01b8aa02 - Add new headers to the list of introspectables
- 8b234c41 - Change the network_stats_entry struct
- 015a0850 - Add network stats cmd to the daemon
- 01a9a738 - Change flags to enable Daemon for Linux
- 9eb6cf9b - Define the libgtop_sysdeps_suid library for Linux
- 7d763cd1 - Add glibtop_init_p in Linux
- 196a1482 - Change the local_addr field in struct glibtop_socket
- 33338076 - Add glibtop_open_p function
- f9378661 - Remove the error logs
- c34bf34c - Add DBus Interface to get the stats
- be0bc1c6 - Change the output GVariant
- 47c2da9d - Add capture status function
- d169d3df - Add capture initializer function to DBus
- 0b892b00 - Change Daemon settings for Linux
- 518fd81b - Move the DBus example to examples dir
- 4d72a46c - Add packet capture init function to stats
- fcbfca91 - Add GPtrArray for the dbus_stats
- 7e017fb2 - Add parameter in the get_stats_instance invocation
- c401e91e - Change the condition for keeping the capture active
- f7a9f290 - Rename the toggle_capture_status function
- 91b27483 - WIP: Add the dictionary for DBus Messages
- 05e01a13 - Remove proc_name from various structs
- bdcf3abc - Fix the issue in dictionary in GVariants
- 07bb0648 - Add g_timeout_add in the dbus interface
- 2cdddea6 - Fix timeout issue in DBus interface
- 738086d0 - Add check to stop the packet capture
- 38cee26a - Fix segfault in GetStats
- 502a95a0 - Add config files for DBus
- d6d5e201 - Add set and reset functions to dbus-interface
- f1f229c8 - Discard values ~0.00 in the network stats
- e9bdd8ac - Activate the packet capture in the network test example
- bc3a0250 - Use g_error wherever required
- 050ba450 - Fix warnings during compilation
Toggle commit list -
-
-
-
-
dbus_config/org.gnome.GTop.NetStats.service 0 → 100644
1 [D-BUS Service] 2 Name=org.gnome.GTop.NetStats 3 Exec=~/.cache/jhbuild/build/libgtop/examples/dbus_interface -
Master
This harcoded path is surely not correct, but no idea yet what to use here, we'll probably need to generate this dbus service file using autotools to include the real path based on the prefix autotools was configured with.
-
-
11 11 12 12 noinst_PROGRAMS = first second pprint procargs df netlist \ 13 13 mountlist procmap netload sysdeps timings \ 14 openfiles smp proclist free wd affinity diskio 14 openfiles smp proclist free wd affinity diskio devtest dbus_interface -
Master
We will surely need the dbus_interface installed, so let's move it to somewhere else. Probably not inside examples but rather inside the daemon directory.
-
-
-
added 78 commits
- 6d36f952 - Add directory traversal of /proc
- a99fcf92 - Add file parsing for /proc/net/tcp
- ed1bdf8f - Add parsing of network connections from /proc/net/ files
- 8946ce74 - Add test for netsocket.c
- 291d555d - Add hashTable to store inode and pid
- 517f750e - Add test for proc_inode_parse.c
- 74e56b58 - Add glib version of dir traversal
- 4f4127fd - dev_handles : Open pcap handles for network interfaces
- 0df6c8df - Test for checking the opened pcap handles for network devices
- b4be0c8b - Change the dir name approach to GFile
- 7fd26234 - GFile changes in the args
- b58fdef5 - Add GError for error handling
- 11cacfe4 - Switched to GINT_TO_POINTER
- ca8515dd - Replace malloc with g_slice_new
- 1c1a8515 - Minor changes in test file
- 6519029f - Fix warning
- ef8e091e - coding style fixes
- 830a9430 - Add Interface's local address
- 297d7ad4 - Add local address to interfaces
- a6ae2722 - Add functions for manipulating packets
- 001ea6c5 - Add connections details to keep track of relevant packets
- 5c883514 - Add process details to track corresponding connections
- 64ade368 - Add callback for tcp
- 0173a0cf - Add more packet functions
- d2460b74 - Add hash table for socket details and inode
- 1a0608ad - Add packet processing functions
- 5fd47603 - Modifications in packet function prototypes
- c6ba6983 - Fix struct member name issues
- 1faede8c - Add structs for network stats output
- 447e579e - Add main testing file
- 2df84811 - Redefinition issues fixed
- 818d2e6a - Add packet hash to packet struct
- b4cde82d - dev_handles.c : Modify packet processing functions
- c9475686 - dev_handles.h: Add definition of packet headers
- 56aebb48 - connection: Modify the connection matching functions
- d91445da - This commit has to be broken down into patches
- 9c0f7b74 - Separate the headers and tests
- 87ee8482 - add missing files to Makefile
- 1c32220e - Add Gio dependency
- 63e285a3 - Add Symbols to MakeFile
- b94e173b - Add LIBGTOP prefix to header guards
- 59ae3667 - Change Process_list to GSList
- cc7d0ed9 - Change Conn_list to GSList
- d5e5a101 - Replace u_int data types by their GLib alternatives
- 4d4dad26 - Change Packet_list to GSList
- a09b0a54 - Add new headers to the list of introspectables
- 7f9f3d1e - Change the network_stats_entry struct
- 99e3efa0 - Add network stats cmd to the daemon
- 669d40be - Change flags to enable Daemon for Linux
- 03fdf8d6 - Define the libgtop_sysdeps_suid library for Linux
- fb595da7 - Add glibtop_init_p in Linux
- e980c6bd - Change the local_addr field in struct glibtop_socket
- 735333be - Add glibtop_open_p function
- 845517cf - Remove the error logs
- 343e582b - Add DBus Interface to get the stats
- 990aadee - Change the output GVariant
- c046d6a3 - Add capture status function
- 5053b599 - Add capture initializer function to DBus
- 21e6383f - Change Daemon settings for Linux
- 23d50dd4 - Move the DBus example to examples dir
- d8e85a37 - Add packet capture init function to stats
- ddbfb8fc - Add GPtrArray for the dbus_stats
- a6272a85 - Add parameter in the get_stats_instance invocation
- 33907c68 - Change the condition for keeping the capture active
- a502cfea - Rename the toggle_capture_status function
- f7ec73dc - WIP: Add the dictionary for DBus Messages
- 18fdd98a - Remove proc_name from various structs
- 7a01cd6a - Fix the issue in dictionary in GVariants
- d46b5aa0 - Add g_timeout_add in the dbus interface
- bcfde989 - Fix timeout issue in DBus interface
- 216086de - Add check to stop the packet capture
- 68d622ba - Fix segfault in GetStats
- 5fd8826b - Add config files for DBus
- a73cb0e0 - Add set and reset functions to dbus-interface
- cb31e29c - Discard values ~0.00 in the network stats
- 8865f9c7 - Activate the packet capture in the network test example
- aa2f29c0 - Use g_error wherever required
- cad22c04 - Fix warnings during compilation
Toggle commit list -
-
-
-
Toggle commit list
-
Toggle commit list
-
Toggle commit list
-
-
include/glibtop/interface_local_addr.h 0 → 100644
1 #ifndef __GLIBTOP_INTERFACE_LOCAL_ADDR_H__ 2 #define __GLIBTOP_INTERFACE_LOCAL_ADDR_H__ 3 4 #include <sys/types.h> 5 #include <ifaddrs.h> 6 #include <glib.h> 7 #include <sys/socket.h> 8 #include <netinet/in.h> 9 10 typedef struct _local_addr local_addr; 11 struct _local_addr 12 { 13 in_addr_t addr; //ip in network Byte order 14 struct in6_addr addr6; 15 short int sa_family; 16 char *ip_text; //to store ip in text form -
Master
How is it allocated/deallocated ?
-
Master
I'm talking about the
ip_text
field ? Maybe you could even make it an array instead of pointer. -
1
I kept it as ptr just to not bring in sized allocations
But as we already know the ip size I can surely make the changes if you want :)
-
-
1
I've made the req. changes
-
Master
I think that you need at least 40+1 bytes to store an IPv6 address, for example "fe80:0000:0000:0000:020f:bbff:feb8:f89e". So 30 is not enough.
-
-
-
77 77 glibtop_map_entry_get_type 78 78 glibtop_proc_map_get_type 79 79 glibtop_get_type 80 get_global_hashes_instance -
Master
Could you please prefix all public symbols with glibtop_ ? Would it also be possible to prefix accordingly all public types ?
-
-
1
@bdejean you may now have a look at the current diff , it just has the public API exposed
Pls let me know your views!
-
Master
OK, I'm not sure about the names, but the exposed interface is definitely smaller.
-
-
-
-
-
-
include/glibtop/dev_handles.h 0 → 100644
48 struct in6_addr ip6_src; 49 struct in6_addr ip6_dst; 50 }; 51 /*Defining the headers as those available in netinet_*.h are having issues when parsing for ports*/ 52 #define SNAP_LEN 1518 53 #define SIZE_ETHERNET 14 54 #define ETHER_ADDR_LEN 6 55 /* Ethernet header */ 56 struct hdr_ethernet { 57 u_char ether_dhost[ETHER_ADDR_LEN]; 58 u_char ether_shost[ETHER_ADDR_LEN]; 59 u_short ether_type; 60 }; 61 62 /* IP header */ 63 struct hdr_ip { -
Master
For all these kind of structs that implement a RFC, I think we either need a packed attribute or simply a G_STATIC_ASSERT to validate the size, don't we ?
-
-
-
11 11 procsegment.c procargs.c procmap.c siglist.c \ 12 12 sysinfo.c netload.c ppp.c glibtop_private.c \ 13 13 mountlist.c procaffinity.c procio.c \ 14 fsusage.c netlist.c procopenfiles.c procwd.c 14 fsusage.c netlist.c procopenfiles.c procwd.c \ 15 proc_inode_parser.c netsockets.c \ -
Master
General question: is this code really specific ? Shouldn't it go to common instead ?
-
1
We can't move the following files to common because they are specific to the Linux fs:
- procopenfiles.c
- proc_inode_parser
- netsockets
But the packet parsing files can be moved to common , again because after parsing they make use of function calls defined in the above files , so indirectly it means that even those are getting more specific
In case we want to move the packet processing part to
common/
, pls let me know , few slight changes will be good enough to separate the generic part of the code tocommon/
-
Master
If the packet processing is generic enough, yes, it's definitely a start to move it common/
-
-
-
-
-
-
-
sysdeps/linux/packet.c 0 → 100644
1 #include <glibtop/packet.h> 2 #include <glib.h> 3 #include <glibtop/interface_local_addr.h> 4 #include <glibtop/dev_handles.h> 5 #include <arpa/inet.h> 6 #include <stdlib.h> 7 8 void 9 Packet_init_in_addr(Packet *pkt, struct in_addr pkt_sip, unsigned short pkt_sport, struct in_addr pkt_dip, 10 unsigned short pkt_dport, guint32 pkt_len, struct timeval pkt_ts ,direction pkt_dir) 11 { 12 pkt->sa_family = AF_INET; -
Master
Maybe you want to memset(pkt, 0, sizeof pkt) the whole Packet first ?
-
-
-
-
-
-
sysdeps/linux/proc_inode_parser.c 0 → 100644
40 if (g_strcmp0(currentFile,"fd") == 0) 41 { 42 enter_fd = TRUE; 43 traverse_file(g_file_get_child(curdir, g_file_info_get_name(info_buf)), depth+1, pid, inode_table); 44 } 45 break; 46 } 47 } 48 else if (g_file_info_get_is_symlink(info_buf)) 49 { 50 gchar *symlink_name = g_build_filename(g_file_get_path(curdir), currentFile, NULL); 51 gchar *slnk_buf = g_file_read_link(symlink_name, NULL); 52 if (slnk_buf != NULL) 53 { 54 int inode; 55 int match = sscanf(slnk_buf, "socket:[%d]\n", &inode); -
Master
I think you should use at least an
unsigned long
instead with%lu
format. Or even aguint64
and"socket:[" G_GUINT64_FORMAT "]\n"
.
-
-
sysdeps/linux/proc_inode_parser.c 0 → 100644
44 } 45 break; 46 } 47 } 48 else if (g_file_info_get_is_symlink(info_buf)) 49 { 50 gchar *symlink_name = g_build_filename(g_file_get_path(curdir), currentFile, NULL); 51 gchar *slnk_buf = g_file_read_link(symlink_name, NULL); 52 if (slnk_buf != NULL) 53 { 54 int inode; 55 int match = sscanf(slnk_buf, "socket:[%d]\n", &inode); 56 if (match == 1) 57 { 58 int pid_int = g_ascii_strtoll(pid, NULL, 0); 59 g_hash_table_insert(inode_table, GINT_TO_POINTER(inode), GINT_TO_POINTER(pid_int)); -
Master
Then you'll probably need to allocate something instead of packing ints into pointers.
-
-
-
-
sysdeps/linux/stats.c 0 → 100644
24 25 static void 26 network_stats_print_entry(network_stats_entry *st) 27 { 28 printf("pid :%d \t sent_value:%f \trecv value:%f \t \n", st->pid, st->sent_value, st->recv_value); 29 } 30 31 32 void 33 network_stats_print_stat(GArray *stats,int nproc) 34 { 35 for(guint index = 0; index < (guint)nproc; index++) 36 { 37 network_stats_entry temp = g_array_index (stats, network_stats_entry, index); 38 network_stats_print_entry(&temp); 39 if(stats->len>index ) -
Master
I don't understand that if.
-
-
1
In case the number of processes have reduced in the next refresh cycle then to keep only the latest updated number of entries in the GArray , I'm deleting those entries which are beyond the range of the latest number of entries
But I've deleted this function because as per the discussions in other threads
print_*
functions shouldn't be exposed
-
-
-
-
-
-
-
-
-
Toggle commit list
-
-
Toggle commit list
-
Toggle commit list
-
Toggle commit list
-
-
-
added 94 commits
-
0d6a8a3e...35a0ba8e - 4 commits from branch
GNOME:master
- 9f99a620 - Add directory traversal of /proc
- 7da5e029 - Add file parsing for /proc/net/tcp
- 7ef01db5 - Add parsing of network connections from /proc/net/ files
- 294204a4 - Add test for netsocket.c
- cbe605bf - Add hashTable to store inode and pid
- 6e672dd7 - Add test for proc_inode_parse.c
- c312da68 - Add glib version of dir traversal
- 6a1e9337 - dev_handles : Open pcap handles for network interfaces
- 04da947f - Test for checking the opened pcap handles for network devices
- d6351f17 - Change the dir name approach to GFile
- 62f0013c - GFile changes in the args
- 9d236bb3 - Add GError for error handling
- dfe21cb2 - Switched to GINT_TO_POINTER
- 1bb526d4 - Replace malloc with g_slice_new
- 5dd7deb2 - Minor changes in test file
- c4cb26d5 - Fix warning
- 707cb7ad - coding style fixes
- 1153f96d - Add Interface's local address
- 77e1876f - Add local address to interfaces
- 5a3431d6 - Add functions for manipulating packets
- 0967cbf5 - Add connections details to keep track of relevant packets
- 5e6947d7 - Add process details to track corresponding connections
- b47de8ef - Add callback for tcp
- 30a40f27 - Add more packet functions
- a82d6754 - Add hash table for socket details and inode
- 360a0ee4 - Add packet processing functions
- 3ff43963 - Modifications in packet function prototypes
- 99eb516b - Fix struct member name issues
- 5fb75c27 - Add structs for network stats output
- 744c3afe - Add main testing file
- ca2a700a - Redefinition issues fixed
- 7c0e3de4 - Add packet hash to packet struct
- b7b4406a - dev_handles.c : Modify packet processing functions
- de344641 - dev_handles.h: Add definition of packet headers
- 4f246f4b - connection: Modify the connection matching functions
- a7b8c23b - This commit has to be broken down into patches
- 54fe9773 - Separate the headers and tests
- b93f6157 - add missing files to Makefile
- 6bdb6b18 - Add Gio dependency
- 618052ac - Add Symbols to MakeFile
- 3afb310a - Add LIBGTOP prefix to header guards
- 210e3dc0 - Change Process_list to GSList
- cca275c7 - Change Conn_list to GSList
- 871a0a8e - Replace u_int data types by their GLib alternatives
- 9fc66c3a - Change Packet_list to GSList
- 6a2badf2 - Add new headers to the list of introspectables
- 07349930 - Change the network_stats_entry struct
- bc62a98a - Add network stats cmd to the daemon
- 9043f84d - Change flags to enable Daemon for Linux
- e7b29d7e - Define the libgtop_sysdeps_suid library for Linux
- 2ade4b58 - Add glibtop_init_p in Linux
- f75be015 - Change the local_addr field in struct glibtop_socket
- ee43fcd9 - Add glibtop_open_p function
- cd6555d8 - Remove the error logs
- 157ccc06 - Add DBus Interface to get the stats
- 2779c87a - Change the output GVariant
- 12200d78 - Add capture status function
- 2f33f6f9 - Add capture initializer function to DBus
- 0f55aaa9 - Change Daemon settings for Linux
- fa32655d - Move the DBus example to examples dir
- c5ff9227 - Add packet capture init function to stats
- 15ba350a - Add GPtrArray for the dbus_stats
- 79e2eec1 - Add parameter in the get_stats_instance invocation
- a28097ef - Change the condition for keeping the capture active
- 8901b39f - Rename the toggle_capture_status function
- 50e7f227 - WIP: Add the dictionary for DBus Messages
- 6b8b216d - Remove proc_name from various structs
- e399c2c0 - Fix the issue in dictionary in GVariants
- 638ba82e - Add g_timeout_add in the dbus interface
- a2a56534 - Fix timeout issue in DBus interface
- a9501139 - Add check to stop the packet capture
- 72bffccf - Fix segfault in GetStats
- 20df42f6 - Add config files for DBus
- 55559e8f - Add set and reset functions to dbus-interface
- 90fb9e3e - Discard values ~0.00 in the network stats
- adaad6be - Activate the packet capture in the network test example
- eeba585a - Use g_error wherever required
- 5a6817a1 - Fix warnings during compilation
- 3de94ded - Return network stats as kb
- 11334ceb - Remove functions for bytes to kb conversion
- d1c8b999 - Add PCAP_LIBS variable to configure.ac
- cfc41c86 - API should return bytes transferred
- 38a74f76 - Remove printf statements
- 464f62af - Prefix glibtop to public API
- ba1d787d - Minor changes in some func defintions
- 3bf1e71d - Use free function to free the DBus stats
- 764105e2 - Rename glibtop_init_stats to glibgtop_init_netstats
- 5acc0c5c - Use time_t wherever required
- c64a8159 - Replace ptr by array
- 896595d7 - Keep double in DBus Interface
Toggle commit list -
0d6a8a3e...35a0ba8e - 4 commits from branch
-
added 2 commits
Toggle commit list