From acfb47d41cfb4df742a37277d3a6aa0ee94e2faa Mon Sep 17 00:00:00 2001 From: Hellmuth Michaelis Date: Tue, 14 Dec 1999 20:48:35 +0000 Subject: update to isdn4bsd beta release 0.90 --- sys/i4b/layer4/i4b_l4.c | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) (limited to 'sys/i4b/layer4/i4b_l4.c') diff --git a/sys/i4b/layer4/i4b_l4.c b/sys/i4b/layer4/i4b_l4.c index 60cf4dc34123..920772cba1e4 100644 --- a/sys/i4b/layer4/i4b_l4.c +++ b/sys/i4b/layer4/i4b_l4.c @@ -27,9 +27,11 @@ * i4b_l4.c - kernel interface to userland * ----------------------------------------- * - * $FreeBSD$ + * $Id: i4b_l4.c,v 1.45 1999/12/13 21:25:28 hm Exp $ * - * last edit-date: [Thu Apr 8 17:31:52 1999] + * $FreeBSD$ + * + * last edit-date: [Mon Dec 13 22:06:17 1999] * *---------------------------------------------------------------------------*/ @@ -47,7 +49,7 @@ #if NI4B > 0 #include -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 +#if defined(__FreeBSD__) #include #else #include @@ -77,6 +79,10 @@ #include #include +#if !defined(__FreeBSD__) && !defined(__NetBSD__) +#define memcpy(dst, src, len) bcopy((src), (dst), (len)) +#endif + unsigned int i4b_l4_debug = L4_DEBUG_DEFAULT; struct ctrl_type_desc ctrl_types[CTRL_NUMTYPES] = { { NULL, NULL} }; @@ -109,7 +115,7 @@ i4b_l4_pdeact(int controller, int numactive) if(cd->timeout_active) { -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 +#if defined(__FreeBSD__) untimeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd, cd->idle_timeout_handle); #else untimeout((TIMEOUT_FUNC_T)i4b_idle_check,(void *)cd); @@ -553,6 +559,31 @@ i4b_l4_proceeding_ind(call_desc_t *cd) } } +/*---------------------------------------------------------------------------* + * send MSG_PACKET_IND message to userland + *---------------------------------------------------------------------------*/ +void +i4b_l4_packet_ind(int driver, int driver_unit, int dir, struct mbuf *pkt) +{ + struct mbuf *m; + int len = pkt->m_pkthdr.len; + unsigned char *ip = pkt->m_data; + + if((m = i4b_Dgetmbuf(sizeof(msg_packet_ind_t))) != NULL) + { + msg_packet_ind_t *mp = (msg_packet_ind_t *)m->m_data; + + mp->header.type = MSG_PACKET_IND; + mp->header.cdid = -1; + mp->driver = driver; + mp->driver_unit = driver_unit; + mp->direction = dir; + memcpy(mp->pktdata, ip, + len