* $Header: te.c,v 1.1 88/06/29 15:00:09 hagens Exp $
* $Source: /usr/argo/sys/netiso/RCS/te.c,v $
* Layer between IP and CLNL
* Put together a current rfc986 address format and get the right offset
#define RFC986_NSEL_OFFSET 5
static char *rcsid
= "$Header: te.c,v 1.1 88/06/29 15:00:09 hagens Exp $";
#include "../machineio/ioccvar.h"
#include "../net/netisr.h"
#include "../net/route.h"
#include "../netinet/in.h"
#include "../netinet/in_systm.h"
#include "../netinet/ip.h"
#include "../netinet/ip_var.h"
#include "../netinet/if_ether.h"
#include "../netiso/iso.h"
#include "../netiso/argo_debug.h"
#include "../netiso/iso_errno.h"
#include "../netiso/eonvar.h"
#define insque(p,q) _insque((queue_t)q,(queue_t)p)
#define remque(q) _remque((queue_t)q)
#define eonc_nextLINK eonc_q_LINK.link
#define eonc_prevLINK eonc_q_LINK.flink
#define eonc_nextIS eonc_q_IS.link
#define eonc_prevIS eonc_q_IS.flink
#define eonc_nextES eonc_q_ES.link
#define eonc_prevES eonc_q_ES.flink
struct in_addr eonc_addr
;
/* kinda like mtod() but for eon_centries */
#define qtocentry(q, off) ((struct eon_centry *) (((caddr_t)(q)) - off))
#define centrytoq(c, off) ((struct qhdr *) (((caddr_t)(c)) + off))
struct qhdr eon_LINK_hdr
= {
static struct qhdr eon_IS_hdr
= {
static struct qhdr eon_ES_hdr
= {
static struct qhdr eon_FREE_hdr
= {
register struct eon_centry
*ent
;
off
= _offsetof( struct eon_centry
, eonc_q_LINK
);
ent
= qtocentry( hdr
->link
,
_offsetof( struct eon_centry
, eonc_q_LINK
));
off
= _offsetof( struct eon_centry
, eonc_q_ES
);
ent
= qtocentry( hdr
->link
,
_offsetof( struct eon_centry
, eonc_q_ES
));
off
= _offsetof( struct eon_centry
, eonc_q_IS
);
ent
= qtocentry( hdr
->link
,
_offsetof( struct eon_centry
, eonc_q_IS
));
off
= _offsetof( struct eon_centry
, eonc_q_LINK
);
ent
= qtocentry( hdr
->link
,
_offsetof( struct eon_centry
, eonc_q_LINK
));
if(hdr
== centrytoq(ent
, off
)->link
)
printf("0x%x: %d.%d.%d.%d, %s %s\n", ent
,
(ent
->eonc_addr
.s_addr
>>24)&0xff,
(ent
->eonc_addr
.s_addr
>>16)&0xff,
(ent
->eonc_addr
.s_addr
>>8)&0xff,
(ent
->eonc_addr
.s_addr
)&0xff,
((ent
->eonc_status
& EON_ESLINK_UP
)?"ES^":
(ent
->eonc_status
& EON_ESLINK_DOWN
)?"es*": " "),
((ent
->eonc_status
& EON_ISLINK_UP
)?"IS^":
(ent
->eonc_status
& EON_ISLINK_DOWN
)?"is*": " ")
dump_buf(ent
, sizeof(struct eon_centry
) );
q
= centrytoq(ent
, off
)->link
;
if( q
== (struct qhdr
*)0) /* panic */ {
printf("eon0: BAD Q HDR or CENTRY! q 0x%x ent 0x%x off 0x%x\n",
ent
= qtocentry( q
, off
);
static struct eon_centry eoncache
[EON_CACHESIZE
];
register struct eon_centry
*ent
;
bzero( eoncache
, EON_CACHESIZE
*sizeof(struct eon_centry
));
for(i
=0; i
< EON_CACHESIZE
; i
++,ent
++) {
centrytoq(ent
, _offsetof( struct eon_centry
, eonc_q_LINK
)));
printf("Dump buf 0x%x len 0x%x\n", buf
, len
);
for (i
= 0; i
< len
; i
+= MAX_COLUMNS
) {
for (j
= 0; j
< MAX_COLUMNS
; j
++) {
printf("%x/%d\t", buf
[i
+j
], buf
[i
+j
]);
for (j
= 0; j
< MAX_COLUMNS
; j
++) {
if (((buf
[i
+j
]) > 31) && ((buf
[i
+j
]) < 128))
register struct qhdr
*new, *header
;
(*new).link
= (*header
).link
;
(*(*header
).link
).rlink
= new;