token.h (50514) | token.h (98527) |
---|---|
1/* @(#) $Header: /tcpdump/master/tcpdump/token.h,v 1.3 2000/10/03 02:55:03 itojun Exp $ (LBL) */ |
|
1/* 2 * Copyright (c) 1998, Larry Lile 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 2/* 3 * Copyright (c) 1998, Larry Lile 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright --- 10 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/contrib/tcpdump/token.h 98527 2002-06-21 00:49:02Z fenner $ |
|
27 */ 28 | 29 */ 30 |
29#define TOKEN_HDR_LEN 14 30#define TOKEN_RING_MAC_LEN 6 31#define ROUTING_SEGMENT_MAX 16 32#define IS_SOURCE_ROUTED (tp->ether_shost[0] & 0x80) 33#define BROADCAST ((ntohs(tp->rcf) & 0xE000) >> 13) 34#define RIF_LENGTH ((ntohs(tp->rcf) & 0x1f00) >> 8) 35#define DIRECTION ((ntohs(tp->rcf) & 0x0080) >> 7) 36#define LARGEST_FRAME ((ntohs(tp->rcf) & 0x0070) >> 4) 37#define RING_NUMBER(x) ((ntohs(tp->rseg[x]) & 0xfff0) >> 4) 38#define BRIDGE_NUMBER(x) ((ntohs(tp->rseg[x]) & 0x000f)) 39#define SEGMENT_COUNT ((RIF_LENGTH - 2) / 2) | 31#define TOKEN_HDRLEN 14 32#define TOKEN_RING_MAC_LEN 6 33#define ROUTING_SEGMENT_MAX 16 34#define IS_SOURCE_ROUTED(trp) ((trp)->token_shost[0] & 0x80) 35#define FRAME_TYPE(trp) (((trp)->token_fc & 0xC0) >> 6) 36#define TOKEN_FC_LLC 1 |
40 | 37 |
41char *broadcast_indicator[] = { "Non-Broadcast", "Non-Broadcast", 42 "Non-Broadcast", "Non-Broadcast", 43 "All-routes", "All-routes", 44 "Single-route", "Single-route"}; | 38#define BROADCAST(trp) ((ntohs((trp)->token_rcf) & 0xE000) >> 13) 39#define RIF_LENGTH(trp) ((ntohs((trp)->token_rcf) & 0x1f00) >> 8) 40#define DIRECTION(trp) ((ntohs((trp)->token_rcf) & 0x0080) >> 7) 41#define LARGEST_FRAME(trp) ((ntohs((trp)->token_rcf) & 0x0070) >> 4) 42#define RING_NUMBER(trp, x) ((ntohs((trp)->token_rseg[x]) & 0xfff0) >> 4) 43#define BRIDGE_NUMBER(trp, x) ((ntohs((trp)->token_rseg[x]) & 0x000f)) 44#define SEGMENT_COUNT(trp) ((RIF_LENGTH(trp) - 2) / 2) |
45 | 45 |
46char *direction[] = { "Forward", "Backward"}; 47 48char *largest_frame[] = { "516", "1500", "2052", "4472", "8144", 49 "11407", "17800", ""}; 50 51 | |
52struct token_header { | 46struct token_header { |
53 u_char ac; 54 u_char fc; 55 u_char ether_dhost[TOKEN_RING_MAC_LEN]; 56 u_char ether_shost[TOKEN_RING_MAC_LEN]; 57 u_short rcf; 58 u_short rseg[ROUTING_SEGMENT_MAX]; | 47 u_int8_t token_ac; 48 u_int8_t token_fc; 49 u_int8_t token_dhost[TOKEN_RING_MAC_LEN]; 50 u_int8_t token_shost[TOKEN_RING_MAC_LEN]; 51 u_int16_t token_rcf; 52 u_int16_t token_rseg[ROUTING_SEGMENT_MAX]; |
59}; | 53}; |