--- a/usr/src/cmd/ofusr/libibverbs/solaris_compatibility.c Thu Jan 06 02:11:29 2011 -0800
+++ b/usr/src/cmd/ofusr/libibverbs/solaris_compatibility.c Sat Jan 15 11:18:46 2011 -0800
@@ -38,6 +38,8 @@
*/
#if defined(__SVR4) && defined(__sun)
+#pragma ident "@(#)solaris_compatibility.c 1.3 10/12/22 SMI"
+
#include <stdarg.h>
#include <fcntl.h>
#include <unistd.h>
@@ -46,6 +48,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
+#include <sys/ib/adapters/hermon/hermon_ioctl.h>
+#include <sys/ib/adapters/tavor/tavor_ioctl.h>
#include <alloca.h>
#include "../include/infiniband/arch.h"
@@ -126,6 +130,7 @@
char ibd_sys_image_guid[20];
char ibd_fw_ver[16];
char ibd_name[8];
+ int ibd_boardid_index;
} ibdev_cache_info_t;
/* tavor and hermon - hence 2 */
@@ -151,6 +156,209 @@
} umad_cache_info_t;
static umad_cache_info_t umad_dev_cache[MAX_HCAS * MAX_HCA_PORTS];
+/*
+ * Structure to hold the part number & PSID for an HCA card
+ * This is a sub-set of the file :
+ * /ws/onnv-clone/usr/src/cmd/fwflash/plugins/hdrs/MELLANOX.h
+ */
+typedef struct mlx_mdr_s {
+ char *mlx_pn;
+ char *mlx_psid;
+} mlx_mdr_t;
+
+/*
+ * Magic decoder ring for matching HCA hardware/firmware.
+ * Part Number / PSID / String ID
+ */
+mlx_mdr_t mlx_mdr[] = {
+ /* For failure case, use unknown as "board-id" */
+ { "unknown", "unknown" },
+
+ /* Part No PSID */
+ { "375-3605-01", "SUN0160000001" },
+ { "375-3382-01", "SUN0030000001" },
+ { "375-3481-01", "SUN0040000001" },
+ { "375-3418-01", "SUN0040000001" },
+ { "375-3259-01", "SUN0010000001" },
+ { "375-3259-03", "SUN0010000001" },
+ { "X1289A-Z", "SUN0010010001" },
+ { "375-3548-01", "SUN0060000001" },
+ { "375-3549-01", "SUN0070000001" },
+ { "375-3549-01", "SUN0070130001" },
+ { "375-3481-01", "SUN0050000001" },
+ { "375-3439-01", "SUN0051000001" },
+ { "375-3260-03", "SUN0020000001" },
+ { "375-3605-01", "SUN0160000002" },
+ { "375-3697-01", "SUN0160000002" },
+ { "375-3606-01", "SUN0150000001" },
+ { "375-3606-02", "SUN0150000009" },
+ { "375-3606-03", "SUN0150000009" },
+ { "375-3606-02", "SUN0170000009" },
+ { "375-3696-01", "SUN0170000009" },
+ { "375-3551-05", "SUN0080000001" },
+ { "MHEA28-XS", "MT_0250000001" },
+ { "MHEA28-XSC", "MT_0390110001" },
+ { "MHEA28-XT", "MT_0150000001" },
+ { "MHEA28-XTC", "MT_0370110001" },
+ { "MHGA28-XT", "MT_0150000002" },
+ { "MHGA28-XTC", "MT_0370110002" },
+ { "MHGA28-XTC", "MT_0370130002" },
+ { "MHGA28-XS", "MT_0250000002" },
+ { "MHGA28-XSC", "MT_0390110002" },
+ { "MHGA28-XSC", "MT_0390130002" },
+ { "MHEL-CF128", "MT_0190000001" },
+ { "MHEL-CF128-T", "MT_00A0000001" },
+ { "MTLP25208-CF128T", "MT_00A0000001" },
+ { "MHEL-CF128-TC", "MT_00A0010001" },
+ { "MHEL-CF128-TC", "MT_0140010001" },
+ { "MHEL-CF128-SC", "MT_0190010001" },
+ { "MHEA28-1TC", "MT_02F0110001" },
+ { "MHEA28-1SC", "MT_0330110001" },
+ { "MHGA28-1T", "MT_0200000001" },
+ { "MHGA28-1TC", "MT_02F0110002" },
+ { "MHGA28-1SC", "MT_0330110002" },
+ { "MHGA28-1S", "MT_0430000001" },
+ { "MHEL-CF256-T", "MT_00B0000001" },
+ { "MTLP25208-CF256T", "MT_00B0000001" },
+ { "MHEL-CF256-TC", "MT_00B0010001" },
+ { "MHEA28-2TC", "MT_0300110001" },
+ { "MHEA28-2SC", "MT_0340110001" },
+ { "MHGA28-2T", "MT_0210000001" },
+ { "MHGA28-2TC", "MT_0300110002" },
+ { "MHGA28-2SC", "MT_0340110002" },
+ { "MHEL-CF512-T", "MT_00C0000001" },
+ { "MTLP25208-CF512T", "MT_00C0000001" },
+ { "MHGA28-5T", "MT_0220000001" },
+ { "MHES14-XSC", "MT_0410110001" },
+ { "MHES14-XT", "MT_01F0000001" },
+ { "MHES14-XTC", "MT_03F0110001" },
+ { "MHES18-XS", "MT_0260000001" },
+ { "MHES18-XS", "MT_0260010001" },
+ { "MHES18-XSC", "MT_03D0110001" },
+ { "MHES18-XSC", "MT_03D0120001" },
+ { "MHES18-XSC", "MT_03D0130001" },
+ { "MHES18-XT", "MT_0230000002" },
+ { "MHES18-XT", "MT_0230010002" },
+ { "MHES18-XTC", "MT_03B0110001" },
+ { "MHES18-XTC", "MT_03B0120001" },
+ { "MHES18-XTC", "MT_03B0140001" },
+ { "MHGS18-XS", "MT_0260000002" },
+ { "MHGS18-XSC", "MT_03D0110002" },
+ { "MHGS18-XSC", "MT_03D0120002" },
+ { "MHGS18-XSC", "MT_03D0130002" },
+ { "MHGS18-XT", "MT_0230000001" },
+ { "MHGS18-XTC", "MT_03B0110002" },
+ { "MHGS18-XTC", "MT_03B0120002" },
+ { "MHGS18-XTC", "MT_03B0140002" },
+ { "MHXL-CF128", "MT_0180000001" },
+ { "MHXL-CF128-T", "MT_0030000001" },
+ { "MTLP23108-CF128T", "MT_0030000001" },
+ { "MHET2X-1SC", "MT_0280110001" },
+ { "MHET2X-1SC", "MT_0280120001" },
+ { "MHET2X-1TC", "MT_0270110001" },
+ { "MHET2X-1TC", "MT_0270120001" },
+ { "MHXL-CF256-T", "MT_0040000001" },
+ { "MHET2X-2SC", "MT_02D0110001" },
+ { "MHET2X-2SC", "MT_02D0120001" },
+ { "MHET2X-2TC", "MT_02B0110001" },
+ { "MHET2X-2TC", "MT_02B0120001" },
+ { "MHX-CE128-T", "MT_0000000001" },
+ { "MTPB23108-CE128", "MT_0000000001" },
+ { "MHX-CE256-T", "MT_0010000001" },
+ { "MTPB23108-CE256", "MT_0010000001" },
+ { "MHX-CE512-T", "MT_0050000001" },
+ { "MTPB23108-CE512", "MT_0050000001" },
+ { "MHEH28-XSC", "MT_04C0110001" },
+ { "MHEH28-XSC", "MT_04C0130005" },
+ { "MHEH28-XTC", "MT_04A0110001" },
+ { "MHEH28-XTC", "MT_04A0130005" },
+ { "MHGH28-XSC", "MT_04C0110002" },
+ { "MHGH28-XSC", "MT_04C0120002" },
+ { "MHGH28-XSC", "MT_04C0140005" },
+ { "MHGH28-XTC", "MT_04A0110002" },
+ { "MHGH28-XTC", "MT_04A0120002" },
+ { "MHGH28-XTC", "MT_04A0140005" },
+ { "MHGH29-XSC", "MT_0A60110002" },
+ { "MHGH29-XSC", "MT_0A60120005" },
+ { "MHGH29-XTC", "MT_0A50110002" },
+ { "MHGH29-XTC", "MT_0A50120005" },
+ { "MHJH29-XTC", "MT_04E0110003" },
+ { "MHJH29-XSC", "MT_0500120005" },
+ { "MHQH29-XTC", "MT_04E0120005" },
+ { "MHQH19-XTC", "MT_0C40110009" },
+ { "MHQH29-XTC", "MT_0BB0110003" },
+ { "MHQH29-XTC", "MT_0BB0120003" },
+ { "MHEH28B-XSR", "MT_0D10110001" },
+ { "MHEH28B-XTR", "MT_0D20110001" },
+ { "MHGH28B-XSR", "MT_0D10110002" },
+ { "MHGH28B-XTR", "MT_0D20110002" },
+ { "MHGH18B-XTR", "MT_0D30110002" },
+ { "MNEH28B-XSR", "MT_0D40110004" },
+ { "MNEH28B-XTR", "MT_0D50110004" },
+ { "MNEH29B-XSR", "MT_0D40110010" },
+ { "MNEH29B-XTR", "MT_0D50110010" },
+ { "MHGH29B-XSR", "MT_0D10110008" },
+ { "MHGH29B-XTR", "MT_0D20110008" },
+ { "MHJH29B-XSR", "MT_0D10110009" },
+ { "MHJH29B-XSR", "MT_0D10120009" },
+ { "MHJH29B-XTR", "MT_0D20110009" },
+ { "MHJH29B-XTR", "MT_0D20120009" },
+ { "MHGH19B-XSR", "MT_0D60110008" },
+ { "MHGH19B-XTR", "MT_0D30110008" },
+ { "MHJH19B-XTR", "MT_0D30110009" },
+ { "MHQH29B-XSR", "MT_0D70110009" },
+ { "MHQH29B-XTR", "MT_0D80110009" },
+ { "MHQH29B-XTR", "MT_0D80120009" },
+ { "MHQH29B-XTR", "MT_0D80130009" },
+ { "MHQH29B-XTR", "MT_0E30110009" },
+ { "MHRH29B-XSR", "MT_0D70110008" },
+ { "MHRH29B-XTR", "MT_0D80110008" },
+ { "MHQH19B-XTR", "MT_0D90110009" },
+ { "MHRH19B-XSR", "MT_0E40110009" },
+ { "MHRH19B-XTR", "MT_0D90110008" },
+ { "MNPH28C-XSR", "MT_0DA0110004" },
+ { "MNPH28C-XTR", "MT_0DB0110004" },
+ { "MNPH29C-XSR", "MT_0DA0110010" },
+ { "MNPH29C-XTR", "MT_0DB0110010" },
+ { "MNPH29C-XTR", "MT_0DB0120010" },
+ { "MNPH29C-XTR", "MT_0DB0130010" },
+ { "MNZH29-XSR", "MT_0DC0110009" },
+ { "MNZH29-XTR", "MT_0DD0110009" },
+ { "MNZH29-XTR", "MT_0DD0120009" },
+ { "MHQH19B-XNR", "MT_0DF0110009" },
+ { "MHQH19B-XNR", "MT_0DF0120009" },
+ { "MNQH19-XTR", "MT_0D80110017" },
+ { "MNQH19C-XTR", "MT_0E20110017" },
+ { "MHZH29B-XSR", "MT_0E80110009" },
+ { "MHZH29B-XTR", "MT_0E90110009" },
+ { "MHZH29B-XTR", "MT_0E90110009" },
+ { "MHQA19-XTR", "MT_0EA0110009" },
+ { "MHRA19-XTR", "MT_0EB0110008" },
+ { "MHQH29C-XTR", "MT_0EF0110009" },
+ { "MHQH29C-XSR", "MT_0F00110009" },
+ { "MHRH29C-XTR", "MT_0F10110008" },
+ { "MHRH29C-XSR", "MT_0F20110008" },
+ { "MHPH29D-XTR", "MT_0F30110010" },
+ { "MHPH29D-XSR", "MT_0F40110010" },
+ { "MNPA19-XTR", "MT_0F60110010" },
+ { "MNPA19-XSR", "MT_0F70110010" },
+
+ /* Ethernet cards */
+ { "MNEH28B-XTR", "MT_0D50110004" },
+ { "MNEH29B-XSR", "MT_0D40110010" },
+ { "MNEH29B-XTR", "MT_0D50110010" },
+ { "MNPH28C-XSR", "MT_0DA0110004" },
+ { "MNPH28C-XTR", "MT_0DB0110004" },
+ { "MNPH29C-XSR", "MT_0DA0110010" },
+ { "MNPH29C-XTR", "MT_0DB0110010" },
+ { "X6275 M2 10GbE", "X6275M2_10G" }
+};
+
+/* Get mlx_mdr[] array size */
+#define MLX_SZ_MLX_MDR sizeof (mlx_mdr)
+#define MLX_SZ_MLX_MDR_STRUCT sizeof (mlx_mdr[0])
+#define MLX_MAX_ID (MLX_SZ_MLX_MDR / MLX_SZ_MLX_MDR_STRUCT)
+
pthread_once_t oneTimeInit = PTHREAD_ONCE_INIT;
static int umad_cache_cnt = 0;
static int ibdev_cache_cnt = 0;
@@ -165,8 +373,8 @@
static di_node_t root_node;
-void __attribute__ ((constructor)) solaris_init(void);
-void __attribute__ ((destructor)) solaris_fini(void);
+void __attribute__((constructor))solaris_init(void);
+void __attribute__((destructor))solaris_fini(void);
void
solaris_init(void)
@@ -297,17 +505,17 @@
guid = ntohll(device_attr.node_guid);
sprintf(info.ibd_node_guid_str, "%04x:%04x:%04x:%04x",
- (unsigned) (guid >> 48) & 0xffff,
- (unsigned) (guid >> 32) & 0xffff,
- (unsigned) (guid >> 16) & 0xffff,
- (unsigned) (guid >> 0) & 0xffff);
+ (unsigned)(guid >> 48) & 0xffff,
+ (unsigned)(guid >> 32) & 0xffff,
+ (unsigned)(guid >> 16) & 0xffff,
+ (unsigned)(guid >> 0) & 0xffff);
guid = ntohll(device_attr.sys_image_guid);
sprintf(info.ibd_sys_image_guid, "%04x:%04x:%04x:%04x",
- (unsigned) (guid >> 48) & 0xffff,
- (unsigned) (guid >> 32) & 0xffff,
- (unsigned) (guid >> 16) & 0xffff,
- (unsigned) (guid >> 0) & 0xffff);
+ (unsigned)(guid >> 48) & 0xffff,
+ (unsigned)(guid >> 32) & 0xffff,
+ (unsigned)(guid >> 16) & 0xffff,
+ (unsigned)(guid >> 0) & 0xffff);
(void) strcpy(info.ibd_fw_ver, device_attr.fw_ver);
info.ibd_hw_rev = device_attr.hw_ver;
@@ -317,6 +525,8 @@
dev_num = atoi(p);
(void) strcpy(info.ibd_name, ibdev);
+ info.ibd_boardid_index = -1;
+
if (ibdev_cache_add(dev_num, &info)) {
fprintf(stderr, "failed to add dev %d to ibdev cache\n",
dev_num);
@@ -386,12 +596,12 @@
info.uvc_vendor_id = *intv;
if (di_prop_lookup_ints(devt, node, "device-id", &intv) != 1) {
- goto error_exit1;
+ goto error_exit1;
}
info.uvc_device_id = *intv;
if (di_prop_lookup_int64(devt, node, "guid", &guid) != 1) {
- goto error_exit1;
+ goto error_exit1;
}
/* abi version only on minor node 0 */
@@ -895,7 +1105,7 @@
* associated GUID to perform the mapping.
*/
uverbs_minor = strtol(dev_name + strlen(UVERBS_KERNEL_SYSFS_NAME) - 1,
- NULL, 0);
+ NULL, 0);
if (uverbs_minor >= MAX_HCAS) {
fprintf(stderr, "Invalid device %s\n", dev_name);
goto err_dev;
@@ -963,7 +1173,7 @@
if (check_path(path, CP_SOL_UVERBS, &device_num)) {
if (device_num >= MAX_HCAS) {
- fprintf(stderr, "Invalid path%s\n", path);
+ fprintf(stderr, "Invalid path%s\n", path);
goto exit;
}
@@ -1040,14 +1250,14 @@
htonll(gids[gid_num].global.interface_id);
len = 1 + sprintf(buf,
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x",
- (unsigned) (subnet_prefix >> 48) & 0xffff,
- (unsigned) (subnet_prefix >> 32) & 0xffff,
- (unsigned) (subnet_prefix >> 16) & 0xffff,
- (unsigned) (subnet_prefix >> 0) & 0xffff,
- (unsigned) (interface_id >> 48) & 0xffff,
- (unsigned) (interface_id >> 32) & 0xffff,
- (unsigned) (interface_id >> 16) & 0xffff,
- (unsigned) (interface_id >> 0) & 0xffff);
+ (unsigned)(subnet_prefix >> 48) & 0xffff,
+ (unsigned)(subnet_prefix >> 32) & 0xffff,
+ (unsigned)(subnet_prefix >> 16) & 0xffff,
+ (unsigned)(subnet_prefix >> 0) & 0xffff,
+ (unsigned)(interface_id >> 48) & 0xffff,
+ (unsigned)(interface_id >> 32) & 0xffff,
+ (unsigned)(interface_id >> 16) & 0xffff,
+ (unsigned)(interface_id >> 0) & 0xffff);
}
if (gids)
free(gids);
@@ -1178,13 +1388,115 @@
len = 1 + sprintf(buf, "%f", rate);
} else if (strcmp(path, "cap_mask") == 0) {
len = 1 + sprintf(buf, "0x%08x",
- port_attr.port_cap_flags);
+ port_attr.port_cap_flags);
}
}
exit:
return (len);
}
+
+/*
+ * This function passes the HW Part number string obtained from driver
+ * IOCTL. The memory for "hca_hwpn" argument has to be passed by the
+ * caller and has to be at least 64 bytes in size.
+ */
+static int
+get_hca_hwpn_str(char *ibd_name, int fd, char *hca_hwpn)
+{
+ hermon_flash_init_ioctl_t hermon_flash_info;
+ tavor_flash_init_ioctl_t tavor_flash_info;
+ int rc;
+
+ if (strncmp(ibd_name, "mthca", 5) == 0) {
+ if ((rc = ioctl(fd, TAVOR_IOCTL_FLASH_INIT,
+ &tavor_flash_info)) != 0)
+ return (rc);
+ strncpy(hca_hwpn, tavor_flash_info.tf_hwpn, 64);
+ } else {
+ if ((rc = ioctl(fd, HERMON_IOCTL_FLASH_INIT,
+ &hermon_flash_info)) != 0)
+ return (rc);
+ strncpy(hca_hwpn, hermon_flash_info.af_hwpn, 64);
+ }
+ return (0);
+}
+
+static void
+init_boardid_index(ibdev_cache_info_t *ibd_info)
+{
+ int i;
+ int fd;
+ char *dev_path;
+ char path_buf[MAXPATHLEN];
+ char hca_hwpn[64];
+ char *hwpnp;
+
+
+ if (pthread_mutex_lock(&uverbs_cache_mutex) != 0) {
+ fprintf(stderr, "failed: to acquire "
+ "uverbs_cache_mutex %s\n",
+ strerror(errno));
+ goto boardid_err;
+ }
+ if (!uverbs_cache_initialized) {
+ uverbs_cache_init();
+ uverbs_cache_initialized = B_TRUE;
+ }
+ (void) pthread_mutex_unlock(&uverbs_cache_mutex);
+
+ for (i = 0; i < MAX_HCAS; i++) {
+ if (uverbs_dev_cache[i].uvc_valid &&
+ strcmp(uverbs_dev_cache[i].uvc_ibdev_name,
+ ibd_info->ibd_name) == 0) {
+ break;
+ }
+ }
+
+ if (i == MAX_HCAS) {
+ fprintf(stderr, "failed to find uverbs_dev for %s\n",
+ ibd_info->ibd_name);
+ goto boardid_err;
+ }
+
+ dev_path = uverbs_dev_cache[i].uvc_ibdev_hca_path;
+ strncpy(path_buf, "/devices", sizeof (path_buf));
+ strncat(path_buf, dev_path, sizeof (path_buf));
+ strncat(path_buf, ":devctl", sizeof (path_buf));
+
+ fd = open(path_buf, O_RDWR);
+ if (fd < 0) {
+ goto boardid_err;
+ }
+
+ if (get_hca_hwpn_str(ibd_info->ibd_name, fd, hca_hwpn)) {
+ close(fd);
+ goto boardid_err;
+ }
+ close(fd);
+ if ((hwpnp = strchr(hca_hwpn, ' ')) != NULL)
+ *hwpnp = '\0';
+
+ /*
+ * Find part number, set the boardid_index,
+ * Skip index 0, as it is for failure "unknown"
+ * case.
+ */
+ for (i = 1; i < MLX_MAX_ID; i++) {
+ if (strcmp((const char *)hca_hwpn,
+ mlx_mdr[i].mlx_pn) == 0) {
+
+ /* Set boardid_index */
+ ibd_info->ibd_boardid_index = i;
+ return;
+ }
+ }
+
+boardid_err:
+ /* Failure case, default to "unknown" */
+ ibd_info->ibd_boardid_index = 0;
+}
+
static int
infiniband(char *path, char *buf, size_t size)
{
@@ -1207,8 +1519,6 @@
len = infiniband_ports(path, buf, size, dev_name);
} else if (strcmp(path, "node_type") == 0) {
len = 1 + sprintf(buf, "%d", IBV_NODE_CA);
- } else if (strcmp(path, "board_id") == 0) {
- len = 1 + sprintf(buf, "unknown");
} else {
if (!(info = get_device_info(dev_name)))
goto exit;
@@ -1226,6 +1536,12 @@
len = 1 + sprintf(buf, "%d", 0);
else
len = 1 + sprintf(buf, "unavailable");
+ } else if (strcmp(path, "board_id") == 0) {
+ if (info->ibd_boardid_index == -1)
+ init_boardid_index(info);
+
+ len = 1 + sprintf(buf, "%s",
+ mlx_mdr[info->ibd_boardid_index].mlx_psid);
}
}
exit:
@@ -1311,7 +1627,7 @@
if (check_path(path, CP_RDMA_CM, NULL)) {
if (strcmp(path, "abi_version") == 0) {
len = 1 + sprintf(buf, "%d",
- RDMA_USER_CM_MAX_ABI_VERSION);
+ RDMA_USER_CM_MAX_ABI_VERSION);
}
}
}
--- a/usr/src/cmd/wireshark/Patches/bug4284.patch Thu Jan 06 02:11:29 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,271 +0,0 @@
---- epan/dissectors/Makefile.common.orig Fri Dec 4 05:00:04 2009
-+++ epan/dissectors/Makefile.common Fri Dec 4 04:57:28 2009
-@@ -531,6 +531,7 @@
- packet-ipfc.c \
- packet-ipmi.c \
- packet-ipmi-session.c \
-+ packet-ipnet.c \
- packet-ipp.c \
- packet-ipsec.c \
- packet-ipsec-tcp.c \
---- wiretap/pcap-common.c.orig Fri Dec 4 04:41:01 2009
-+++ wiretap/pcap-common.c Fri Dec 4 04:53:02 2009
-@@ -348,6 +348,8 @@
- { 215, WTAP_ENCAP_IEEE802_15_4_NONASK_PHY },
- /* USB packets with padded Linux-specified header */
- { 220, WTAP_ENCAP_USB_LINUX_MMAPPED },
-+ /* Solaris IPNET */
-+ { 226, WTAP_ENCAP_IPNET },
-
- /*
- * To repeat:
---- wiretap/wtap.c.orig Fri Dec 18 01:18:39 2009
-+++ wiretap/wtap.c Fri Dec 18 01:19:32 2009
-@@ -445,8 +445,10 @@
- { "Digital Private Signalling System No 1 Link Layer", "dpnss_link" },
-
- /* WTAP_ENCAP_PACKETLOGGER */
-- { "PacketLogger", "packetlogger" }
-+ { "PacketLogger", "packetlogger" },
-
-+ /* WTAP_ENCAP_IPNET */
-+ { "Solaris IPNET", "ipnet" }
- };
-
- gint wtap_num_encap_types = sizeof(encap_table_base) / sizeof(struct encap_type_info);
---- wiretap/wtap.h.orig Fri Dec 4 04:40:50 2009
-+++ wiretap/wtap.h Fri Dec 4 04:43:10 2009
-@@ -209,6 +209,7 @@
- #define WTAP_ENCAP_GSM_UM 116
- #define WTAP_ENCAP_DPNSS 117
- #define WTAP_ENCAP_PACKETLOGGER 118
-+#define WTAP_ENCAP_IPNET 119
-
- #define WTAP_NUM_ENCAP_TYPES wtap_get_num_encap_types()
-
---- wiretap/snoop.c.orig Fri Dec 4 04:59:25 2009
-+++ wiretap/snoop.c Fri Dec 4 04:57:28 2009
-@@ -212,6 +212,18 @@
- WTAP_ENCAP_UNKNOWN, /* 100BaseT (but that's just Ethernet) */
- };
- #define NUM_SNOOP_ENCAPS (sizeof snoop_encap / sizeof snoop_encap[0])
-+ #define SNOOP_PRIVATE_BIT 0x80000000
-+ static const int snoop_private_encap[] = {
-+ WTAP_ENCAP_UNKNOWN, /* Not Used */
-+ WTAP_ENCAP_UNKNOWN, /* IPv4 Tunnel Link */
-+ WTAP_ENCAP_UNKNOWN, /* IPv6 Tunnel Link */
-+ WTAP_ENCAP_UNKNOWN, /* Virtual network interface */
-+ WTAP_ENCAP_UNKNOWN, /* IEEE 802.11 */
-+ WTAP_ENCAP_IPNET, /* ipnet(7D) link */
-+ WTAP_ENCAP_UNKNOWN, /* IPMP stub interface */
-+ WTAP_ENCAP_UNKNOWN, /* 6to4 Tunnel Link */
-+ };
-+ #define NUM_SNOOP_PRIVATE_ENCAPS (sizeof snoop_private_encap / sizeof snoop_private_encap[0])
- static const int shomiti_encap[] = {
- WTAP_ENCAP_ETHERNET, /* IEEE 802.3 */
- WTAP_ENCAP_UNKNOWN, /* IEEE 802.4 Token Bus */
-@@ -381,6 +393,18 @@
-
- /* This is a Shomiti file */
- wth->file_type = WTAP_FILE_SHOMITI;
-+ } else if (hdr.network & SNOOP_PRIVATE_BIT) {
-+ if ((hdr.network^SNOOP_PRIVATE_BIT) >= NUM_SNOOP_PRIVATE_ENCAPS
-+ || snoop_private_encap[hdr.network^SNOOP_PRIVATE_BIT] == WTAP_ENCAP_UNKNOWN) {
-+ *err = WTAP_ERR_UNSUPPORTED_ENCAP;
-+ *err_info = g_strdup_printf("snoop: private network type %u unknown or unsupported",
-+ hdr.network);
-+ return -1;
-+ }
-+ file_encap = snoop_private_encap[hdr.network^SNOOP_PRIVATE_BIT];
-+
-+ /* This is a snoop file */
-+ wth->file_type = WTAP_FILE_SNOOP;
- } else {
- if (hdr.network >= NUM_SNOOP_ENCAPS
- || snoop_encap[hdr.network] == WTAP_ENCAP_UNKNOWN) {
---- epan/dissectors/packet-ipnet.c.orig Fri Dec 4 04:55:19 2009
-+++ epan/dissectors/packet-ipnet.c Fri Dec 4 04:55:35 2009
-@@ -1,0 +1,143 @@
-+/* packet-ipnet.c
-+ * Routines for decoding Solaris IPNET packet disassembly
-+ *
-+ * $Id$
-+ *
-+ * Wireshark - Network traffic analyzer
-+ * By Gerald Combs <[email protected]>
-+ * Copyright 1998 Gerald Combs
-+ *
-+ * This program is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU General Public License
-+ * as published by the Free Software Foundation; either version 2
-+ * of the License, or (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-+ */
-+
-+#ifdef HAVE_CONFIG_H
-+# include "config.h"
-+#endif
-+
-+#include <glib.h>
-+#include <string.h>
-+#include <epan/packet.h>
-+
-+static int proto_ipnet = -1;
-+static int hf_version = -1;
-+static int hf_family = -1;
-+static int hf_htype = -1;
-+static int hf_pktlen = -1;
-+static int hf_ifindex = -1;
-+static int hf_grifindex = -1;
-+static int hf_zsrc = -1;
-+static int hf_zdst = -1;
-+
-+static gint ett_raw = -1;
-+
-+static dissector_handle_t ip_handle;
-+static dissector_handle_t ipv6_handle;
-+
-+static void
-+dissect_ipnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-+{
-+ proto_tree *fh_tree;
-+ proto_item *ti;
-+ tvbuff_t *next_tvb;
-+ guint32 pktlen;
-+ guint8 family;
-+
-+ /* load the top pane info. This should be overwritten by
-+ the next protocol in the stack */
-+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPNET");
-+ col_set_str(pinfo->cinfo, COL_INFO, "Solaris IPNET");
-+
-+ /* populate a tree in the second pane with the IPNET header data */
-+ if(tree) {
-+ ti = proto_tree_add_item (tree, proto_ipnet, tvb, 0, 24, FALSE);
-+ fh_tree = proto_item_add_subtree(ti, ett_raw);
-+
-+ proto_tree_add_item(fh_tree, hf_version, tvb, 0, 1, FALSE);
-+ proto_tree_add_item(fh_tree, hf_family, tvb, 1, 1, FALSE);
-+ proto_tree_add_item(fh_tree, hf_htype, tvb, 2, 2, FALSE);
-+ proto_tree_add_item(fh_tree, hf_pktlen, tvb, 4, 4, FALSE);
-+ proto_tree_add_item(fh_tree, hf_ifindex, tvb, 8, 4, FALSE);
-+ proto_tree_add_item(fh_tree, hf_grifindex, tvb, 12, 4, FALSE);
-+ proto_tree_add_item(fh_tree, hf_zsrc, tvb, 16, 4, FALSE);
-+ proto_tree_add_item(fh_tree, hf_zdst, tvb, 20, 4, FALSE);
-+ }
-+
-+ pktlen = tvb_get_ntohl(tvb, 4);
-+ next_tvb = tvb_new_subset_remaining(tvb, tvb_length(tvb) - pktlen);
-+
-+ family = tvb_get_guint8(tvb, 1);
-+ switch (family) {
-+ case 2: /* AF_INET */
-+ call_dissector(ip_handle, next_tvb, pinfo, tree);
-+ break;
-+ case 26: /* AF_INET6 */
-+ call_dissector(ipv6_handle, next_tvb, pinfo, tree);
-+ break;
-+ default:
-+ break;
-+ }
-+}
-+
-+void
-+proto_register_ipnet(void)
-+{
-+ static hf_register_info hf[] = {
-+ { &hf_version, { "Header version", "ipnet.version",
-+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+ { &hf_family, { "Address family", "ipnet.family",
-+ FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+ { &hf_htype, { "Hook type", "ipnet.htype",
-+ FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+ { &hf_pktlen, { "Data length", "ipnet.pktlen",
-+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+ { &hf_ifindex, { "Interface index", "ipnet.ifindex",
-+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+ { &hf_grifindex, { "Group interface index", "ipnet.grifindex",
-+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+ { &hf_zsrc, { "Source Zone ID", "ipnet.zsrc",
-+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+
-+ { &hf_zdst, { "Destination Zone ID", "ipnet.zdst",
-+ FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-+ };
-+ static gint *ett[] = {
-+ &ett_raw,
-+ };
-+
-+ proto_ipnet = proto_register_protocol("Solaris IPNET", "IPNET", "ipnet");
-+ proto_register_field_array(proto_ipnet, hf, array_length(hf));
-+ proto_register_subtree_array(ett, array_length(ett));
-+}
-+
-+void
-+proto_reg_handoff_ipnet(void)
-+{
-+ dissector_handle_t ipnet_handle;
-+
-+ /*
-+ * Get handles for the IP and IPv6 dissectors.
-+ */
-+ ip_handle = find_dissector("ip");
-+ ipv6_handle = find_dissector("ipv6");
-+
-+ ipnet_handle = create_dissector_handle(dissect_ipnet, proto_ipnet);
-+ dissector_add("wtap_encap", WTAP_ENCAP_IPNET, ipnet_handle);
-+}
---- epan/dissectors/Makefile.in.orig Fri Dec 4 08:07:16 2009
-+++ epan/dissectors/Makefile.in Fri Dec 4 08:08:42 2009
-@@ -428,6 +428,7 @@
- libdissectors_la-packet-ipfc.lo \
- libdissectors_la-packet-ipmi.lo \
- libdissectors_la-packet-ipmi-session.lo \
-+ libdissectors_la-packet-ipnet.lo \
- libdissectors_la-packet-ipp.lo \
- libdissectors_la-packet-ipsec.lo \
- libdissectors_la-packet-ipsec-tcp.lo \
-@@ -1607,6 +1608,7 @@
- packet-ipfc.c \
- packet-ipmi.c \
- packet-ipmi-session.c \
-+ packet-ipnet.c \
- packet-ipp.c \
- packet-ipsec.c \
- packet-ipsec-tcp.c \
-@@ -2875,6 +2877,7 @@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipmi-transport.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipmi-update.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipmi.Plo@am__quote@
-+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipnet.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipp.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipsec-tcp.Plo@am__quote@
- @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdissectors_la-packet-ipsec-udp.Plo@am__quote@
-@@ -5768,6 +5771,13 @@
- @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdissectors_la_CFLAGS) $(CFLAGS) -c -o libdissectors_la-packet-ipmi-session.lo `test -f 'packet-ipmi-session.c' || echo '$(srcdir)/'`packet-ipmi-session.c
-
-+libdissectors_la-packet-ipnet.lo: packet-ipnet.c
-+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdissectors_la_CFLAGS) $(CFLAGS) -MT libdissectors_la-packet-ipnet.lo -MD -MP -MF $(DEPDIR)/libdissectors_la-packet-ipnet.Tpo -c -o libdissectors_la-packet-ipnet.lo `test -f 'packet-ipnet.c' || echo '$(srcdir)/'`packet-ipnet.c
-+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libdissectors_la-packet-ipnet.Tpo $(DEPDIR)/libdissectors_la-packet-ipnet.Plo
-+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='packet-ipnet.c' object='libdissectors_la-packet-ipnet.lo' libtool=yes @AMDEPBACKSLASH@
-+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdissectors_la_CFLAGS) $(CFLAGS) -c -o libdissectors_la-packet-ipnet.lo `test -f 'packet-ipnet.c' || echo '$(srcdir)/'`packet-ipnet.c
-+
- libdissectors_la-packet-ipp.lo: packet-ipp.c
- @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdissectors_la_CFLAGS) $(CFLAGS) -MT libdissectors_la-packet-ipp.lo -MD -MP -MF $(DEPDIR)/libdissectors_la-packet-ipp.Tpo -c -o libdissectors_la-packet-ipp.lo `test -f 'packet-ipp.c' || echo '$(srcdir)/'`packet-ipp.c
- @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libdissectors_la-packet-ipp.Tpo $(DEPDIR)/libdissectors_la-packet-ipp.Plo