mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-11 10:38:12 +00:00
add REMOTESERVICE to port monitor peekables
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@615 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
6aef55aa00
commit
952447be94
3
AUTHORS
3
AUTHORS
@ -155,6 +155,9 @@ Toni <bleach at users dot sourceforge dot net>
|
||||
tyir <tyir at users dot sourceforge dot net>
|
||||
MPD features patch 1319461
|
||||
|
||||
Vivenzio Pagliari <vivenzio@web.de>
|
||||
Some useful patches for port monitoring
|
||||
|
||||
Walt Nelson <wnelsonjr at comcast dot net>
|
||||
$freq fix
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
# $Id$
|
||||
|
||||
2006-03-30
|
||||
* Added patch to support new port monitor REMOTESERVICE peekable.
|
||||
|
||||
2006-03-29
|
||||
* Scan port numbers as short. Fixes debian bug# 359974.
|
||||
|
||||
|
@ -2071,6 +2071,8 @@ static struct text_object *construct_text_object(const char *s, const char *arg,
|
||||
item=REMOTEHOST;
|
||||
else if ( strncmp(itembuf,"rport",31) == 0 )
|
||||
item=REMOTEPORT;
|
||||
else if ( strncmp(itembuf,"rservice",31) == 0 )
|
||||
item=REMOTESERVICE;
|
||||
else if ( strncmp(itembuf,"lip",31) == 0 )
|
||||
item=LOCALIP;
|
||||
else if ( strncmp(itembuf,"lhost",31) == 0 )
|
||||
|
@ -673,7 +673,18 @@ int peek_tcp_port_monitor(
|
||||
|
||||
snprintf( p_buffer, buffer_size, "%d", p_monitor->p_peek[ connection_index ]->remote_port );
|
||||
break;
|
||||
|
||||
|
||||
case REMOTESERVICE:
|
||||
|
||||
p_servent = getservbyport( htons(p_monitor->p_peek[ connection_index ]->remote_port ), "tcp" );
|
||||
/* if no service name found for the port, just use the port number. */
|
||||
if ( !p_servent || !p_servent->s_name ) {
|
||||
snprintf( p_buffer, buffer_size, "%d", p_monitor->p_peek[ connection_index ]->remote_port );
|
||||
} else {
|
||||
snprintf( p_buffer, buffer_size, "%s", p_servent->s_name );
|
||||
}
|
||||
break;
|
||||
|
||||
case LOCALIP:
|
||||
|
||||
net.s_addr = p_monitor->p_peek[ connection_index ]->local_addr;
|
||||
|
@ -83,7 +83,7 @@
|
||||
* ------------------------------------------------------------------- */
|
||||
|
||||
/* The inventory of peekable items within the port monitor. */
|
||||
enum tcp_port_monitor_peekables { COUNT=0, REMOTEIP, REMOTEHOST, REMOTEPORT, LOCALIP, LOCALHOST, LOCALPORT, LOCALSERVICE };
|
||||
enum tcp_port_monitor_peekables { COUNT=0, REMOTEIP, REMOTEHOST, REMOTEPORT, REMOTESERVICE, LOCALIP, LOCALHOST, LOCALPORT, LOCALSERVICE };
|
||||
|
||||
/* ------------------------------------------------------------------------
|
||||
* A single tcp connection
|
||||
|
Loading…
Reference in New Issue
Block a user