Revision: 14634
Author: adrian.chadd
Date: Wed Apr 21 07:10:06 2010
Log: Begin breaking out some of the various icmp/pinger stuff into separate
header files.
http://code.google.com/p/lusca-cache/source/detail?r=14634
Added:
/branches/LUSCA_HEAD/src/icmp.h
/branches/LUSCA_HEAD/src/pinger.h
Modified:
/branches/LUSCA_HEAD/src/defines.h
/branches/LUSCA_HEAD/src/icmp.c
/branches/LUSCA_HEAD/src/main.c
/branches/LUSCA_HEAD/src/neighbors.c
/branches/LUSCA_HEAD/src/net_db.c
/branches/LUSCA_HEAD/src/pinger.c
/branches/LUSCA_HEAD/src/protos.h
/branches/LUSCA_HEAD/src/structs.h
/branches/LUSCA_HEAD/src/typedefs.h
=======================================
--- /dev/null
+++ /branches/LUSCA_HEAD/src/icmp.h Wed Apr 21 07:10:06 2010
@@ -0,0 +1,9 @@
+#ifndef __LUSCA_ICMP_H__
+#define __LUSCA_ICMP_H__
+
+extern void icmpOpen(void);
+extern void icmpClose(void);
+extern void icmpSourcePing(struct in_addr to, const icp_common_t *, const
char *url);
+extern void icmpDomainPing(struct in_addr to, const char *domain);
+
+#endif
=======================================
--- /dev/null
+++ /branches/LUSCA_HEAD/src/pinger.h Wed Apr 21 07:10:06 2010
@@ -0,0 +1,26 @@
+#ifndef __LUSCA_PINGER_H__
+#define __LUSCA_PINGER_H__
+
+#define PINGER_PAYLOAD_SZ 8192
+
+struct _pingerEchoData {
+ struct in_addr to;
+ unsigned char opcode;
+ int psize;
+ char payload[PINGER_PAYLOAD_SZ];
+};
+
+struct _pingerReplyData {
+ struct in_addr from;
+ unsigned char opcode;
+ int rtt;
+ int hops;
+ int psize;
+ char payload[PINGER_PAYLOAD_SZ];
+};
+
+typedef struct _pingerEchoData pingerEchoData;
+typedef struct _pingerReplyData pingerReplyData;
+
+
+#endif
=======================================
--- /branches/LUSCA_HEAD/src/defines.h Sun Apr 18 07:02:18 2010
+++ /branches/LUSCA_HEAD/src/defines.h Wed Apr 21 07:10:06 2010
@@ -154,8 +154,6 @@
#define STORE_ENTRY_WITH_MEMOBJ 1
#define STORE_ENTRY_WITHOUT_MEMOBJ 0
-#define PINGER_PAYLOAD_SZ 8192
-
#define COUNT_INTERVAL 60
/*
* keep 60 minutes' worth of per-minute readings (+ current reading)
=======================================
--- /branches/LUSCA_HEAD/src/icmp.c Mon Nov 2 21:37:35 2009
+++ /branches/LUSCA_HEAD/src/icmp.c Wed Apr 21 07:10:06 2010
@@ -38,6 +38,9 @@
#if USE_ICMP
+#include "pinger.h"
+#include "icmp.h"
+
#define S_ICMP_ECHO 1
#if ALLOW_SOURCE_PING
#define S_ICMP_ICP 2
=======================================
--- /branches/LUSCA_HEAD/src/main.c Mon Apr 19 22:01:43 2010
+++ /branches/LUSCA_HEAD/src/main.c Wed Apr 21 07:10:06 2010
@@ -34,6 +34,7 @@
*/
#include "squid.h"
+#include "icmp.h"
#include "client_db.h"
#include "pconn.h"
=======================================
--- /branches/LUSCA_HEAD/src/neighbors.c Sun Jul 26 21:46:32 2009
+++ /branches/LUSCA_HEAD/src/neighbors.c Wed Apr 21 07:10:06 2010
@@ -34,6 +34,7 @@
*/
#include "squid.h"
+#include "icmp.h"
/* count mcast group peers every 15 minutes */
#define MCAST_COUNT_RATE 900
=======================================
--- /branches/LUSCA_HEAD/src/net_db.c Sat Jan 17 12:15:04 2009
+++ /branches/LUSCA_HEAD/src/net_db.c Wed Apr 21 07:10:06 2010
@@ -34,6 +34,7 @@
*/
#include "squid.h"
+#include "icmp.h"
static MemPool * pool_netdb_name;
static MemPool * pool_netdb_entry;
=======================================
--- /branches/LUSCA_HEAD/src/pinger.c Thu Jan 15 14:33:06 2009
+++ /branches/LUSCA_HEAD/src/pinger.c Wed Apr 21 07:10:06 2010
@@ -37,6 +37,8 @@
#if USE_ICMP
+#include "pinger.h"
+
/* Native Windows port doesn't have netinet support, so we emulate it.
* At this time, Cygwin lacks icmp support in its include files, so we need
* to use the native Windows port definitions.
=======================================
--- /branches/LUSCA_HEAD/src/protos.h Mon Apr 19 22:01:43 2010
+++ /branches/LUSCA_HEAD/src/protos.h Wed Apr 21 07:10:06 2010
@@ -259,11 +259,6 @@
extern void requestReadBody(request_t * request, char *buf, size_t size,
CBCB * callback, void *cbdata);
extern void requestAbortBody(request_t * request);
-extern void icmpOpen(void);
-extern void icmpClose(void);
-extern void icmpSourcePing(struct in_addr to, const icp_common_t *, const
char *url);
-extern void icmpDomainPing(struct in_addr to, const char *domain);
-
extern void *icpCreateMessage(icp_opcode opcode,
int flags,
const char *url,
=======================================
--- /branches/LUSCA_HEAD/src/structs.h Sun Apr 18 07:02:18 2010
+++ /branches/LUSCA_HEAD/src/structs.h Wed Apr 21 07:10:06 2010
@@ -1357,25 +1357,6 @@
aclCheck_t *acl_checklist;
};
-#if USE_ICMP
-struct _pingerEchoData {
- struct in_addr to;
- unsigned char opcode;
- int psize;
- char payload[PINGER_PAYLOAD_SZ];
-};
-
-struct _pingerReplyData {
- struct in_addr from;
- unsigned char opcode;
- int rtt;
- int hops;
- int psize;
- char payload[PINGER_PAYLOAD_SZ];
-};
-
-#endif
-
struct _icp_common_t {
unsigned char opcode; /* opcode */
unsigned char version; /* version number */
=======================================
--- /branches/LUSCA_HEAD/src/typedefs.h Sun Apr 18 07:02:18 2010
+++ /branches/LUSCA_HEAD/src/typedefs.h Wed Apr 21 07:10:06 2010
@@ -93,8 +93,6 @@
typedef struct _ping_data ping_data;
typedef struct _ps_state ps_state;
typedef struct _HierarchyLogEntry HierarchyLogEntry;
-typedef struct _pingerEchoData pingerEchoData;
-typedef struct _pingerReplyData pingerReplyData;
typedef struct _icp_common_t icp_common_t;
typedef struct _Meta_data Meta_data;
typedef struct _iostats iostats;
--
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en.