#ifndef _NETAT_SYSGLUE_H_
#define _NETAT_SYSGLUE_H_
#include <sys/appleapiopts.h>
#include <sys/cdefs.h>
#ifdef __APPLE_API_OBSOLETE
typedef struct {
int ic_cmd;
int ic_timout;
int ic_len;
char *ic_dp;
} ioccmd_t;
#ifdef KERNEL
#ifdef KERNEL_PRIVATE
typedef struct {
int ic_cmd;
int ic_timout;
int ic_len;
user_addr_t ic_dp __attribute__((aligned(8)));
} user_ioccmd_t;
#endif // KERNEL_PRIVATE
#endif // KERNEL
typedef struct {
int ioc_cmd;
void *ioc_cr;
int ioc_id;
int ioc_count;
int ioc_error;
int ioc_rval;
void *ioc_private;
int ioc_filler[4];
} ioc_t;
#ifdef _AIX
#define MSG_DATA 0x00
#define MSG_PROTO 0x01
#define MSG_IOCTL 0x0e
#define MSG_ERROR 0x8a
#define MSG_HANGUP 0x89
#define MSG_IOCACK 0x81
#define MSG_IOCNAK 0x82
#define MSG_CTL 0x0d
#else
#define MSG_DATA (MT_MAX - 1)
#define MSG_PROTO (MT_MAX - 2)
#define MSG_IOCTL (MT_MAX - 3)
#define MSG_ERROR (MT_MAX - 4)
#define MSG_HANGUP (MT_MAX - 5)
#define MSG_IOCACK (MT_MAX - 6)
#define MSG_IOCNAK (MT_MAX - 7)
#define MSG_CTL (MT_MAX - 8)
#endif
#ifdef KERNEL
#ifdef KERNEL_PRIVATE
#define SYS_HZ HZ
#define HZ hz
#define ENOTREADY ESHUTDOWN
#define T_MPSAFE 0
#define INTERRUPTIBLE 1
#define POLLIN 0x0001
#define POLLOUT 0x0002
#define POLLPRI 0x0004
#define POLLMSG 0x0080
#define POLLSYNC 0x8000
#define POLLMSG 0x0080
#define DTYPE_ATALK -1
#define AT_WR_OFFSET 38
#ifndef EVENT_NULL
#define EVENT_NULL -1
#define LOCK_HANDLER 2
#endif
typedef int atevent_t;
typedef int atlock_t;
#define ATEVENTINIT(a) (a = (atevent_t) EVENT_NULL)
#define DDP_OUTPUT(m) ddp_putmsg(0,m)
#define StaticProc static
#define PRI_LO 1
#define PRI_MED 2
#define PRI_HI 3
typedef struct mbuf gbuf_t;
struct mbuf *m_lgbuf_alloc(int size, int wait);
gbuf_t *gbuf_alloc_wait(int size, int wait);
gbuf_t *gbuf_copym(gbuf_t *mlist);
gbuf_t *gbuf_strip(gbuf_t *m);
int gbuf_freel(gbuf_t *m);
void gbuf_linkb(gbuf_t *m1, gbuf_t *m2);
void gbuf_linkpkt(gbuf_t *m1, gbuf_t *m2);
int gbuf_msgsize(gbuf_t *m);
struct mbuf *copy_pkt(struct mbuf *, int);
int append_copy(struct mbuf *, struct mbuf *, int);
#define gbuf_cont(m) m->m_next
#define gbuf_next(m) m->m_nextpkt
#define gbuf_rptr(m) m->m_data
#define gbuf_rinc(m,len) {m->m_data += len; m->m_len -= len;}
#define gbuf_rdec(m,len) {m->m_data -= len; m->m_len += len;}
#define gbuf_wptr(m) (m->m_data + m->m_len)
#define gbuf_winc(m,len) (m->m_len += len)
#define gbuf_wdec(m,len) (m->m_len -= len)
#define gbuf_wset(m,len) (m->m_len = len)
#define gbuf_type(m) m->m_type
#define gbuf_len(m) m->m_len
#define gbuf_alloc(size, pri) (gbuf_alloc_wait(size, FALSE))
#define gbuf_copym(mlist) ((gbuf_t *)copy_pkt(mlist, -1))
#define gbuf_prepend(m,len) M_PREPEND(m,len,M_DONTWAIT)
#define gbuf_freem(mlist) m_freem((struct mbuf *)mlist)
#define gbuf_freeb(m) (void)m_free((struct mbuf *)m)
#define gbuf_set_type(m, mtype) MCHTYPE(m, mtype)
#define gbuf_dupb_wait(m, wait) ((gbuf_t *)m_copym(m, 0, gbuf_len(m), (wait)? M_WAIT: M_DONTWAIT))
#define gbuf_dupb(m) (gbuf_dupb_wait(m, FALSE))
#define gbuf_dupm(mlist) ((gbuf_t *)copy_pkt(mlist, -1))
#undef timeoutcf
#undef timeout
#undef untimeout
struct atpBDS;
int _ATPgetrsp(int, struct atpBDS *, int *, void *);
int _ATPgetreq(int , unsigned char *, int , int *, void *);
int _ATPsndrsp(int , unsigned char *, int , int, int *, void *);
int _ATPsndreq(int , unsigned char *, int , int, int *, void *);
#endif
#endif
#endif
#endif