Date: Wed, 9 Oct 2002 09:10:04 -0700 (PDT) From: "Joe Horn" <joehorn@CINA.chu.edu.tw> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/43857: conflicting types in /usr/src/usr.sbin/i4b/isdnd/support.c Message-ID: <200210091610.g99GA4iN056815@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/43857; it has been noted by GNATS.
From: "Joe Horn" <joehorn@CINA.chu.edu.tw>
To: <FreeBSD-gnats-submit@FreeBSD.org>, <freebsd-bugs@FreeBSD.org>
Cc:
Subject: Re: bin/43857: conflicting types in /usr/src/usr.sbin/i4b/isdnd/support.c
Date: Wed, 9 Oct 2002 23:51:28 +0800
Sorry, before diff file is not actually correct.
Please use this:
*** /usr/src/usr.sbin/i4b/isdnd/support.c.orig Sun Dec 16 23:13:38 2001
--- /usr/src/usr.sbin/i4b/isdnd/support.c Wed Oct 9 22:51:43 2002
***************
*** 112,118 ****
continue;
}
-
/* found, check if already reserved */
if(cep->cdid == CDID_RESERVED)
--- 112,117 ----
***************
*** 150,157 ****
/*--------------------------------------------------------------------------
-*
* find entry by drivertype and driverunit and setup for dialing out
*---------------------------------------------------------------------------
*/
find_by_device_for_dialoutnumber(int drivertype, int driverunit, int
cmdlen, char *cmd)
- find_by_device_for_dialoutnumber(msg_dialoutnumber_ind_t *mp)
{
cfg_entry_t *cep = NULL;
int i, j;
--- 149,156 ----
/*--------------------------------------------------------------------------
-*
* find entry by drivertype and driverunit and setup for dialing out
*---------------------------------------------------------------------------
*/
+ cfg_entry_t *
find_by_device_for_dialoutnumber(int drivertype, int driverunit, int
cmdlen, char *cmd)
{
cfg_entry_t *cep = NULL;
int i, j;
***************
*** 161,172 ****
cep = &cfg_entry_tab[i]; /* ptr to config entry */
/* compare driver type and unit */
if(!((cep->usrdevicename == drivertype) &&
(cep->usrdeviceunit == driverunit)))
- (cep->usrdeviceunit == mp->driver_unit)))
{
continue;
}
/* check time interval */
if(isvalidtime(cep) == 0)
--- 160,172 ----
cep = &cfg_entry_tab[i]; /* ptr to config entry */
/* compare driver type and unit */
+
if(!((cep->usrdevicename == drivertype) &&
(cep->usrdeviceunit == driverunit)))
{
continue;
}
+
/* check time interval */
if(isvalidtime(cep) == 0)
***************
*** 175,181 ****
continue;
}
-
/* found, check if already reserved */
if(cep->cdid == CDID_RESERVED)
--- 175,180 ----
***************
*** 191,212 ****
DBGL(DL_MSG, (log(LL_DBG, "find_by_device_for_dialoutnumber: entry %d,
cdid in use", i)));
return(NULL);
}
cep->keypad[0] = '\0';
-
/* check number and copy to cep->remote_numbers[] */
for(j = 0; j < cmdlen; j++)
! for(j = 0; j < mp->cmdlen; j++)
if(!(isdigit(*(cmd+j))))
- if(!(isdigit(*(mp->cmd+j))))
{
DBGL(DL_MSG, (log(LL_DBG, "find_by_device_for_dialoutnumber: entry %d,
dial string contains non-digit at pos %d", i, j)));
return(NULL);
}
cep->remote_numbers[0].number[j] = *(cmd+j);
- cep->remote_numbers[0].number[j] = *(mp->cmd+j);
}
!
cep->remote_numbers_count = 1;
if((setup_dialout(cep)) == GOOD)
--- 190,211 ----
DBGL(DL_MSG, (log(LL_DBG, "find_by_device_for_dialoutnumber: entry %d,
cdid in use", i)));
return(NULL);
}
+
cep->keypad[0] = '\0';
/* check number and copy to cep->remote_numbers[] */
+
for(j = 0; j < cmdlen; j++)
! {
if(!(isdigit(*(cmd+j))))
{
DBGL(DL_MSG, (log(LL_DBG, "find_by_device_for_dialoutnumber: entry %d,
dial string contains non-digit at pos %d", i, j)));
return(NULL);
}
+ /* fill in number to dial */
cep->remote_numbers[0].number[j] = *(cmd+j);
}
! cep->remote_numbers[0].number[j] = '\0';
cep->remote_numbers_count = 1;
if((setup_dialout(cep)) == GOOD)
***************
*** 223,228 ****
--- 222,228 ----
}
}
+ DBGL(DL_MSG, (log(LL_DBG, "find_by_device_for_dialoutnumber: no entry
found!")));
return(NULL);
}
***************
*** 295,301 ****
}
DBGL(DL_MSG, (log(LL_DBG, "find_by_device_for_keypad: no entry
found!")));
- DBGL(DL_MSG, (log(LL_DBG, "find_by_device_for_keypad: no entry
found!")));
return(NULL);
}
--- 295,300 ----
***************
*** 304,312 ****
*---------------------------------------------------------------------------
*/
int
setup_dialout(cfg_entry_t *cep)
int i;
-
/* check controller operational */
if((get_controller_state(cep->isdncontroller)) != CTRL_UP)
--- 303,311 ----
*---------------------------------------------------------------------------
*/
int
setup_dialout(cfg_entry_t *cep)
+ {
int i;
/* check controller operational */
if((get_controller_state(cep->isdncontroller)) != CTRL_UP)
***************
*** 320,333 ****
/* check channel available */
switch(cep->isdnchannel)
case CHAN_ANY:
for (i = 0; i < isdn_ctrl_tab[cep->isdncontroller].nbch; i++)
! for (i = 0; i < isdn_ctrl_tab[cep->isdncontroller].nbch; i++)
! if(ret_channel_state(cep->isdncontroller, i) == CHAN_IDLE)
if(ret_channel_state(cep->isdncontroller, i) == CHAN_IDLE)
}
! }
! if (i == isdn_ctrl_tab[cep->isdncontroller].nbch)
if (i == isdn_ctrl_tab[cep->isdncontroller].nbch)
{
DBGL(DL_MSG, (log(LL_DBG, "setup_dialout: entry %s, no channel free",
cep->name)));
--- 319,332 ----
/* check channel available */
switch(cep->isdnchannel)
+ {
case CHAN_ANY:
for (i = 0; i < isdn_ctrl_tab[cep->isdncontroller].nbch; i++)
! {
if(ret_channel_state(cep->isdncontroller, i) == CHAN_IDLE)
+ break;
}
!
if (i == isdn_ctrl_tab[cep->isdncontroller].nbch)
{
DBGL(DL_MSG, (log(LL_DBG, "setup_dialout: entry %s, no channel free",
cep->name)));
***************
*** 336,348 ****
cep->isdnchannelused = CHAN_ANY;
break;
if((ret_channel_state(cep->isdncontroller, cep->isdnchannel)) !=
CHAN_IDLE)
{
DBGL(DL_MSG, (log(LL_DBG, "setup_dialout: entry %s, channel not free",
cep->name)));
! DBGL(DL_MSG, (log(LL_DBG, "setup_dialout: entry %s, channel not free",
cep->name)));
}
cep->isdnchannelused = cep->isdnchannel;
- cep->isdnchannelused = cep->isdnchannel;
break;
}
--- 335,347 ----
cep->isdnchannelused = CHAN_ANY;
break;
+ default:
if((ret_channel_state(cep->isdncontroller, cep->isdnchannel)) !=
CHAN_IDLE)
{
DBGL(DL_MSG, (log(LL_DBG, "setup_dialout: entry %s, channel not free",
cep->name)));
! return(ERROR);
}
cep->isdnchannelused = cep->isdnchannel;
break;
}
***************
*** 374,379 ****
--- 373,379 ----
{
continue;
}
+
/* check time interval */
if(isvalidtime(cep) == 0)
***************
*** 382,388 ****
continue;
}
-
DBGL(DL_MSG, (log(LL_DBG, "get_cep_by_driver: found entry %d!", i)));
return(cep);
}
--- 382,387 ----
***************
*** 430,461 ****
cep = &cfg_entry_tab[i]; /* ptr to config entry */
/* check my number */
if(strncmp(cep->local_phone_incoming, mp->dst_telno,
strlen(cep->local_phone_incoming)))
- if(strncmp(cep->local_phone_incoming.number, mp->dst_telno,
strlen(cep->local_phone_incoming.number)))
{
cep->local_phone_incoming, mp->dst_telno)));
- cep->local_phone_incoming.subaddr, mp->dst_subaddr)));
continue;
}
/* check all allowed remote number's for this entry */
- /* check all allowed remote number's for this entry */
for (n = 0; n < cep->incoming_numbers_count; n++)
{
if(in->number[0] == '*')
! if(in->number[0] == '*' && cep->usesubaddr && !strncmp(in->subaddr,
mp->src_subaddr, strlen(in->subaddr)))
if(strncmp(in->number, mp->src_telno, strlen(in->number)))
- if(strncmp(in->number, mp->src_telno, strlen(in->number)) &&
cep->usesubaddr && strncmp(in->subaddr, mp->src_subaddr,
strlen(in->subaddr)))
{
DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: entry %d,
remno %s != incomingfromno %s", i,
in->number, mp->src_telno)));
else
break;
! break;
!
if (n >= cep->incoming_numbers_count)
-
/* check b protocol */
if(cep->b1protocol != mp->bprot)
--- 429,460 ----
cep = &cfg_entry_tab[i]; /* ptr to config entry */
/* check my number */
+
if(strncmp(cep->local_phone_incoming, mp->dst_telno,
strlen(cep->local_phone_incoming)))
{
+ DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: entry %d, myno
%s != incomingno %s", i,
cep->local_phone_incoming, mp->dst_telno)));
continue;
}
+
/* check all allowed remote number's for this entry */
for (n = 0; n < cep->incoming_numbers_count; n++)
{
+ incoming_number_t *in = &cep->remote_phone_incoming[n];
if(in->number[0] == '*')
! break;
if(strncmp(in->number, mp->src_telno, strlen(in->number)))
{
DBGL(DL_MSG, (log(LL_DBG, "find_matching_entry_incoming: entry %d,
remno %s != incomingfromno %s", i,
in->number, mp->src_telno)));
+ }
else
break;
! }
if (n >= cep->incoming_numbers_count)
+ continue;
/* check b protocol */
if(cep->b1protocol != mp->bprot)
***************
*** 515,522 ****
{
log(LL_CHD, "%05d %s incoming call, controller %d DOWN!",
mp->header.cdid, cep->name, mp->controller);
! continue;
}
/*
* check controller he wants, check for any
* controller or specific controller
--- 514,522 ----
{
log(LL_CHD, "%05d %s incoming call, controller %d DOWN!",
mp->header.cdid, cep->name, mp->controller);
! return(NULL);
}
+
/*
* check controller he wants, check for any
* controller or specific controller
***************
*** 531,548 ****
continue;
}
-
/* check channel he wants */
switch(mp->channel)
case CHAN_ANY:
for (i = 0; i < isdn_ctrl_tab[mp->controller].nbch; i++)
! for (i = 0; i < isdn_ctrl_tab[mp->controller].nbch; i++)
! if(ret_channel_state(mp->controller, i) == CHAN_IDLE)
if(ret_channel_state(mp->controller, i) == CHAN_IDLE)
}
! }
! if (i == isdn_ctrl_tab[mp->controller].nbch)
if (i == isdn_ctrl_tab[mp->controller].nbch)
{
log(LL_CHD, "%05d %s incoming call, no channel free!",
--- 531,547 ----
continue;
}
/* check channel he wants */
switch(mp->channel)
+ {
case CHAN_ANY:
for (i = 0; i < isdn_ctrl_tab[mp->controller].nbch; i++)
! {
if(ret_channel_state(mp->controller, i) == CHAN_IDLE)
+ break;
}
!
if (i == isdn_ctrl_tab[mp->controller].nbch)
{
log(LL_CHD, "%05d %s incoming call, no channel free!",
***************
*** 557,571 ****
return(NULL);
break;
if((ret_channel_state(mp->controller, mp->channel)) != CHAN_IDLE)
{
log(LL_CHD, "%05d %s incoming call, channel B%d not free!",
mp->header.cdid, cep->name, mp->channel+1);
! mp->header.cdid, cep->name, mp->channel+1);
! }
}
break;
}
/* check time interval */
if(isvalidtime(cep) == 0)
--- 556,571 ----
return(NULL);
break;
+ default:
if((ret_channel_state(mp->controller, mp->channel)) != CHAN_IDLE)
{
log(LL_CHD, "%05d %s incoming call, channel B%d not free!",
mp->header.cdid, cep->name, mp->channel+1);
! return(NULL);
}
break;
}
+
/* check time interval */
if(isvalidtime(cep) == 0)
***************
*** 574,590 ****
continue;
}
-
/* found a matching entry */
cep->cdid = mp->header.cdid;
cep->isdncontrollerused = mp->controller;
cep->isdnchannelused = mp->channel;
!
/* cp number to real one used */
strcpy(cep->real_phone_incoming, mp->src_telno);
- strcpy(cep->real_phone_incoming.number, mp->src_telno);
/* copy display string */
--- 574,589 ----
continue;
}
/* found a matching entry */
cep->cdid = mp->header.cdid;
cep->isdncontrollerused = mp->controller;
cep->isdnchannelused = mp->channel;
! /*XXX*/ cep->disc_cause = 0;
/* cp number to real one used */
+
strcpy(cep->real_phone_incoming, mp->src_telno);
/* copy display string */
***************
*** 628,636 ****
mp->header.cdid, src_tela, dst_tela);
}
else
log(LL_CHD, "%05d <unknown> incoming call from %s to %s ctrl %d",
mp->header.cdid, mp->src_telno, mp->dst_telno, mp->controller);
- mp->header.cdid, mp->src_telno, mp->dst_telno, mp->controller);
}
return(NULL);
}
--- 627,635 ----
mp->header.cdid, src_tela, dst_tela);
}
else
+ {
log(LL_CHD, "%05d <unknown> incoming call from %s to %s ctrl %d",
mp->header.cdid, mp->src_telno, mp->dst_telno, mp->controller);
}
return(NULL);
}
***************
*** 642,648 ****
get_cep_by_cc(int ctrlr, int chan)
{
int i;
! if((chan < 0) || (chan >= isdn_ctrl_tab[ctrlr].nbch))
if((chan < 0) || (chan >= isdn_ctrl_tab[ctrlr].nbch))
return(NULL);
--- 641,647 ----
get_cep_by_cc(int ctrlr, int chan)
{
int i;
!
if((chan < 0) || (chan >= isdn_ctrl_tab[ctrlr].nbch))
return(NULL);
***************
*** 687,697 ****
"rbch",
"tel",
"ipr",
"ibc",
"ing"
- "ing"
};
! if(drivertype >= BDRV_RBCH && drivertype <= BDRV_ING)
if(drivertype >= BDRV_RBCH && drivertype <= BDRV_ING)
return(bdtab[drivertype]);
else
--- 686,696 ----
"rbch",
"tel",
"ipr",
+ "isp",
"ibc",
"ing"
};
!
if(drivertype >= BDRV_RBCH && drivertype <= BDRV_ING)
return(bdtab[drivertype]);
else
***************
*** 797,803 ****
*--------------------------------------------------------------------------*
/
void
close_allactive(void)
! int i, j, k;
int i, j, k;
cfg_entry_t *cep = NULL;
--- 796,802 ----
*--------------------------------------------------------------------------*
/
void
close_allactive(void)
! {
int i, j, k;
cfg_entry_t *cep = NULL;
***************
*** 807,817 ****
{
if((get_controller_state(i)) != CTRL_UP)
continue;
for (k = 0; k < isdn_ctrl_tab[i].nbch; k++)
! for (k = 0; k < isdn_ctrl_tab[i].nbch; k++)
! if((ret_channel_state(i, k)) == CHAN_RUN)
if((ret_channel_state(i, k)) == CHAN_RUN)
! if((cep = get_cep_by_cc(i, k)) != NULL)
if((cep = get_cep_by_cc(i, k)) != NULL)
{
#ifdef USE_CURSES
--- 806,816 ----
{
if((get_controller_state(i)) != CTRL_UP)
continue;
+
for (k = 0; k < isdn_ctrl_tab[i].nbch; k++)
! {
if((ret_channel_state(i, k)) == CHAN_RUN)
! {
if((cep = get_cep_by_cc(i, k)) != NULL)
{
#ifdef USE_CURSES
***************
*** 823,829 ****
#endif
next_state(cep, EV_DRQ);
j++;
! }
}
}
}
--- 822,828 ----
#endif
next_state(cep, EV_DRQ);
j++;
! }
}
}
}
***************
*** 935,940 ****
--- 934,940 ----
}
DBGL(DL_DRVR, (log(LL_DBG, "dialresponse: sent [%s]", stattab[dstat])));
+ }
/*--------------------------------------------------------------------------
*
* screening/presentation indicator
***************
*** 1093,1097 ****
return(0);
}
- /* EOF */
/* EOF */
--- 1093,1096 ----
----- Original Message -----
From: <FreeBSD-gnats-submit@FreeBSD.org>
To: "Joe Horn" <joehorn@Star.CINA.chu.edu.tw>
Sent: Wednesday, October 09, 2002 8:00 PM
Subject: Re: bin/43857: conflicting types in
/usr/src/usr.sbin/i4b/isdnd/support.c
> Thank you very much for your problem report.
> It has the internal identification `bin/43857'.
> The individual assigned to look at your
> report is: freebsd-bugs.
>
> You can access the state of your problem report at any time
> via this link:
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=43857
>
> >Category: bin
> >Responsible: freebsd-bugs
> >Synopsis: conflicting types in
/usr/src/usr.sbin/i4b/isdnd/support.c
> >Arrival-Date: Wed Oct 09 05:00:16 PDT 2002
>
>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210091610.g99GA4iN056815>
