|
Packit |
6c4009 |
/* Copyright (C) 1997-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library; if not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifndef _NETINET_IF_TR_H
|
|
Packit |
6c4009 |
#define _NETINET_IF_TR_H 1
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <sys/types.h>
|
|
Packit |
6c4009 |
#include <stdint.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble
|
|
Packit |
6c4009 |
and FCS/CRC (frame check sequence). */
|
|
Packit |
6c4009 |
#define TR_ALEN 6 /* Octets in one token-ring addr */
|
|
Packit |
6c4009 |
#define TR_HLEN (sizeof (struct trh_hdr) + sizeof (struct trllc))
|
|
Packit |
6c4009 |
#define AC 0x10
|
|
Packit |
6c4009 |
#define LLC_FRAME 0x40
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* LLC and SNAP constants */
|
|
Packit |
6c4009 |
#define EXTENDED_SAP 0xAA
|
|
Packit |
6c4009 |
#define UI_CMD 0x03
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* This is an Token-Ring frame header. */
|
|
Packit |
6c4009 |
struct trh_hdr
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
uint8_t ac; /* access control field */
|
|
Packit |
6c4009 |
uint8_t fc; /* frame control field */
|
|
Packit |
6c4009 |
uint8_t daddr[TR_ALEN]; /* destination address */
|
|
Packit |
6c4009 |
uint8_t saddr[TR_ALEN]; /* source address */
|
|
Packit |
6c4009 |
uint16_t rcf; /* route control field */
|
|
Packit |
6c4009 |
uint16_t rseg[8]; /* routing registers */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* This is an Token-Ring LLC structure */
|
|
Packit |
6c4009 |
struct trllc
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
uint8_t dsap; /* destination SAP */
|
|
Packit |
6c4009 |
uint8_t ssap; /* source SAP */
|
|
Packit |
6c4009 |
uint8_t llc; /* LLC control field */
|
|
Packit |
6c4009 |
uint8_t protid[3]; /* protocol id */
|
|
Packit |
6c4009 |
uint16_t ethertype; /* ether type field */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Token-Ring statistics collection data. */
|
|
Packit |
6c4009 |
struct tr_statistics
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
unsigned long rx_packets; /* total packets received */
|
|
Packit |
6c4009 |
unsigned long tx_packets; /* total packets transmitted */
|
|
Packit |
6c4009 |
unsigned long rx_bytes; /* total bytes received */
|
|
Packit |
6c4009 |
unsigned long tx_bytes; /* total bytes transmitted */
|
|
Packit |
6c4009 |
unsigned long rx_errors; /* bad packets received */
|
|
Packit |
6c4009 |
unsigned long tx_errors; /* packet transmit problems */
|
|
Packit |
6c4009 |
unsigned long rx_dropped; /* no space in linux buffers */
|
|
Packit |
6c4009 |
unsigned long tx_dropped; /* no space available in linux */
|
|
Packit |
6c4009 |
unsigned long multicast; /* multicast packets received */
|
|
Packit |
6c4009 |
unsigned long transmit_collision;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* detailed Token-Ring errors. See IBM Token-Ring Network
|
|
Packit |
6c4009 |
Architecture for more info */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
unsigned long line_errors;
|
|
Packit |
6c4009 |
unsigned long internal_errors;
|
|
Packit |
6c4009 |
unsigned long burst_errors;
|
|
Packit |
6c4009 |
unsigned long A_C_errors;
|
|
Packit |
6c4009 |
unsigned long abort_delimiters;
|
|
Packit |
6c4009 |
unsigned long lost_frames;
|
|
Packit |
6c4009 |
unsigned long recv_congest_count;
|
|
Packit |
6c4009 |
unsigned long frame_copied_errors;
|
|
Packit |
6c4009 |
unsigned long frequency_errors;
|
|
Packit |
6c4009 |
unsigned long token_errors;
|
|
Packit |
6c4009 |
unsigned long dummy1;
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* source routing stuff */
|
|
Packit |
6c4009 |
#define TR_RII 0x80
|
|
Packit |
6c4009 |
#define TR_RCF_DIR_BIT 0x80
|
|
Packit |
6c4009 |
#define TR_RCF_LEN_MASK 0x1f00
|
|
Packit |
6c4009 |
#define TR_RCF_BROADCAST 0x8000 /* all-routes broadcast */
|
|
Packit |
6c4009 |
#define TR_RCF_LIMITED_BROADCAST 0xC000 /* single-route broadcast */
|
|
Packit |
6c4009 |
#define TR_RCF_FRAME2K 0x20
|
|
Packit |
6c4009 |
#define TR_RCF_BROADCAST_MASK 0xC000
|
|
Packit |
6c4009 |
#define TR_MAXRIFLEN 18
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifdef __USE_MISC
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
struct trn_hdr
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
uint8_t trn_ac; /* access control field */
|
|
Packit |
6c4009 |
uint8_t trn_fc; /* field control field */
|
|
Packit |
6c4009 |
uint8_t trn_dhost[TR_ALEN]; /* destination host */
|
|
Packit |
6c4009 |
uint8_t trn_shost[TR_ALEN]; /* source host */
|
|
Packit |
6c4009 |
uint16_t trn_rcf; /* route control field */
|
|
Packit |
6c4009 |
uint16_t trn_rseg[8]; /* routing registers */
|
|
Packit |
6c4009 |
};
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#endif
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#endif /* netinet/if_tr.h */
|