From ecb32ede6ab411b9c209d0e641da00bd18357b23 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Mon, 21 May 2001 13:39:30 +0000 Subject: [PATCH] Version 0.1.1 from FTP git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@8 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- pri_q921.h | 7 +++++++ q921.c | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/pri_q921.h b/pri_q921.h index d10b31c..aa7b720 100755 --- a/pri_q921.h +++ b/pri_q921.h @@ -41,6 +41,13 @@ #define Q921_FRAMETYPE_I 0x0 #define Q921_FRAMETYPE_S 0x1 +#define Q921_TEI_GROUP 127 + +#define Q921_SAPI_CALL_CTRL 0 +#define Q921_SAPI_PACKET_MODE 1 +#define Q921_SAPI_X25_LAYER3 16 +#define Q921_SAPI_LAYER2_MANAGEMENT 63 + typedef struct q921_header { #if __BYTE_ORDER == __BIG_ENDIAN diff --git a/q921.c b/q921.c index d12a956..aad39b1 100755 --- a/q921.c +++ b/q921.c @@ -347,6 +347,7 @@ void q921_dump(q921_h *h, int len, int showraw, int txrx) printf("%02x ",h->raw[x]); printf("]\n"); } + switch(h->h.data[0] & Q921_FRAMETYPE_MASK) { case 0: case 2: @@ -482,7 +483,15 @@ pri_event *q921_receive(struct pri *pri, q921_h *h, int len) /* Check some reject conditions -- Start by rejecting improper ea's */ if (h->h.ea1 || !(h->h.ea2)) return NULL; + + /* Check for broadcasts - not yet handled */ + if (h->h.tei == Q921_TEI_GROUP) + return NULL; + /* Check for SAPIs we don't yet handle */ + if (h->h.sapi != Q921_SAPI_CALL_CTRL) + return NULL; + switch(h->h.data[0] & Q921_FRAMETYPE_MASK) { case 0: case 2: @@ -620,4 +629,3 @@ void q921_start(struct pri *pri) /* Do the SABME XXX Maybe we should implement T_WAIT? XXX */ q921_send_sabme(pri); } -