svn commit: r211121 - in projects/sv/sys: net netinet

Attilio Rao attilio at FreeBSD.org
Mon Aug 9 22:19:23 UTC 2010


Author: attilio
Date: Mon Aug  9 22:19:22 2010
New Revision: 211121
URL: http://svn.freebsd.org/changeset/base/211121

Log:
  Export some informations because they will be used by the userland
  server application.
  Also do some BSDification (using the right s/u_/u for bits types and
  moving the payload of the msg to be using uint8_t).

Modified:
  projects/sv/sys/net/netdump_client.c
  projects/sv/sys/netinet/netdump.h

Modified: projects/sv/sys/net/netdump_client.c
==============================================================================
--- projects/sv/sys/net/netdump_client.c	Mon Aug  9 22:06:08 2010	(r211120)
+++ projects/sv/sys/net/netdump_client.c	Mon Aug  9 22:19:22 2010	(r211121)
@@ -99,35 +99,8 @@
 #define	NETDDEBUGV_IF(i, f, ...)
 #endif
 
-#define NETDUMP_PORT 20023      /* server udp port number for data */
-#define NETDUMP_ACKPORT 20024   /* client udp port number for acks */
-
-#define NETDUMP_DATASIZE 8192   /* how big to let the packets be */
-
-#define NETDUMP_HERALD 1        /* broadcast before starting a dump */
-#define NETDUMP_FINISHED 2      /* send after finishing a dump */
-#define NETDUMP_VMCORE 3        /* packet contains dump data */
-#define NETDUMP_KDH 4           /* packet contains kernel dump header */
-
 #define	NETDUMP_BROKEN_STATE_BUFFER_SIZE	(5 * sizeof(struct mtx))
 
-struct netdump_msg_hdr {
-	u_int32_t type;		/* NETDUMP_HERALD, _FINISHED, _VMCORE or _KDH */
-	u_int32_t seqno;	/* match acks with msgs */
-	u_int64_t offset;	/* vmcore offset, in bytes */
-	u_int32_t len;		/* attached data, in bytes */
-	u_int8_t pad[4];	/* Pad for parifying 32 and 64 bits */
-};
-
-struct netdump_msg {
-	struct netdump_msg_hdr hdr;
-	unsigned char data[NETDUMP_DATASIZE];/* real message may contain less */
-};
-
-struct netdump_ack {
-	u_int32_t seqno;	/* match acks with msgs */
-};
-
 static void	 nd_handle_arp(struct mbuf **mb);
 static void	 nd_handle_ip(struct mbuf **mb);
 static int	 netdump_arp_server(void);

Modified: projects/sv/sys/netinet/netdump.h
==============================================================================
--- projects/sv/sys/netinet/netdump.h	Mon Aug  9 22:06:08 2010	(r211120)
+++ projects/sv/sys/netinet/netdump.h	Mon Aug  9 22:19:22 2010	(r211121)
@@ -31,6 +31,33 @@
 #ifndef _NETINET_NETDUMP_H_
 #define _NETINET_NETDUMP_H_
 
+#define	NETDUMP_PORT		20023	/* Server udp port number for data. */
+#define	NETDUMP_ACKPORT		20024	/* Client udp port number for acks. */
+
+#define	NETDUMP_HERALD		1	/* Broadcast before starting a dump. */
+#define	NETDUMP_FINISHED	2	/* Send after finishing a dump. */
+#define	NETDUMP_VMCORE		3	/* Contains dump datas. */
+#define	NETDUMP_KDH		4	/* Contains kernel dump header. */
+
+#define	NETDUMP_DATASIZE	8192	/* Packets payload. */
+
+struct netdump_msg_hdr {
+	uint32_t type;		/* NETDUMP_HERALD, _FINISHED, _VMCORE, _KDH. */
+	uint32_t seqno;		/* Match acks with msgs. */
+	uint64_t offset;	/* vmcore offset (bytes). */
+	uint32_t len;		/* Attached data (bytes). */
+	uint8_t pad[4];		/* Pad for parifying 32 and 64 bits. */
+};
+
+struct netdump_ack {
+	uint32_t seqno;		/* Match acks with msgs. */
+};
+
+struct netdump_msg {
+	struct netdump_msg_hdr hdr;
+	uint8_t data[NETDUMP_DATASIZE];
+};
+
 #ifdef _KERNEL
 
 struct mtx;


More information about the svn-src-projects mailing list