diff options
author | Hellmuth Michaelis <hm@FreeBSD.org> | 1999-12-14 20:48:35 +0000 |
---|---|---|
committer | Hellmuth Michaelis <hm@FreeBSD.org> | 1999-12-14 20:48:35 +0000 |
commit | acfb47d41cfb4df742a37277d3a6aa0ee94e2faa (patch) | |
tree | ead126347847bb4825729267f9316802d6a0a4d4 /sys/i4b/layer4/i4b_l4.c | |
parent | ea8271a8bbc80f9e936cec7ba35754cc4a4065e6 (diff) |
update to isdn4bsd beta release 0.90
Notes
Notes:
svn path=/head/; revision=54608
Diffstat (limited to 'sys/i4b/layer4/i4b_l4.c')
-rw-r--r-- | sys/i4b/layer4/i4b_l4.c | 39 |
1 files changed, 35 insertions, 4 deletions
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 <sys/param.h> -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 +#if defined(__FreeBSD__) #include <sys/ioccom.h> #else #include <sys/ioctl.h> @@ -77,6 +79,10 @@ #include <i4b/layer3/i4b_l3.h> #include <i4b/layer4/i4b_l4.h> +#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); @@ -554,6 +560,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 <MAX_PACKET_LOG ? len : MAX_PACKET_LOG); + i4bputqueue(m); + } +} + +/*---------------------------------------------------------------------------* * link a driver(unit) to a B-channel(controller,unit,channel) *---------------------------------------------------------------------------*/ static int |