home *** CD-ROM | disk | FTP | other *** search
- /* Common ISDN API C-Library Functions: protokoll handling
- Author: Dietmar Friede
- Copyright (c) 1992 D.Friede
- #include "copy"
- #include "copying.doc"
- */
- #include "types.h"
-
- static byte prot_size[6]= {0,0,2,0,0,0};
- typedef byte prot[2];
- static prot passiv[6] =
- { { 0 },
- { 0 },
- { 3 , 3 },
- { 0 },
- { 0 },
- { 0 }
- };
-
- static prot activ[6] =
- { { 0 },
- { 0 },
- { 1 , 3 },
- { 0 },
- { 0 },
- { 0 }
- };
-
- extern byte protokoll;
- extern word SendDir;
-
- byte
- get_prot_size(void)
- {
- return(prot_size[protokoll]);
- }
-
- static byte *
- get_prot(void)
- {
- if(SendDir) return(passiv[protokoll]);
- return(activ[protokoll]);
- }
-
- void
- set_prot(byte *p)
- {
- byte * pr;
- int i, l;
- if((l= get_prot_size()) == 0) return;
- pr= get_prot();
- for(i= 0; i<l; i++,pr++,p++) *p= *pr;
- }
-