SCCS-vsn: sys/netccitt/ccitt_proto.c 7.5
SCCS-vsn: sys/netccitt/hd_debug.c 7.3
SCCS-vsn: sys/netccitt/hd_input.c 7.4
SCCS-vsn: sys/netccitt/hd_output.c 7.4
SCCS-vsn: sys/netccitt/hd_subr.c 7.4
SCCS-vsn: sys/netccitt/hd_timer.c 7.3
SCCS-vsn: sys/netccitt/pk.h 7.3
SCCS-vsn: sys/netccitt/pk_acct.c 7.3
SCCS-vsn: sys/netccitt/pk_debug.c 7.3
SCCS-vsn: sys/netccitt/pk_input.c 7.5
SCCS-vsn: sys/netccitt/pk_output.c 7.5
SCCS-vsn: sys/netccitt/pk_subr.c 7.6
SCCS-vsn: sys/netccitt/pk_timer.c 7.3
SCCS-vsn: sys/netccitt/pk_usrreq.c 7.7
SCCS-vsn: sys/netccitt/pk_var.h 7.6
SCCS-vsn: sys/netccitt/x25.h 7.4
SCCS-vsn: sys/netccitt/if_x25subr.c 7.6
17 files changed:
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ccitt_proto.c 7.4 (Berkeley) %G%
+ * @(#)ccitt_proto.c 7.5 (Berkeley) %G%
+#define HDLC
+#include "param.h"
+#include "socket.h"
+#include "protosw.h"
+#include "domain.h"
-#include "../h/param.h"
-#include "../h/socket.h"
-#include "../h/protosw.h"
-#include "../h/domain.h"
-#include "../netccitt/x25.h"
/*
* Definitions of protocols supported in the CCITT domain.
/*
* Definitions of protocols supported in the CCITT domain.
#ifdef HDLC
int hd_output (), hd_ctlinput (), hd_init (), hd_timer ();
#endif
#ifdef HDLC
int hd_output (), hd_ctlinput (), hd_init (), hd_timer ();
#endif
-int pk_usrreq (), pk_timer (), pk_init ();
+int pk_usrreq (), pk_timer (), pk_init (), pk_ctloutput ();
struct protosw ccittsw[] = {
#ifdef XE
struct protosw ccittsw[] = {
#ifdef XE
},
#endif
{ SOCK_STREAM, DOMAIN, CCITTPROTO_X25, PR_CONNREQUIRED|PR_ATOMIC|PR_WANTRCVD,
},
#endif
{ SOCK_STREAM, DOMAIN, CCITTPROTO_X25, PR_CONNREQUIRED|PR_ATOMIC|PR_WANTRCVD,
pk_usrreq,
pk_init, 0, pk_timer, 0,
}
pk_usrreq,
pk_init, 0, pk_timer, 0,
}
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)hd_debug.c 7.2 (Berkeley) %G%
+ * @(#)hd_debug.c 7.3 (Berkeley) %G%
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mbuf.h"
-#include "../h/domain.h"
-#include "../h/socket.h"
-#include "../h/protosw.h"
-#include "../h/errno.h"
-#include "../h/time.h"
-#include "../h/kernel.h"
+#include "param.h"
+#include "systm.h"
+#include "mbuf.h"
+#include "domain.h"
+#include "socket.h"
+#include "protosw.h"
+#include "errno.h"
+#include "time.h"
+#include "kernel.h"
-#include "../netccitt/hdlc.h"
-#include "../netccitt/hd_var.h"
-#include "../netccitt/x25.h"
+#include "hdlc.h"
+#include "hd_var.h"
+#include "x25.h"
#ifdef HDLCDEBUG
#define NTRACE 32
#ifdef HDLCDEBUG
#define NTRACE 32
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)hd_input.c 7.3 (Berkeley) %G%
+ * @(#)hd_input.c 7.4 (Berkeley) %G%
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mbuf.h"
-#include "../h/domain.h"
-#include "../h/socket.h"
-#include "../h/protosw.h"
-#include "../h/errno.h"
-#include "../h/time.h"
-#include "../h/kernel.h"
+#include "param.h"
+#include "systm.h"
+#include "mbuf.h"
+#include "domain.h"
+#include "socket.h"
+#include "protosw.h"
+#include "errno.h"
+#include "time.h"
+#include "kernel.h"
-#include "../netccitt/hdlc.h"
-#include "../netccitt/hd_var.h"
-#include "../netccitt/x25.h"
+#include "hdlc.h"
+#include "hd_var.h"
+#include "x25.h"
/*
* HDLC INPUT INTERFACE
/*
* HDLC INPUT INTERFACE
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)hd_output.c 7.3 (Berkeley) %G%
+ * @(#)hd_output.c 7.4 (Berkeley) %G%
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mbuf.h"
-#include "../h/domain.h"
-#include "../h/socket.h"
-#include "../h/protosw.h"
-#include "../h/errno.h"
-#include "../h/time.h"
-#include "../h/kernel.h"
+#include "param.h"
+#include "systm.h"
+#include "mbuf.h"
+#include "domain.h"
+#include "socket.h"
+#include "protosw.h"
+#include "errno.h"
+#include "time.h"
+#include "kernel.h"
+
-#include "../netccitt/hdlc.h"
-#include "../netccitt/hd_var.h"
-#include "../netccitt/x25.h"
+#include "hdlc.h"
+#include "hd_var.h"
+#include "x25.h"
/*
* HDLC OUTPUT INTERFACE
/*
* HDLC OUTPUT INTERFACE
{
register struct Hdlc_iframe *iframe;
struct mbuf *m;
{
register struct Hdlc_iframe *iframe;
struct mbuf *m;
* Queue message on interface, and start output if interface
* not yet active.
*/
* Queue message on interface, and start output if interface
* not yet active.
*/
- register struct ifnet *ifp = hdp->hdp_ifp;
+ register struct ifnet *ifp = hdp->hd_ifp;
int s = splimp();
if (IF_QFULL(&ifp->if_snd)) {
IF_DROP(&ifp->if_snd);
int s = splimp();
if (IF_QFULL(&ifp->if_snd)) {
IF_DROP(&ifp->if_snd);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)hd_subr.c 7.3 (Berkeley) %G%
+ * @(#)hd_subr.c 7.4 (Berkeley) %G%
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mbuf.h"
-#include "../h/domain.h"
-#include "../h/socket.h"
-#include "../h/protosw.h"
-#include "../h/errno.h"
-#include "../h/time.h"
-#include "../h/kernel.h"
+#include "param.h"
+#include "systm.h"
+#include "mbuf.h"
+#include "domain.h"
+#include "socket.h"
+#include "protosw.h"
+#include "errno.h"
+#include "time.h"
+#include "kernel.h"
-#include "../netccitt/hdlc.h"
-#include "../netccitt/hd_var.h"
-#include "../netccitt/x25.h"
+#include "hdlc.h"
+#include "hd_var.h"
+#include "x25.h"
register struct hdcb *hdp;
register struct ifaddr *ifa;
register struct hdcb *hdp;
register struct ifaddr *ifa;
- if (xcp->xc_family != AF_CCITT)
+ if (xcp->xc_addr.x25_family != AF_CCITT)
return (EAFNOSUPPORT);
if (xcp->xc_lptype != HDLCPROTO_LAPB)
return (EPROTONOSUPPORT);
for (ifa = ifa_ifwithaddr ((struct sockaddr *)xcp); ifa; ifa = ifa->ifa_next)
return (EAFNOSUPPORT);
if (xcp->xc_lptype != HDLCPROTO_LAPB)
return (EPROTONOSUPPORT);
for (ifa = ifa_ifwithaddr ((struct sockaddr *)xcp); ifa; ifa = ifa->ifa_next)
- if (ifa->ifa_addr.sa_family == AF_CCITT)
+ if (ifa->ifa_addr->sa_family == AF_CCITT)
break;
if (ifa == 0 || (ifp = ifa->ifa_ifp) == 0)
panic ("hd_ctlinput");
break;
if (ifa == 0 || (ifp = ifa->ifa_ifp) == 0)
panic ("hd_ctlinput");
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)hd_timer.c 7.2 (Berkeley) %G%
+ * @(#)hd_timer.c 7.3 (Berkeley) %G%
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mbuf.h"
-#include "../h/domain.h"
-#include "../h/socket.h"
-#include "../h/protosw.h"
-#include "../h/errno.h"
-#include "../h/time.h"
-#include "../h/kernel.h"
+#include "param.h"
+#include "systm.h"
+#include "mbuf.h"
+#include "domain.h"
+#include "socket.h"
+#include "protosw.h"
+#include "errno.h"
+#include "time.h"
+#include "kernel.h"
-#include "../netccitt/hdlc.h"
-#include "../netccitt/hd_var.h"
-#include "../netccitt/x25.h"
+#include "hdlc.h"
+#include "hd_var.h"
+#include "x25.h"
/*
* these can be patched with adb if the
/*
* these can be patched with adb if the
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)if_x25subr.c 7.5 (Berkeley) %G%
+ * @(#)if_x25subr.c 7.6 (Berkeley) %G%
#include "mbuf.h"
#include "protosw.h"
#include "socket.h"
#include "mbuf.h"
#include "protosw.h"
#include "socket.h"
#include "ioctl.h"
#include "errno.h"
#include "syslog.h"
#include "../net/if.h"
#include "ioctl.h"
#include "errno.h"
#include "syslog.h"
#include "../net/if.h"
+#include "../net/if_types.h"
#include "../net/netisr.h"
#include "../net/route.h"
#include "x25.h"
#include "../net/netisr.h"
#include "../net/route.h"
#include "x25.h"
+#include "x25err.h"
+#include "pk.h"
#include "pk_var.h"
#include "machine/mtpr.h"
#include "pk_var.h"
#include "machine/mtpr.h"
extern struct ifnet loif;
extern struct ifnet loif;
+union imp_addr {
+ struct in_addr ip;
+ struct imp {
+ u_char s_net;
+ u_char s_host;
+ u_char s_lh;
+ u_char s_impno;
+ } imp;
+};
+
#define senderr(x) {error = x; goto bad;}
/*
* X.25 output routine.
#define senderr(x) {error = x; goto bad;}
/*
* X.25 output routine.
register struct rtentry *rt;
{
register struct mbuf *m;
register struct rtentry *rt;
{
register struct mbuf *m;
- register struct rtextension_x25 *rtx;
+ register struct llinfo_x25 *lx;
register struct pq *pq;
struct pklcd *lcp;
struct x25_ifaddr *ia;
struct mbuf *prev;
int s, error = 0, flags = 0;
union imp_addr imp_addr;
register struct pq *pq;
struct pklcd *lcp;
struct x25_ifaddr *ia;
struct mbuf *prev;
int s, error = 0, flags = 0;
union imp_addr imp_addr;
if ((ifp->if_flags & IFF_UP) == 0)
return (ENETDOWN);
if ((ifp->if_flags & IFF_UP) == 0)
return (ENETDOWN);
if ((rt = rtalloc1(dst, 1)) == 0)
return (EHOSTUNREACH);
rt->rt_refcnt++;
if ((rt = rtalloc1(dst, 1)) == 0)
return (EHOSTUNREACH);
rt->rt_refcnt++;
}
/*
* Sanity checks.
*/
if ((rt->rt_ifp != ifp) ||
(rt->rt_flags & (RTF_CLONING | RTF_GATEWAY)) ||
}
/*
* Sanity checks.
*/
if ((rt->rt_ifp != ifp) ||
(rt->rt_flags & (RTF_CLONING | RTF_GATEWAY)) ||
- ((rtx = (struct rtextension_x25 *)rt->rt_llinfo) == 0)) {
+ ((lx = (struct llinfo_x25 *)rt->rt_llinfo) == 0)) {
printf("Inconsistent call to x25_output, should panic\n");
senderr(ENETUNREACH);
}
printf("Inconsistent call to x25_output, should panic\n");
senderr(ENETUNREACH);
}
}
ia = (struct x25_ifaddr *)ifa;
}
}
ia = (struct x25_ifaddr *)ifa;
}
- if (rtx->rtx_lcd == 0) {
int x25_ifinput();
lcp = pk_attach((struct socket *)0);
if (lcp == 0)
senderr(ENOBUFS);
int x25_ifinput();
lcp = pk_attach((struct socket *)0);
if (lcp == 0)
senderr(ENOBUFS);
- rtx->rtx_lcd = lcp;
- rtx->rtx_rt = rt;
- rtx->rtx_ia = ia;
- lcp->lcd_upnext = (caddr_t)rtx;
+ lx->lx_lcd = lcp;
+ lx->lx_rt = rt;
+ lx->lx_ia = ia;
+ lcp->lcd_upnext = (caddr_t)lx;
lcp->lcd_upper = x25_ifinput;
}
lcp->lcd_upper = x25_ifinput;
}
- switch (rtx->rtx_state) {
+ switch (lx->lx_state) {
- case XRS_CONNECTED:
- lcd->lcd_dg_timer = ia->ia_xc.xc_dg_idletimo;
+ case LXS_CONNECTED:
+ lcp->lcd_dg_timer = ia->ia_xc.xc_dg_idletimo;
if (sbspace(&lcp->lcd_sb) < 0)
senderr(ENOBUFS);
lcp->lcd_send(lcp, m);
break;
if (sbspace(&lcp->lcd_sb) < 0)
senderr(ENOBUFS);
lcp->lcd_send(lcp, m);
break;
if (dst->sa_family == AF_INET &&
if (dst->sa_family == AF_INET &&
- ia->xc_if.if_type == IFT_DDN &&
+ ia->ia_ifp->if_type == IFT_X25DDN &&
rt->rt_gateway->sa_family != AF_CCITT)
x25_ddnip_to_ccitt(dst, rt->rt_gateway);
lcp->lcd_flags |= X25_DG_CIRCUIT;
rt->rt_gateway->sa_family != AF_CCITT)
x25_ddnip_to_ccitt(dst, rt->rt_gateway);
lcp->lcd_flags |= X25_DG_CIRCUIT;
- rtx->rtx_state = XRS_FREE;
+ lx->lx_state = LXS_FREE;
if (rt->rt_gateway->sa_family != AF_CCITT) {
/*
* Need external resolution of dst
*/
if ((rt->rt_flags & RTF_XRESOLVE) == 0)
senderr(ENETUNREACH);
if (rt->rt_gateway->sa_family != AF_CCITT) {
/*
* Need external resolution of dst
*/
if ((rt->rt_flags & RTF_XRESOLVE) == 0)
senderr(ENETUNREACH);
- rtx->rtx_flags |= flags;
flags = 0;
rt_missmsg(RTM_RESOLVE, dst,
(struct sockaddr *)0, (struct sockaddr *)0,
(struct sockaddr *)0, 0, 0);
flags = 0;
rt_missmsg(RTM_RESOLVE, dst,
(struct sockaddr *)0, (struct sockaddr *)0,
(struct sockaddr *)0, 0, 0);
- rtx->rtx_state = XRS_RESOLVING;
+ lx->lx_state = LXS_RESOLVING;
if (sbspace(&lcp->lcd_sb) < 0)
senderr(ENOBUFS);
sbappendrecord(&lcp->lcd_sb, m);
break;
}
/* FALLTHROUGH */
if (sbspace(&lcp->lcd_sb) < 0)
senderr(ENOBUFS);
sbappendrecord(&lcp->lcd_sb, m);
break;
}
/* FALLTHROUGH */
sbappendrecord(&lcp->lcd_sb, m);
sbappendrecord(&lcp->lcd_sb, m);
- lcp->lcd_pkcb = &(rtx->rtx_ia->ia_pkcb);
+ lcp->lcd_pkp = &(lx->lx_ia->ia_pkcb);
pk_connect(lcp, (struct mbuf *)0,
(struct sockaddr_x25 *)rt->rt_gateway);
break;
pk_connect(lcp, (struct mbuf *)0,
(struct sockaddr_x25 *)rt->rt_gateway);
break;
- if (flags & XRF_RTHELD)
+ if (flags & LXF_RTHELD)
RTFREE(rt);
return (error);
}
RTFREE(rt);
return (error);
}
--lcpp >= pkcb->pk_chan;)
if ((lcp = *lcpp) &&
lcp->lcd_state == DATA_TRANSFER &&
--lcpp >= pkcb->pk_chan;)
if ((lcp = *lcpp) &&
lcp->lcd_state == DATA_TRANSFER &&
- (lcp->lcd_flags & X25_DG_CICRUIT) &&
+ (lcp->lcd_flags & X25_DG_CIRCUIT) &&
(--(lcp->lcd_dg_timer) <= 0)) {
(--(lcp->lcd_dg_timer) <= 0)) {
- register struct rtextension_x25 *rtx;
+ register struct llinfo_x25 *lx;
- rtx = (struct rtextension_x25 *)
- lcp->lcp_upnext;
- if (rtx)
- rtx->rtx_state = XRS_DISCONNECTING;
+ lx = (struct llinfo_x25 *)
+ lcp->lcd_upnext;
+ if (lx)
+ lx->lx_state = LXS_DISCONNECTING;
struct pklcd *lcp;
struct mbuf *m;
{
struct pklcd *lcp;
struct mbuf *m;
{
- struct rtextension *rtx = (struct rtentry *)lcp->lcd_upnext;
- register struct ifnet *ifp = &rtx->rtx_rt->rt_ifp;
+ struct llinfo_x25 *lx = (struct llinfo_x25 *)lcp->lcd_upnext;
+ struct rtentry *rt = lx->lx_rt;
+ register struct ifnet *ifp = rt->rt_ifp;
+ struct ifqueue *inq;
+ extern struct timeval time;
int s;
ifp->if_lastchange = time;
int s;
ifp->if_lastchange = time;
- switch (rt_dst(rt)->sa_family) {
+ switch ((rt_key(rt))->sa_family) {
#ifdef INET
case AF_INET:
schednetisr(NETISR_IP);
#ifdef INET
case AF_INET:
schednetisr(NETISR_IP);
-
-union imp_addr {
- struct in_addr ip;
- struct imp {
- u_char s_net;
- u_char s_host;
- u_char s_lh;
- u_char s_impno;
- } imp;
-};
static struct sockaddr_x25 blank_x25 = {sizeof blank_x25, AF_CCITT};
/*
* IP to X25 address routine copyright ACC, used by permission.
static struct sockaddr_x25 blank_x25 = {sizeof blank_x25, AF_CCITT};
/*
* IP to X25 address routine copyright ACC, used by permission.
register struct sockaddr_x25 *dst;
{
union imp_addr imp_addr;
register struct sockaddr_x25 *dst;
{
union imp_addr imp_addr;
- int imp_no, imp_port;
- char *x25addr = dst->x25_x25addr;
+ int imp_no, imp_port, temp;
+ char *x25addr = dst->x25_addr;
- imp_addr.ip = src->sin_addr.s_addr;
+ imp_addr.ip = src->sin_addr;
*dst = blank_x25;
if ((imp_addr.imp.s_net & 0x80) == 0x00) { /* class A */
imp_no = imp_addr.imp.s_impno;
*dst = blank_x25;
if ((imp_addr.imp.s_net & 0x80) == 0x00) { /* class A */
imp_no = imp_addr.imp.s_impno;
register struct rtentry *rt;
struct sockaddr *dst;
{
register struct rtentry *rt;
struct sockaddr *dst;
{
- register struct rtextension_x25 *rtx = (struct pklcd *)rt->rt_llinfo;
+ register struct llinfo_x25 *lx = (struct llinfo_x25 *)rt->rt_llinfo;
register struct sockaddr_x25 *sa =(struct sockaddr_x25 *)rt->rt_gateway;
register struct pklcd *lcp;
register struct x25_ifaddr *ia;
register struct sockaddr_x25 *sa =(struct sockaddr_x25 *)rt->rt_gateway;
register struct pklcd *lcp;
register struct x25_ifaddr *ia;
struct mbuf *m, *mold;
int x25_ifrtfree();
struct mbuf *m, *mold;
int x25_ifrtfree();
- ia = rtx->rtx_ia;
- lcp = rtx->rtx_lcd;
+ ia = lx->lx_ia;
+ lcp = lx->lx_lcd;
- switch (caseof(xl->xl_state, cmd)) {
+ switch (caseof(lx->lx_state, cmd)) {
- case caseof(XRS_CONNECTED, RTM_DELETE):
- case caseof(XRS_CONNECTED, RTM_CHANGE):
- case caseof(XRS_CONNECTING, RTM_DELETE):
- case caseof(XRS_CONNECTING, RTM_CHANGE):
+ case caseof(LXS_CONNECTED, RTM_DELETE):
+ case caseof(LXS_CONNECTED, RTM_CHANGE):
+ case caseof(LXS_CONNECTING, RTM_DELETE):
+ case caseof(LXS_CONNECTING, RTM_CHANGE):
pk_disconnect(lcp);
lcp->lcd_upper = x25_ifrtfree;
rt->rt_refcnt++;
break;
pk_disconnect(lcp);
lcp->lcd_upper = x25_ifrtfree;
rt->rt_refcnt++;
break;
- case caseof(XRS_CONNECTED, RTM_ADD):
- case caseof(XRS_CONNECTING, RTM_ADD):
- case caseof(XRS_RESOLVING, RTM_ADD):
+ case caseof(LXS_CONNECTED, RTM_ADD):
+ case caseof(LXS_CONNECTING, RTM_ADD):
+ case caseof(LXS_RESOLVING, RTM_ADD):
printf("ifrtchange: impossible transition, should panic\n");
break;
printf("ifrtchange: impossible transition, should panic\n");
break;
- case caseof(XRS_RESOLVING, RTM_DELETE):
- sbflush(&(rtx->rtx_lcd->lcd_sb));
- free((caddr_t)rtx->rtx_lcd, M_PCB);
- rtx->rtx_lcd = 0;
+ case caseof(LXS_RESOLVING, RTM_DELETE):
+ sbflush(&(lx->lx_lcd->lcd_sb));
+ free((caddr_t)lx->lx_lcd, M_PCB);
+ lx->lx_lcd = 0;
- case caseof(XRS_RESOLVING, RTM_CHANGE):
- lcp->lcd_pkcb = &(ia->ia_pkcb);
+ case caseof(LXS_RESOLVING, RTM_CHANGE):
+ lcp->lcd_pkp = &(ia->ia_pkcb);
pk_connect(lcp, (struct mbuf *)0, sa);
break;
}
pk_connect(lcp, (struct mbuf *)0, sa);
break;
}
- if (rt->rt_ifp->if_type == IFT_DDN)
+ if (rt->rt_ifp->if_type == IFT_X25DDN)
- if (sa->sa_family == AF_CCITT) {
+ if (sa->x25_family == AF_CCITT) {
sa->x25_opts.op_speed = sa2->sa_family;
(void) rtrequest(RTM_DELETE, SA(sa), sa2,
SA(0), RTF_HOST, (struct rtentry **)0);
sa->x25_opts.op_speed = sa2->sa_family;
(void) rtrequest(RTM_DELETE, SA(sa), sa2,
SA(0), RTF_HOST, (struct rtentry **)0);
sa = (struct sockaddr_x25 *)dst;
cmd = RTM_ADD;
}
sa = (struct sockaddr_x25 *)dst;
cmd = RTM_ADD;
}
- if (sa->sa_family == AF_CCITT) {
+ if (sa->x25_family == AF_CCITT) {
sa->x25_opts.op_speed = sa2->sa_family;
(void) rtrequest(cmd, SA(sa), sa2, SA(0), RTF_HOST,
(struct rtentry **)0);
sa->x25_opts.op_speed = sa2->sa_family;
(void) rtrequest(cmd, SA(sa), sa2, SA(0), RTF_HOST,
(struct rtentry **)0);
-static struct sockaddr sin = {sizeof(sin), AF_INET};
+static struct sockaddr_in sin = {sizeof(sin), AF_INET};
/*
* This is a utility routine to be called by x25 devices when a
* call request is honored with the intent of starting datagram forwarding.
*/
x25_dg_rtinit(dst, ia, af)
struct sockaddr_x25 *dst;
/*
* This is a utility routine to be called by x25 devices when a
* call request is honored with the intent of starting datagram forwarding.
*/
x25_dg_rtinit(dst, ia, af)
struct sockaddr_x25 *dst;
-register struct x25com *ia;
+register struct x25_ifaddr *ia;
{
struct sockaddr *sa = 0;
{
struct sockaddr *sa = 0;
- if (ia->xc_if.if_type == IFT_DDN && af == AF_INET) {
+ struct rtentry *rt;
+ struct in_addr my_addr;
+
+ if (ia->ia_ifp->if_type == IFT_X25DDN && af == AF_INET) {
- * Inverse X25 to IPP mapping copyright and courtesy ACC.
+ * Inverse X25 to IP mapping copyright and courtesy ACC.
*/
int imp_no, imp_port, temp;
union imp_addr imp_addr;
*/
int imp_no, imp_port, temp;
union imp_addr imp_addr;
/*
* First determine our IP addr for network
*/
/*
* First determine our IP addr for network
*/
- register struct in_ifaddr *ia;
+ register struct in_ifaddr *ina;
extern struct in_ifaddr *in_ifaddr;
extern struct in_ifaddr *in_ifaddr;
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp == &ia->xc_if) {
- imp_addr.ip = ia->ia_addr.sin_addr;
+
+ for (ina = in_ifaddr; ina; ina = ina->ia_next)
+ if (ina->ia_ifp == ia->ia_ifp) {
+ my_addr = ina->ia_addr.sin_addr;
- imp_addr.ip.s_addr = my_addr;
if ((imp_addr.imp.s_net & 0x80) == 0x00) {
/* class A */
imp_addr.imp.s_host = imp_port;
if ((imp_addr.imp.s_net & 0x80) == 0x00) {
/* class A */
imp_addr.imp.s_host = imp_port;
* to callee by virtue of cloning magic and will allocate
* space for local control block.
*/
* to callee by virtue of cloning magic and will allocate
* space for local control block.
*/
- if (sa && rt = rtalloc1(sa, 1))
+ if (sa && (rt = rtalloc1(sa, 1)))
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)pk.h 7.2 (Berkeley) %G%
+ * @(#)pk.h 7.3 (Berkeley) %G%
struct x25_calladdr {
octet ORDER2(called_addrlen:4, calling_addrlen:4);
octet address_field[MAXADDRLN];
struct x25_calladdr {
octet ORDER2(called_addrlen:4, calling_addrlen:4);
octet address_field[MAXADDRLN];
struct x25_packet {
octet ORDER3(lc_group_number:4, fmt_identifier:3, q_bit:1);
struct x25_packet {
octet ORDER3(lc_group_number:4, fmt_identifier:3, q_bit:1);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)pk_acct.c 7.2 (Berkeley) %G%
+ * @(#)pk_acct.c 7.3 (Berkeley) %G%
-#include "../h/param.h"
-#ifdef NFS
+#include "time.h"
+#include "proc.h"
#include "user.h"
#include "vnode.h"
#include "user.h"
#include "vnode.h"
+#include "file.h"
+#include "acct.h"
-#else
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/inode.h"
-#include "../h/kernel.h"
-#ifdef BSD4_3
-#include "../h/namei.h"
-#else
-#include "../h/nami.h"
-#endif
-#include "../h/uio.h"
-#endif
+#include "socket.h"
+#include "socketvar.h"
-#include "../netccitt/pk.h"
-#include "../netccitt/pk_var.h"
-#include "../netccitt/x25.h"
-#include "../netccitt/x25acct.h"
+#include "x25.h"
+#include "pk.h"
+#include "pk_var.h"
+#include "x25acct.h"
-#ifdef NFS
-struct vnode *pkacctp;
-#else
-struct inode *pkacctp;
-#endif
/*
* Turn on packet accounting
*/
/*
* Turn on packet accounting
*/
pk_accton (path)
char *path;
{
pk_accton (path)
char *path;
{
-#ifdef NFS
- register int error;
- struct vnode *vp;
-#else
-#ifdef BSD4_3
- struct nameidata *ndp = &u.u_nd;
-#endif
- register struct inode *ip;
-#endif
-
-#ifdef NFS
- if (error = lookupname(path, UIO_USERSPACE, FOLLOW_LINK,
- (struct vnode **)0, &vp))
+ register struct vnode *vp = NULL;
+ register struct nameidata *ndp = &u.u_nd;
+ struct vnode *oacctp = pkacctp;
+ int error;
+
+ ndp -> ni_segflg = UIO_USERSPACE;
+ ndp -> ni_dirp = path;
+ if (error = vn_open (ndp, FREAD|FWRITE, 0))
- if (vp->v_type != VREG) {
- VN_RELE(vp);
+ vp = ndp -> ni_vp;
+ if (vp -> v_type != VREG) {
+ vrele (vp);
- if (vp->v_vfsp->vfs_flag & VFS_RDONLY) {
- VN_RELE(vp);
- return (EROFS);
- }
-#else
-#ifdef BSD4_3
- ndp->ni_nameiop = LOOKUP | FOLLOW;
- ndp->ni_segflg = UIO_USERSPACE;
- ndp->ni_dirp = path;
- ip = namei(ndp);
-#else
- u.u_dirp = path;
- ip = namei (schar, LOOKUP, 1);
-#endif
- if (ip == NULL)
- return (u.u_error);
-
- if ((ip -> i_mode & IFMT) != IFREG) {
- iput (ip);
- return (EACCES);
- }
- if (pkacctp)
- if (pkacctp->i_number != ip->i_number ||
- pkacctp->i_dev != ip->i_dev)
- irele(pkacctp);
- pkacctp = ip;
- iunlock (ip);
-#endif
+ if (oacctp)
+ vrele (oacctp);
pk_acctoff ()
{
if (pkacctp) {
pk_acctoff ()
{
if (pkacctp) {
-#ifdef NFS
- VN_RELE(pkacctp);
-#else
- irele (pkacctp);
-#endif
pk_acct (lcp)
register struct pklcd *lcp;
{
pk_acct (lcp)
register struct pklcd *lcp;
{
register struct vnode *vp;
register struct vnode *vp;
-#else
- register struct inode *ip;
- off_t siz;
-#endif
register struct sockaddr_x25 *sa;
register char *src, *dst;
register int len;
register struct sockaddr_x25 *sa;
register char *src, *dst;
register int len;
static struct x25acct acbuf;
static struct x25acct acbuf;
-#else
- if ((ip = pkacctp) == 0)
-#endif
bzero ((caddr_t)&acbuf, sizeof (acbuf));
if (lcp -> lcd_ceaddr != 0)
sa = lcp -> lcd_ceaddr;
bzero ((caddr_t)&acbuf, sizeof (acbuf));
if (lcp -> lcd_ceaddr != 0)
sa = lcp -> lcd_ceaddr;
if (sa -> x25_opts.op_flags & X25_REVERSE_CHARGE)
acbuf.x25acct_revcharge = 1;
acbuf.x25acct_stime = lcp -> lcd_stime;
if (sa -> x25_opts.op_flags & X25_REVERSE_CHARGE)
acbuf.x25acct_revcharge = 1;
acbuf.x25acct_stime = lcp -> lcd_stime;
acbuf.x25acct_etime = time.tv_sec - acbuf.x25acct_stime;
acbuf.x25acct_etime = time.tv_sec - acbuf.x25acct_stime;
-#else
- etime = time.tv_sec - acbuf.x25acct_stime;
- acbuf.x25acct_etime = etime > 0xffff ? 0xffff : etime;
-#endif
acbuf.x25acct_uid = u.u_uid;
acbuf.x25acct_psize = sa -> x25_opts.op_psize;
acbuf.x25acct_net = sa -> x25_net;
acbuf.x25acct_uid = u.u_uid;
acbuf.x25acct_psize = sa -> x25_opts.op_psize;
acbuf.x25acct_net = sa -> x25_net;
acbuf.x25acct_txcnt = lcp -> lcd_txcnt;
acbuf.x25acct_rxcnt = lcp -> lcd_rxcnt;
acbuf.x25acct_txcnt = lcp -> lcd_txcnt;
acbuf.x25acct_rxcnt = lcp -> lcd_rxcnt;
(void) vn_rdwr(UIO_WRITE, vp, (caddr_t)&acbuf, sizeof (acbuf),
(void) vn_rdwr(UIO_WRITE, vp, (caddr_t)&acbuf, sizeof (acbuf),
- (off_t)0, UIO_SYSSPACE, IO_UNIT|IO_APPEND, (int *)0);
-#else
- ilock (ip);
- siz = ip -> i_size;
- if (rdwri (UIO_WRITE, ip, (caddr_t)&acbuf, sizeof (acbuf),
- siz, 1, (int *) 0))
- itrunc (ip, (u_long) siz);
- iunlock (ip);
-#endif
+ (off_t)0, UIO_SYSSPACE, IO_UNIT|IO_APPEND, u.u_cred, (int *)0);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)pk_debug.c 7.2 (Berkeley) %G%
+ * @(#)pk_debug.c 7.3 (Berkeley) %G%
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mbuf.h"
-#include "../h/socket.h"
-#include "../h/protosw.h"
-#include "../h/socketvar.h"
-#include "../h/errno.h"
-
-#include "../netccitt/x25.h"
-#include "../netccitt/pk.h"
-#include "../netccitt/pk_var.h"
+#include "param.h"
+#include "systm.h"
+#include "mbuf.h"
+#include "socket.h"
+#include "protosw.h"
+#include "socketvar.h"
+#include "errno.h"
+
+#include "../net/if.h"
+
+#include "x25.h"
+#include "pk.h"
+#include "pk_var.h"
char *pk_state[] = {
"Listen", "Ready", "Received-Call",
char *pk_state[] = {
"Listen", "Ready", "Received-Call",
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)pk_input.c 7.4 (Berkeley) %G%
+ * @(#)pk_input.c 7.5 (Berkeley) %G%
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mbuf.h"
-#include "../h/socket.h"
-#include "../h/protosw.h"
-#include "../h/socketvar.h"
-#include "../h/errno.h"
+#include "param.h"
+#include "systm.h"
+#include "mbuf.h"
+#include "socket.h"
+#include "protosw.h"
+#include "socketvar.h"
+#include "errno.h"
-#include "../netccitt/x25.h"
-#include "../netccitt/pk.h"
-#include "../netccitt/pk_var.h"
+#include "x25.h"
+#include "pk.h"
+#include "pk_var.h"
/*
* This procedure is called by the link level whenever the link
/*
* This procedure is called by the link level whenever the link
if (bcmp (sxp -> x25_udata, sa -> x25_udata, sxp->x25_udlen))
continue;
if (bcmp (sxp -> x25_udata, sa -> x25_udata, sxp->x25_udlen))
continue;
- if (sxp -> x25_net && sxp -> x25_net != pkp->pk_xcp->xc_net)
+ if (sxp -> x25_net &&
+ sxp -> x25_net != pkp->pk_xc.xc_addr.x25_net)
continue;
/*
* don't accept incoming collect calls unless
continue;
/*
* don't accept incoming collect calls unless
break;
}
if (l -> lcd_so) {
break;
}
if (l -> lcd_so) {
- if (so = sonewconn (l -> lcd_so, SO_ISCONNETED))
+ if (so = sonewconn (l -> lcd_so, SS_ISCONNECTED))
lcp = (struct pklcd *) so -> so_pcb;
} else
lcp = pk_attach((struct socket *) 0);
lcp = (struct pklcd *) so -> so_pcb;
} else
lcp = pk_attach((struct socket *) 0);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)pk_output.c 7.4 (Berkeley) %G%
+ * @(#)pk_output.c 7.5 (Berkeley) %G%
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mbuf.h"
-#include "../h/socket.h"
-#include "../h/socketvar.h"
-#include "../h/protosw.h"
-#include "../h/errno.h"
+#include "param.h"
+#include "systm.h"
+#include "mbuf.h"
+#include "socket.h"
+#include "socketvar.h"
+#include "protosw.h"
+#include "errno.h"
-#include "../netccitt/pk.h"
-#include "../netccitt/pk_var.h"
-#include "../netccitt/x25.h"
+#include "x25.h"
+#include "pk.h"
+#include "pk_var.h"
pk_trace (pkp -> pk_xcp, xp, "P-Out");
/* Pass the packet on down to the link layer */
pk_trace (pkp -> pk_xcp, xp, "P-Out");
/* Pass the packet on down to the link layer */
- (*pkp -> pk_lloutput) (m, pkp -> llnext);
+ (*pkp -> pk_lloutput) (m, pkp -> pk_llnext);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)pk_subr.c 7.5 (Berkeley) %G%
+ * @(#)pk_subr.c 7.6 (Berkeley) %G%
else
lcp -> lcd_state = READY;
} else
else
lcp -> lcd_state = READY;
} else
- sbreserve (&lcp -> lcd_sb, pk_sendpace);
+ sbreserve (&lcp -> lcd_sb, pk_sendspace);
}
if (so) {
so -> so_pcb = (caddr_t) lcp;
}
if (so) {
so -> so_pcb = (caddr_t) lcp;
for (pkp = pkcbhead; ; pkp = pkp -> pk_next) {
if (pkp == 0)
return (ENETUNREACH);
for (pkp = pkcbhead; ; pkp = pkp -> pk_next) {
if (pkp == 0)
return (ENETUNREACH);
- if (pkp -> pk_xcp -> xc_net == sa -> x25_net)
+ if (pkp -> pk_xcp -> xc_addr.x25_net == sa -> x25_net)
lcp -> lcd_windowsize = sa -> x25_opts.op_wsize;
else
sa -> x25_opts.op_wsize = lcp -> lcd_windowsize;
lcp -> lcd_windowsize = sa -> x25_opts.op_wsize;
else
sa -> x25_opts.op_wsize = lcp -> lcd_windowsize;
- sa -> x25_net = pkp -> pk_xcp -> xc_net;
+ sa -> x25_net = pkp -> pk_xcp -> xc_addr.x25_net;
lcp -> lcd_flags = sa -> x25_opts.op_flags;
lcp -> lcd_stime = time.tv_sec;
}
lcp -> lcd_flags = sa -> x25_opts.op_flags;
lcp -> lcd_stime = time.tv_sec;
}
*/
if (sa -> x25_net == 0 && pkp -> pk_next == 0)
break;
*/
if (sa -> x25_net == 0 && pkp -> pk_next == 0)
break;
- if (sa -> x25_net == pkp -> pk_xcp -> xc_net)
+ if (sa -> x25_net == pkp -> pk_xcp -> xc_addr.x25_net)
lcp -> lcd_faddr = *sa;
lcp -> lcd_ceaddr = & lcp->lcd_faddr;
pk_assoc (pkp, lcp, lcp -> lcd_ceaddr);
lcp -> lcd_faddr = *sa;
lcp -> lcd_ceaddr = & lcp->lcd_faddr;
pk_assoc (pkp, lcp, lcp -> lcd_ceaddr);
soisconnecting (lcp -> lcd_so);
lcp -> lcd_template = pk_template (lcp -> lcd_lcn, X25_CALL);
pk_callrequest (lcp, lcp -> lcd_ceaddr, pkp -> pk_xcp);
soisconnecting (lcp -> lcd_so);
lcp -> lcd_template = pk_template (lcp -> lcd_lcn, X25_CALL);
pk_callrequest (lcp, lcp -> lcd_ceaddr, pkp -> pk_xcp);
register struct mbuf *m = dtom (lcp -> lcd_template);
unsigned posn = 0;
octet *cp;
register struct mbuf *m = dtom (lcp -> lcd_template);
unsigned posn = 0;
octet *cp;
- char addr[sizeof (xcp -> xc_ntn) * 2];
a = (struct x25_calladdr *) &lcp -> lcd_template -> packet_data;
a = (struct x25_calladdr *) &lcp -> lcd_template -> packet_data;
- a -> calling_addrlen = xcp -> xc_ntnlen;
- cp = (octet *) xcp -> xc_ntn;
- from_bcd (addr, &cp, xcp -> xc_ntnlen);
+ a -> calling_addrlen = strlen (xcp -> xc_addr.x25_addr);
a -> called_addrlen = strlen (sa -> x25_addr);
cp = (octet *) a -> address_field;
to_bcd (&cp, (int)a -> called_addrlen, sa -> x25_addr, &posn);
a -> called_addrlen = strlen (sa -> x25_addr);
cp = (octet *) a -> address_field;
to_bcd (&cp, (int)a -> called_addrlen, sa -> x25_addr, &posn);
- to_bcd (&cp, (int)a -> calling_addrlen, addr, &posn);
+ to_bcd (&cp, (int)a -> calling_addrlen, xcp -> xc_addr.x25_addr, &posn);
if (posn & 0x01)
*cp++ &= 0xf0;
if (posn & 0x01)
*cp++ &= 0xf0;
format_ntn (xcp)
register struct x25config *xcp;
{
format_ntn (xcp)
register struct x25config *xcp;
{
- register int i;
- register char *src, *dest;
- static char ntn[12];
-
- src = xcp->xc_ntn;
- dest = ntn;
- for (i = 0; i < xcp->xc_ntnlen / 2; i++) {
- *dest++ = ((*src & 0xf0) >> 4) + '0';
- *dest++ = (*src++ & 0xf) + '0';
- }
- if (xcp->xc_ntnlen & 01)
- dest[-1] = 0;
- else
- *dest = 0;
- return (ntn);
+
+ return (xcp -> xc_addr.x25_addr);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)pk_timer.c 7.2 (Berkeley) %G%
+ * @(#)pk_timer.c 7.3 (Berkeley) %G%
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mbuf.h"
-#include "../h/socket.h"
-#include "../h/protosw.h"
-#include "../h/socketvar.h"
-#include "../h/errno.h"
+#include "param.h"
+#include "systm.h"
+#include "mbuf.h"
+#include "socket.h"
+#include "protosw.h"
+#include "socketvar.h"
+#include "errno.h"
-#include "../netccitt/pk.h"
-#include "../netccitt/pk_var.h"
+#include "x25.h"
+#include "pk.h"
+#include "pk_var.h"
/*
* Various timer values. They can be adjusted
/*
* Various timer values. They can be adjusted
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)pk_usrreq.c 7.6 (Berkeley) %G%
+ * @(#)pk_usrreq.c 7.7 (Berkeley) %G%
req, (struct x25_packet *)0);
*/
req, (struct x25_packet *)0);
*/
switch (req) {
/*
* X.25 attaches to socket via PRU_ATTACH and allocates a logical
switch (req) {
/*
* X.25 attaches to socket via PRU_ATTACH and allocates a logical
/* Socket already connected. */
break;
}
/* Socket already connected. */
break;
}
- error = pk_attach (so);
+ lcp = pk_attach (so);
+ if (lcp == 0)
+ error = ENOBUFS;
- lcp -> lcp_send = pk_send;
+ lcp -> lcd_send = pk_send;
return (pk_output(lcp));
}
return (pk_output(lcp));
}
case SIOCGIFCONF_X25:
if (ifa == 0)
return (EADDRNOTAVAIL);
case SIOCGIFCONF_X25:
if (ifa == 0)
return (EADDRNOTAVAIL);
- ifr->ifr_xc = *(struct sockaddr *)ia->ia_xc;
+ ifr->ifr_xc = ia->ia_xc;
return (0);
case SIOCSIFCONF_X25:
return (0);
case SIOCSIFCONF_X25:
- if (!suser())
- return (u.u_error);
-
+ if (error = suser(u.u_cred, &u.u_acflag))
+ return (error);
if (ifp == 0)
panic("pk_control");
if (ifa == (struct ifaddr *)0) {
if (ifp == 0)
panic("pk_control");
if (ifa == (struct ifaddr *)0) {
ifp->if_addrlist = &ia->ia_ifa;
ifa = &ia->ia_ifa;
ifa->ifa_netmask = (struct sockaddr *)&ia->ia_sockmask;
ifp->if_addrlist = &ia->ia_ifa;
ifa = &ia->ia_ifa;
ifa->ifa_netmask = (struct sockaddr *)&ia->ia_sockmask;
- ifa->ifa_addr = (struct sockaddr *)&ia->ia_addr;
+ ifa->ifa_addr = (struct sockaddr *)&ia->ia_xc.xc_addr;
ia->ia_ifp = ifp;
ia->ia_pkcb.pk_ia = ia;
ia->ia_pkcb.pk_next = pkcbhead;
pkcbhead = &ia->ia_pkcb;
}
ia->ia_xcp = &(ifr->ifr_xc);
ia->ia_ifp = ifp;
ia->ia_pkcb.pk_ia = ia;
ia->ia_pkcb.pk_next = pkcbhead;
pkcbhead = &ia->ia_pkcb;
}
ia->ia_xcp = &(ifr->ifr_xc);
- if (ia->ia_chan && (ia->ia_maxlcn != ia->xcp->xc_maxlcn)) {
- pk_restart(&ia->ia_pkp, X25_RESTART_NETWORK_CONGESTION);
+ if (ia->ia_chan && (ia->ia_maxlcn != ia->ia_xcp->xc_maxlcn)) {
+ pk_restart(&ia->ia_pkcb, X25_RESTART_NETWORK_CONGESTION);
dev_lcp = ia->ia_chan[0];
free((caddr_t)ia->ia_chan, M_IFADDR);
ia->ia_chan = 0;
dev_lcp = ia->ia_chan[0];
free((caddr_t)ia->ia_chan, M_IFADDR);
ia->ia_chan = 0;
bzero((caddr_t)ia->ia_chan, n);
if (dev_lcp == 0)
dev_lcp = pk_attach((struct socket *)0);
bzero((caddr_t)ia->ia_chan, n);
if (dev_lcp == 0)
dev_lcp = pk_attach((struct socket *)0);
+ ia->ia_chan[0] = dev_lcp;
} else {
if (dev_lcp)
pk_close(dev_lcp);
} else {
if (dev_lcp)
pk_close(dev_lcp);
*/
s = splimp();
if (ifp->if_ioctl)
*/
s = splimp();
if (ifp->if_ioctl)
- error = (*ifp->if_ioctl)(ifp, SIOCSIFCONF_X25, ifa)));
+ error = (*ifp->if_ioctl)(ifp, SIOCSIFCONF_X25, ifa);
splx(s);
if (error == 0) {
ia->ia_xc = *ia->ia_xcp;
splx(s);
if (error == 0) {
ia->ia_xc = *ia->ia_xcp;
-#ifndef WATERLOO
- (void) pk_accton ();
-#endif
}
ia->ia_xcp = &ia->ia_xc;
return (error);
}
ia->ia_xcp = &ia->ia_xc;
return (error);
+pk_ctloutput(cmd, so, level, optname, mp)
+struct socket *so;
+struct mbuf **mp;
+int cmd, level, optname;
+{
+ register struct mbuf *m = *mp;
+ int error;
+
+ if (cmd == PRCO_SETOPT) switch (optname) {
+ case PK_ACCTFILE:
+ if (m == 0)
+ return (EINVAL);
+ if (m->m_len)
+ error = pk_accton(mtod(m, char *));
+ else
+ error = pk_accton((char *)0);
+ (void) m_freem(m);
+ *mp = 0;
+ return (error);
+ }
+ if (*mp) {
+ (void) m_freem(*mp);
+ *mp = 0;
+ }
+ return (EOPNOTSUPP);
+
+}
+
/*
* Do an in-place conversion of an "old style"
* socket address to the new style
/*
* Do an in-place conversion of an "old style"
* socket address to the new style
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)pk_var.h 7.5 (Berkeley) %G%
+ * @(#)pk_var.h 7.6 (Berkeley) %G%
short lcd_intrcnt; /* Interrupt packet transmit count */
struct pklcd *lcd_listen; /* Next lcd on listen queue */
struct pkcb *lcd_pkp; /* Network this lcd is attached to */
short lcd_intrcnt; /* Interrupt packet transmit count */
struct pklcd *lcd_listen; /* Next lcd on listen queue */
struct pkcb *lcd_pkp; /* Network this lcd is attached to */
- struct sockaddr_x25 lcd_faddr /* Remote Address (Calling) */
- struct sockaddr_x25 lcd_laddr /* Local Address (Called) */
+ struct sockaddr_x25 lcd_faddr; /* Remote Address (Calling) */
+ struct sockaddr_x25 lcd_laddr; /* Local Address (Called) */
struct sockbuf lcd_sb; /* alternate for datagram service */
};
struct sockbuf lcd_sb; /* alternate for datagram service */
};
struct pkcb ia_pkcb; /* per network information */
#define ia_maxlcn ia_pkcb.pk_maxlcn
#define ia_chan ia_pkcb.pk_chan
struct pkcb ia_pkcb; /* per network information */
#define ia_maxlcn ia_pkcb.pk_maxlcn
#define ia_chan ia_pkcb.pk_chan
-#define ia_addr ia_pkcb.pk_xc.xc_addr
+#define ia_xc ia_pkcb.pk_xc
+#define ia_xcp ia_pkcb.pk_xcp
struct sockaddr_x25 ia_sockmask; /* reserve space for netmask */
};
struct sockaddr_x25 ia_sockmask; /* reserve space for netmask */
};
* ``Link-Level'' extension to Routing Entry for upper level
* packet switching via X.25 virtual circuits.
*/
* ``Link-Level'' extension to Routing Entry for upper level
* packet switching via X.25 virtual circuits.
*/
-struct rtextension_x25 {
- struct pklcd *rtx_lcd; /* local connection block */
- struct rtentry *rtx_rt; /* back pointer to route */
- struct x25_ifaddr *rtx_ia; /* may not be same as rt_ifa */
- int rtx_state; /* can't trust lcd->lcd_state */
- int rtx_flags;
- int rtx_timer; /* for idle timeout */
+struct llinfo_x25 {
+ struct pklcd *lx_lcd; /* local connection block */
+ struct rtentry *lx_rt; /* back pointer to route */
+ struct x25_ifaddr *lx_ia; /* may not be same as rt_ifa */
+ int lx_state; /* can't trust lcd->lcd_state */
+ int lx_flags;
+ int lx_timer; /* for idle timeout */
-/* States for rtx_state */
-#define XRS_NEWBORN 0
-#define XRS_RESOLVING 1
-#define XRS_FREE 2
-#define XRS_CONNECTED 3
-#define XRS_CONNECTING 4
-#define XRS_DISCONNECTING 5
+/* States for lx_state */
+#define LXS_NEWBORN 0
+#define LXS_RESOLVING 1
+#define LXS_FREE 2
+#define LXS_CONNECTED 3
+#define LXS_CONNECTING 4
+#define LXS_DISCONNECTING 5
-#define XRF_VALID 0x1 /* Circuit is live, etc. */
-#define XRF_RTHELD 0x2 /* this lcb references rtentry */
+#define LXF_VALID 0x1 /* Circuit is live, etc. */
+#define LXF_RTHELD 0x2 /* this lcb references rtentry */
#ifdef KERNEL
struct pkcb *pkcbhead; /* head of linked list of networks */
#ifdef KERNEL
struct pkcb *pkcbhead; /* head of linked list of networks */
#define HDLCPROTO_UNSET 3
#define HDLCPROTO_LAPD 4
#define HDLCPROTO_UNSET 3
#define HDLCPROTO_LAPD 4
+/* socket options */
+#define PK_ACCTFILE 1 /* use level = CCITTPROTO_X25 */
+
/*
* X.25 Socket address structure. It contains the X.121 or variation of
* X.121, facilities information, higher level protocol value (first four
/*
* X.25 Socket address structure. It contains the X.121 or variation of
* X.121, facilities information, higher level protocol value (first four
xc_ptrace:1, /* packet level tracing flag */
xc_rsvd2:5;
u_short xc_maxlcn; /* max logical channels */
xc_ptrace:1, /* packet level tracing flag */
xc_rsvd2:5;
u_short xc_maxlcn; /* max logical channels */
- u_short xc_dg_idletimo; /* timeout for idle datagram circuits.
+ u_short xc_dg_idletimo; /* timeout for idle datagram circuits. */