2 * Copyright (C) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
3 * Helsinki University of Technology, Finland.
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,
26 #ifndef DEVICES_SANA_H
27 #include <devices/sana2.h>
31 #include <net/if_arp.h>
34 /* A prefix added to the SANA-II device name if needed */
35 #define NAME_PREFIX "networks/"
38 * Our Special SANA-II request
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
{
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,
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 */
86 UWORD reqno
; /* for listening ip packets */
90 struct { /* for ARP */
93 ULONG type
; /* ARP packet type */
94 ULONG hrd
; /* ARP header type */
95 struct arptable
*table
; /* ARP/IP table */
99 UWORD ss_isoreqno
; /* for iso */
104 UWORD ss_ccittreqno
; /* for ccitt */
109 UWORD ss_nsreqno
; /* for ns */
113 UWORD ss_rawreqno
; /* for raw packets */
115 UWORD ss_eventsent
; /* sent event requests */
116 UWORD ss_maxmtu
; /* limit given by device */
119 UBYTE ss_name
[IFNAMSIZ
];
120 struct sana_softc
*ss_next
;
124 * Configuration flags
126 #define SSF_TRACK (1<<0) /* Should we track packets? */
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 */