Project

General

Profile

askBrian.txt

Kyle Hazelwood, 01/15/2015 12:00 PM

 
1
Undocumented error code 3 0 triggered a database lookup.
2

    
3

    
4
/******************************************************************************/
5
/*+> int c453_td2(int rw,int type,int table_num, int slot_num,
6
                 int num_slots, short *raw,int scaled, int ndis, int *dis)
7
*++    Called by c453_config for 'r/w' same-type tables of a group.
8
*+    a companion of c453_td1 that is for single table. Both use
9
*+    tbl_type2dis to give dis.
10
-*/
11
/******************************************************************************/
12
int c453_td2(int rw,int type,int table_num, int slot_num,
13
               int num_slots, short *raw, int scaled, int ndis, int *dis)
14
{
15
 int            i,lst_id,sts;
16
 short            *errs=NULL;
17
 short            tnum, ttype, snum, nums;
18
 static  short        slot_use = - SLOT_WHOLE;
19
 static  int        cancel = TRUE;
20
 static  short         ftd = FTD_ONESHOT;
21
 int            inx, ndiss, ndis_per_step, ndis_left;
22
 char            dn[9] = "";
23
 char            mes[80];
24

    
25
 if (ndis==0) return(MYERR);
26
 ndis_per_step = MAX_ACNET_BUFF_SIZE / num_slots / 2;
27
 if (rw == SET) ndis_per_step /= 2;
28
 errs = (short *)clib_malloc((ndis_per_step+1)*sizeof(short));
29
 memset_word_c(errs,0,ndis_per_step+1);
30
 ndis_left = ndis;
31
 inx = 0;
32
 tnum = -(short)table_num;
33
 ttype = -(short)type;
34
 snum = - (short)slot_num;
35
 nums = - (short)num_slots;
36
 while (ndis_left > 0) {
37
    if (ndis_left > ndis_per_step) ndiss = ndis_per_step;
38
    else ndiss = ndis_left;
39
    sts = td_build(&lst_id, &ndiss, &dis[inx], &tnum, &ttype,
40
           &snum, &nums, &slot_use, &scaled, errs, &ftd, &cancel);
41
    if (sts) {
42
       for (i = 0; i < ndiss; i++) {
43
          if (errs[i]) {
44
         di2dname(dis[inx+i],dn);
45
             sprintf(mes,"Err:td_build -dn %.*s, in c453_td2:",slen(dn,8),dn);
46
             error_display_c(mes,ERR_ACNET,errs[i]);
47
          }
48
       }
49
       sprintf(mes,"Err:td_build sts, in c453_td2:");
50
       error_display_c(mes,ERR_ACNET,sts);
51
       goto ret;
52
     }
53
    if (rw == SET) sts = td_set(&lst_id, &raw[inx*num_slots], errs);
54
    else sts = td_read(&lst_id, &raw[inx*num_slots], errs);
55
    td_cancel(&lst_id);
56
    if (sts) {
57
       for (i = 0; i < ndiss; i++) {
58
          if (errs[i]) {
59
         di2dname(dis[inx+i],dn);
60
             sprintf(mes,"Err:td_%.*s -dn %.*s, in c453_td2: ",
61
                (rw==SET)?3:4,(rw==SET)?"set":"read",slen(dn,8),dn);
62
             error_display_c(mes,ERR_ACNET,errs[i]);
63
          }
64
       }
65
       sprintf(mes,"Err:td_%.*s sts, in c453_td2:",
66
           (rw==SET)?3:4,(rw==SET)?"set":"read");
67
       error_display_c(mes,ERR_ACNET,sts);
68
       goto ret;
69
    }
70
    ndis_left -= ndiss;
71
    inx += ndiss;
72
 }
73
 ret:if (errs)clib_free((char **)&errs);
74
 return sts;
75
}