Make a description of ${cpu} variable not so confusing.
[monky] / src / libtcp-portmon.h
index c9f4aaf..e38df41 100644 (file)
 #ifndef LIBTCP_PORTMON_H
 #define LIBTCP_PORTMON_H
 
-#include <math.h>
-#include <netdb.h>
+#include <sys/socket.h>
+
+#include <arpa/inet.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
+
+#include <math.h>
+#include <netdb.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
+
 #include "hash.h"
 
 /* ------------------------------------------------------------------------------------------------
@@ -80,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 
@@ -103,7 +106,7 @@ typedef struct _tcp_connection_t {
  * ----------------------------------*/
 int copy_tcp_connection( 
        tcp_connection_t *                      /* p_dest_connection */,
-       tcp_connection_t *                      /* p_source_connection */
+       const tcp_connection_t *                /* p_source_connection */
        );
 
 /* ------------------------------------------------------------------------
@@ -269,7 +272,7 @@ tcp_port_monitor_t * create_tcp_port_monitor(
    The requested monitor value is copied into a client-supplied char buffer. 
    Returns 0 on success, -1 otherwise. */
 int peek_tcp_port_monitor(
-       tcp_port_monitor_t *                    /* p_monitor */,
+       const tcp_port_monitor_t *              /* p_monitor */,
        int                                     /* item, ( item of interest, from tcp_port_monitor_peekables enum ) */,
        int                                     /* connection_index, ( 0 to number of connections in monitor - 1 )*/,
        char *                                  /* p_buffer, buffer to receive requested value */,
@@ -304,7 +307,7 @@ int insert_tcp_port_monitor_into_collection(
 
 /* Clients need a way to find monitors */
 tcp_port_monitor_t * find_tcp_port_monitor( 
-       tcp_port_monitor_collection_t *         /* p_collection */, 
+       const tcp_port_monitor_collection_t *   /* p_collection */, 
        in_port_t                               /* port_range_begin */, 
        in_port_t                               /* port_range_end */ 
        );