revert between 56095 -> 55830 in arch
[AROS.git] / workbench / network / stacks / AROSTCP / bsdsocket / net / if_sana.h
blobf4c4427b50d2457c3782b62824c169c3f3481cb1
1 /*
2 * Copyright (C) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
3 * Helsinki University of Technology, Finland.
4 * All rights reserved.
5 * Copyright (C) 2005 - 2012 The AROS Dev Team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19 * MA 02111-1307, USA.
23 #ifndef IF_SANA_H
24 #define IF_SANA_H
26 #ifndef DEVICES_SANA_H
27 #include <devices/sana2.h>
28 #endif
30 #ifndef IF_ARP_H
31 #include <net/if_arp.h>
32 #endif
34 /* A prefix added to the SANA-II device name if needed */
35 #define NAME_PREFIX "networks/"
38 * Our Special SANA-II request
40 struct IOIPReq {
41 struct IOSana2Req ioip_s2;
42 #define ioip_ReplyPort ioip_s2.ios2_Req.io_Message.mn_ReplyPort
43 #define ioip_Command ioip_s2.ios2_Req.io_Command
44 #define ioip_Error ioip_s2.ios2_Req.io_Error
45 struct sana_softc *ioip_if; /* pointer to network interface */
46 /* request dispatch routine */
47 void (*ioip_dispatch)(struct sana_softc *, struct IOIPReq *);
48 struct mbuf *ioip_reserved; /* reserved for packet */
49 struct mbuf *ioip_packet; /* packet */
50 struct IOIPReq *ioip_next; /* allocation queue */
54 * A socket address for a generic SANA-II host
56 #define MAXADDRSANA 16
58 struct sockaddr_sana2 {
59 u_char ss2_len;
60 u_char ss2_family;
61 u_long ss2_type;
62 u_char ss2_host[MAXADDRSANA];
66 * Interface descriptor
67 * NOTE: most of the code outside will believe this to be simply
68 * a "struct ifnet". The other information is, on the other hand,
69 * our own business.
71 struct sana_softc {
72 struct ifnet ss_if; /* network-visible interface */
73 struct in_addr ss_ipaddr; /* copy of ip address */
74 ULONG ss_hwtype; /* wiretype */
75 UBYTE ss_hwaddr[MAXADDRSANA]; /* General hardware address */
76 struct Device *ss_dev; /* pointer to device */
77 struct Unit *ss_unit; /* pointer to unit */
78 VOID *ss_bufmgnt; /* magic cookie for buffer management */
79 UWORD ss_reqno; /* # of requests to allocate */
80 UWORD ss_cflags; /* configuration flags */
81 struct IOIPReq *ss_reqs; /* allocated requests */
82 struct MinList ss_freereq; /* free requests */
83 struct IOIPReq *ss_connectreq; /* request for connect event */
84 #if INET
85 struct {
86 UWORD reqno; /* for listening ip packets */
87 UWORD sent;
88 ULONG type;
89 } ss_ip;
90 struct { /* for ARP */
91 UWORD reqno;
92 UWORD sent;
93 ULONG type; /* ARP packet type */
94 ULONG hrd; /* ARP header type */
95 struct arptable *table; /* ARP/IP table */
96 } ss_arp;
97 #endif /* INET */
98 #if ISO
99 UWORD ss_isoreqno; /* for iso */
100 UWORD ss_isosent;
101 ULONG ss_isotype;
102 #endif /* ISO */
103 #if CCITT
104 UWORD ss_ccittreqno; /* for ccitt */
105 UWORD ss_ccittsent;
106 ULONG ss_ccitttype;
107 #endif /* CCITT */
108 #if NS
109 UWORD ss_nsreqno; /* for ns */
110 UWORD ss_nssent;
111 ULONG ss_nstype;
112 #endif /* NS */
113 UWORD ss_rawreqno; /* for raw packets */
114 UWORD ss_rawsent;
115 UWORD ss_eventsent; /* sent event requests */
116 UWORD ss_maxmtu; /* limit given by device */
117 UBYTE *ss_execname;
118 ULONG ss_execunit;
119 UBYTE ss_name[IFNAMSIZ];
120 struct sana_softc *ss_next;
124 * Configuration flags
126 #define SSF_TRACK (1<<0) /* Should we track packets? */
127 #define SSB_TRACK 0
129 /* Default configuration flags */
130 #define SS_CFLAGS (SSF_TRACK)
132 /* Private Interface Config flags */
133 #define IFF_NOUP 0x8000
134 #define IFF_DELAYUP 0x4000
137 * Global functions defined in if_sana.c
139 int sana_output(struct ifnet *ifp, struct mbuf *m0,
140 struct sockaddr *dst, struct rtentry *rt);
141 int sana_ioctl(register struct ifnet *ifp, int cmd, caddr_t data);
142 /* queue for sana network interfaces */
143 extern struct sana_softc *ssq;
144 #endif /* of IF_SANA_H */