This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] netinet/if_tr.h doesn't work anymore


Hi,

with kernel 2.6.12, our netinet/if_tr.h does not compile any longer.
Instead of including all now necessary kernel headers, I copied the
important data:

2005-06-13  Thorsten Kukuk  <kukuk@suse.de>

	* sysdeps/unix/sysv/linux/netinet/if_tr.h: Don't include kernel
	headers, instead copy important structs/defines.

--- sysdeps/unix/sysv/linux/netinet/if_tr.h	6 Jul 2001 04:56:18 -0000	1.3
+++ sysdeps/unix/sysv/linux/netinet/if_tr.h	13 Jun 2005 12:34:14 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -21,9 +21,75 @@
 
 #include <sys/cdefs.h>
 #include <sys/types.h>
-#include <asm/types.h>
 
-#include <linux/if_tr.h>
+/* IEEE 802.5 Token-Ring magic constants.  The frame sizes omit the preamble
+   and FCS/CRC (frame check sequence). */
+#define TR_ALEN		6		/* Octets in one token-ring addr */
+#define TR_HLEN 	(sizeof(struct trh_hdr)+sizeof(struct trllc))
+#define AC		0x10
+#define LLC_FRAME 	0x40
+
+/* LLC and SNAP constants */
+#define EXTENDED_SAP 	0xAA
+#define UI_CMD       	0x03
+
+/* This is an Token-Ring frame header. */
+struct trh_hdr {
+  u_int8_t  ac;			/* access control field */
+  u_int8_t  fc;			/* frame control field */
+  u_int8_t  daddr[TR_ALEN];	/* destination address */
+  u_int8_t  saddr[TR_ALEN];	/* source address */
+  u_int16_t rcf;		/* route control field */
+  u_int16_t rseg[8];		/* routing registers */
+};
+
+/* This is an Token-Ring LLC structure */
+struct trllc {
+  u_int8_t  dsap;		/* destination SAP */
+  u_int8_t  ssap;		/* source SAP */
+  u_int8_t  llc;		/* LLC control field */
+  u_int8_t  protid[3];		/* protocol id */
+  u_int16_t ethertype;		/* ether type field */
+};
+
+/* Token-Ring statistics collection data. */
+struct tr_statistics {
+  unsigned long rx_packets;     /* total packets received	*/
+  unsigned long tx_packets;	/* total packets transmitted	*/
+  unsigned long rx_bytes;	/* total bytes received   	*/
+  unsigned long tx_bytes;	/* total bytes transmitted	*/
+  unsigned long rx_errors;	/* bad packets received		*/
+  unsigned long tx_errors;	/* packet transmit problems	*/
+  unsigned long rx_dropped;	/* no space in linux buffers	*/
+  unsigned long tx_dropped;	/* no space available in linux	*/
+  unsigned long multicast;	/* multicast packets received	*/
+  unsigned long transmit_collision;
+
+  /* detailed Token-Ring errors. See IBM Token-Ring Network
+     Architecture for more info */
+
+  unsigned long line_errors;
+  unsigned long internal_errors;
+  unsigned long burst_errors;
+  unsigned long A_C_errors;
+  unsigned long abort_delimiters;
+  unsigned long lost_frames;
+  unsigned long recv_congest_count;
+  unsigned long frame_copied_errors;
+  unsigned long frequency_errors;
+  unsigned long token_errors;
+  unsigned long dummy1;
+};
+
+/* source routing stuff */
+#define TR_RII 			0x80
+#define TR_RCF_DIR_BIT 		0x80
+#define TR_RCF_LEN_MASK 	0x1f00
+#define TR_RCF_BROADCAST 	0x8000	/* all-routes broadcast */
+#define TR_RCF_LIMITED_BROADCAST 0xC000	/* single-route broadcast */
+#define TR_RCF_FRAME2K 		0x20
+#define TR_RCF_BROADCAST_MASK 	0xC000
+#define TR_MAXRIFLEN 		18
 
 #ifdef __USE_BSD
 

-- 
Thorsten Kukuk         http://www.suse.de/~kukuk/      kukuk@suse.de
SUSE LINUX Products GmbH       Maxfeldstr. 5       D-90409 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]