comparison src/g23m-fad/ppp/ppp.h @ 174:90eb61ecd093

src/g23m-fad: initial import from TCS3.2/LoCosto
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 12 Oct 2016 05:40:46 +0000
parents
children
comparison
equal deleted inserted replaced
173:bf64d785238a 174:90eb61ecd093
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul :
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : Definitions for the Protocol Stack Entity
18 | Point-to-Point Protocol (PPP)
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef PPP_H
23 #define PPP_H
24
25 /*==== MACROS ======================================================*/
26
27 /*
28 * defines the user of the vsi interface
29 */
30 #define VSI_CALLER PPP_handle,
31 #define VSI_CALLER_SINGLE PPP_handle
32
33 /*
34 * VERSION
35 *
36 * Description : The constants define the type and the value
37 * of a version identification. The version
38 * is part of the monitor struct.
39 */
40 #define VERSION_PPP "PPP 1.0"
41
42 /*
43 * This is just a TEMPORARY define until the issues with OPTION_MULTITHREAD
44 * are settled. This define SHOULD be contained in GSM.H.
45 */
46 #undef _ENTITY_PREFIXED
47 #define _ENTITY_PREFIXED(N) ppp_##N
48
49 /*
50 * these macros might be defined more globally!!!
51 */
52 #ifdef FRAME_OFFSET_ZERO
53
54 #define GET_PD(s,p) p=s.buf[3] & 0x0F
55 #define GET_TI(s,t) t=(s.buf[3] & 0xF0)>>4
56
57 #else /* FRAME_OFFSET_ZERO */
58
59 #define GET_PD(s,p) ccd_decodeByte(s.buf, (USHORT)(s.o_buf+4), 4, &p)
60 #define GET_TI(s,t) ccd_decodeByte(s.buf, s.o_buf, 4, &t)
61
62 #endif /* FRAME_OFFSET_ZERO */
63
64
65 /*==== CONSTANTS ======================================================*/
66
67 /*
68 * Bitoffset for encoding/decoding
69 */
70 #define ENCODE_OFFSET 0
71
72
73 /*
74 * Service definitions. Used to access service data with GET/SET_STATE.
75 *
76 * Services with multiple incarnation have to be defined as xxx->
77 * Services with only one incarnation have to be defined as xxx.
78 *
79 */
80 #define PPP_SERVICE_RT rt.
81 #define PPP_SERVICE_PRX prx.
82 #define PPP_SERVICE_PTX ptx.
83 #define PPP_SERVICE_FRX frx.
84 #define PPP_SERVICE_FTX ftx.
85 #define PPP_SERVICE_ARB arb.
86 #define PPP_SERVICE_LCP lcp.
87 #define PPP_SERVICE_ONA ona->
88 #define PPP_SERVICE_NCP ncp.
89 #define PPP_SERVICE_PAP pap.
90 #define PPP_SERVICE_CHAP chap.
91
92
93 /*
94 * Service name definitions for trace purposes.
95 */
96 #ifndef NTRACE
97
98 #define SERVICE_NAME_PPP_SERVICE_RT "RT"
99 #define SERVICE_NAME_PPP_SERVICE_PRX "PRX"
100 #define SERVICE_NAME_PPP_SERVICE_PTX "PTX"
101 #define SERVICE_NAME_PPP_SERVICE_FRX "FRX"
102 #define SERVICE_NAME_PPP_SERVICE_FTX "FTX"
103 #define SERVICE_NAME_PPP_SERVICE_ARB "ARB"
104 #define SERVICE_NAME_PPP_SERVICE_LCP "LCP"
105 #define SERVICE_NAME_PPP_SERVICE_ONA "ONA"
106 #define SERVICE_NAME_PPP_SERVICE_NCP "NCP"
107 #define SERVICE_NAME_PPP_SERVICE_PAP "PAP"
108 #define SERVICE_NAME_PPP_SERVICE_CHAP "CHAP"
109
110 #endif /* !NTRACE */
111
112
113 /*
114 * State definitions for each service.
115 */
116
117 #define RT_STOPPED 1
118 #define RT_STARTED 2
119
120 #define PRX_NDTI 3
121 #define PRX_NDTI_START_FLOW 4
122 #define PRX_READY 5
123 #define PRX_DEAD 6
124 #define PRX_DEAD_DTI 7
125
126 #define PTX_READY 8
127 #define PTX_BLOCKED 9
128 #define PTX_DEAD 10
129
130 #define FRX_READY_NDTI 11
131 #define FRX_TRANSPARENT_NDTI 12
132 #define FRX_READY 13
133 #define FRX_DEAD 14
134 #define FRX_DEAD_DTI 15
135 #define FRX_TRANSPARENT 16
136
137 #define FTX_READY 17
138 #define FTX_BLOCKED 18
139 #define FTX_READY_DTI_FULL 19
140 #define FTX_BLOCKED_DTI_FULL 20
141 #define FTX_DEAD 21
142 #define FTX_DEAD_START_FLOW 22
143 #define FTX_TRANSPARENT 23
144 #define FTX_TRANSPARENT_DTI_FULL 24
145
146 #define ARB_DEAD 25
147 #define ARB_LCP_ESTABLISH 26
148 #define ARB_LCP_PDP 27
149 #define ARB_LCP_NCP 28
150 #define ARB_LCP_RECONF 29
151 #define ARB_LCP_MOD 30
152 #define ARB_PAP_ESTABLISH 31
153 #define ARB_PAP_RECONF 32
154 #define ARB_CHAP_ESTABLISH 33
155 #define ARB_CHAP_RECONF 34
156 #define ARB_PDP_WAIT 35
157 #define ARB_PDP_SENT 36
158 #define ARB_NCP_ESTABLISH 37
159 #define ARB_NCP_RECONF 38
160 #define ARB_NCP_MOD 39
161 #define ARB_IP 40
162 #define ARB_TRANSPARENT 41
163
164 #define LCP_STATE 42
165
166 #define ONA_CLOSED 43
167 #define ONA_CLOSING 44
168 #define ONA_REQ_SENT 45
169 #define ONA_ACK_RCVD 46
170 #define ONA_ACK_SENT 47
171 #define ONA_OPENED 48
172
173 #define NCP_STATE 49
174
175 #define PAP_DOWN 50
176 #define PAP_UP 51
177
178 #define CHAP_DOWN 52
179 #define CHAP_UP 53
180
181 /*
182 * state definitions for PTX TX buffer
183 */
184
185 #define PTX_BUFFER_FULL 70 /* a state of PTX TX buffer */
186 #define PTX_BUFFER_READY 71 /* a state of PTX TX buffer */
187
188 /*
189 * state definitions for FTX TX buffer
190 */
191 #define PTX_FTX_BUFFER_READY 72 /* a state of FTX TX buffer */
192 #define PTX_FTX_BUFFER_FULL 73 /* a state of FTX TX buffer */
193
194 /*
195 * state definitions for uplink data flow
196 */
197
198 #define FRX_DATA_FLOW_DEAD 74 /* a state of PTX TX buffer */
199 #define FRX_DATA_FLOW_READY 75 /* a state of PTX TX buffer */
200
201
202 /*
203 * PPP spicific defines
204 */
205 #define DTI_PID_IPCP 0x8021
206 #define DTI_PID_LCP 0xc021
207 #define DTI_PID_PAP 0xc023
208 #define DTI_PID_CHAP 0xc223
209
210 #define CODE_CONF_REQ 1
211 #define CODE_CONF_ACK 2
212 #define CODE_CONF_NAK 3
213 #define CODE_CONF_REJ 4
214 #define CODE_TERM_REQ 5
215 #define CODE_TERM_ACK 6
216 #define CODE_CODE_REJ 7
217 #define CODE_PROT_REJ 8
218 #define CODE_ECHO_REQ 9
219 #define CODE_ECHO_REP 10
220 #define CODE_DISC_REQ 11
221
222 #define CODE_AUTH_REQ 1
223 #define CODE_AUTH_ACK 2
224 #define CODE_AUTH_NAK 3
225
226 #define CODE_CHALLENGE 1
227 #define CODE_RESPONSE 2
228 #define CODE_SUCCESS 3
229 #define CODE_FAILURE 4
230
231 #define FORWARD_RCRP 1
232 #define FORWARD_RCRN 2
233 #define FORWARD_RCA 3
234 #define FORWARD_RCN 4
235 #define FORWARD_RTR 5
236 #define FORWARD_RTA 6
237 #define FORWARD_RUC 7
238 #define FORWARD_RXJN 8
239 #define FORWARD_RER 9
240 #define FORWARD_RPJ_LCP 10
241 #define FORWARD_RPJ_PAP 12
242 #define FORWARD_RPJ_CHAP 13
243 #define FORWARD_RPJ_IPCP 14
244 #define FORWARD_RPJ_IP 15
245 #define FORWARD_RPJ_CTCP 16
246 #define FORWARD_RPJ_UTCP 17
247 #define FORWARD_DISCARD 18
248 #define FORWARD_RARP 19
249 #define FORWARD_RARN 20
250 #define FORWARD_RAA 21
251 #define FORWARD_RAN 22
252 #define FORWARD_RC 23
253 #define FORWARD_RRP 24
254 #define FORWARD_RRN 25
255 #define FORWARD_RS 26
256 #define FORWARD_RF 27
257
258 #define PROTOCOL_LCP_MSB 0xc0
259 #define PROTOCOL_LCP_LSB 0x21
260 #define PROTOCOL_PAP_MSB 0xc0
261 #define PROTOCOL_PAP_LSB 0x23
262 #define PROTOCOL_CHAP_MSB 0xc2
263 #define PROTOCOL_CHAP_LSB 0x23
264 #define PROTOCOL_VJ_MSB 0x00
265 #define PROTOCOL_VJ_LSB 0x2d
266 #define PROTOCOL_IPCP_MSB 0x80
267 #define PROTOCOL_IPCP_LSB 0x21
268
269 #define PPP_INITFCS 0xffff
270 #define PPP_GOODFCS 0xf0b8
271
272 #define PPP_HDLC_ESCAPE 0x7d
273 #define PPP_HDLC_FLAG 0x7e
274 #define PPP_ASCII_DEL 0x7f
275
276 #define PPP_AP_DEFAULT PPP_AP_NO
277 #define PPP_ACFC_DEFAULT FALSE
278 #define PPP_PFC_DEFAULT FALSE
279 #define PPP_HC_DEFAULT PPP_HC_OFF
280 #define PPP_MSID_DEFAULT 0
281 #define PPP_IP_DEFAULT PPP_IP_DYNAMIC
282 #define PPP_PDNS_DEFAULT PPP_DNS1_DYNAMIC
283 #define PPP_SDNS_DEFAULT PPP_DNS2_DYNAMIC
284 #define PPP_GATEWAY_DEFAULT PPP_IP_DYNAMIC
285
286 #define PPP_MRU_MIN 1500
287
288 #define CHAP_MSG_DIGEST_LEN 16
289
290 #define FTX_QUEUE_SIZE 1
291 #define PTX_QUEUE_SIZE 1
292
293
294 #define PPP_PCO_MASK_LCP_MRU 0x00000001 /* MRU value */
295 #define PPP_PCO_MASK_LCP_AP 0x00000002 /* LCP authentication protocol */
296 #define PPP_PCO_MASK_LCP_TWO 0x00000004 /* two LCP packets */
297 #define PPP_PCO_MASK_AUTH_PROT 0x00000008 /* authentification packets (PAP/CHAP) */
298 #define PPP_PCO_MASK_IPCP_HC 0x00000010 /* VJ header compression */
299 #define PPP_PCO_MASK_IPCP_IP 0x00000020 /* IP address */
300 #define PPP_PCO_MASK_IPCP_PDNS 0x00000040 /* primary DNS address */
301 #define PPP_PCO_MASK_IPCP_SDNS 0x00000080 /* secondary DNS address */
302 #define PPP_PCO_MASK_IPCP_GATEWAY 0x00000100 /* gateway address */
303 #ifdef _SIMULATION_
304 #define PPP_PCO_MASK_DEFAULT (PPP_PCO_MASK_LCP_MRU | \
305 PPP_PCO_MASK_LCP_AP | \
306 PPP_PCO_MASK_LCP_TWO | \
307 PPP_PCO_MASK_AUTH_PROT | \
308 PPP_PCO_MASK_IPCP_HC | \
309 PPP_PCO_MASK_IPCP_IP | \
310 PPP_PCO_MASK_IPCP_PDNS | \
311 PPP_PCO_MASK_IPCP_SDNS)
312 #else /* _SIMULATION_ */
313 #define PPP_PCO_MASK_DEFAULT (PPP_PCO_MASK_AUTH_PROT | \
314 PPP_PCO_MASK_IPCP_PDNS | \
315 PPP_PCO_MASK_IPCP_SDNS)
316 #endif /* _SIMULATION_ */
317 /*
318 * size of a descriptor which includes the frame
319 */
320 #define FTX_GET_DESC_SIZE (400 - (UBYTE)sizeof(T_desc2))
321
322 /*
323 * frx_add_desc states
324 */
325 #define FRX_ADD_HDLC_BEGIN 1
326 #define FRX_ADD_ADDRESS 2
327 #define FRX_ADD_CONTROL 3
328 #define FRX_ADD_PROTOCOL1 4
329 #define FRX_ADD_PROTOCOL2 5
330 #define FRX_ADD_INFORMATION 6
331 #define FRX_ADD_FCS1 7
332 #define FRX_ADD_FCS2 8
333 #define FRX_ADD_HDLC_END 9
334 #define FRX_ADD_ERROR 10
335
336 /*
337 * Definitions for DTILIB
338 */
339
340 #define PROT_LAYER 0
341 #define PEER_LAYER 1
342 #define PROT_CHANNEL 0
343 #if defined(_SIMULATION_)
344 #define PEER_CHANNEL 0
345 #else
346 #define PEER_CHANNEL 1
347 #endif
348 #define MAX_TRIES_OPEN_VSI_CHAN 5
349 #define PPP_INSTANCE 0
350 #define MAX_PPP_LINKS 2
351
352 /*
353 * packet size for normal PPP packets
354 * this value is just used to reduce the allocated memory
355 */
356 #define FRX_ADD_SMALL_PACKET_SIZE (100 - (UBYTE)(sizeof(T_desc2)))
357
358 /*
359 * number of ONA incarnations: LCP and NCP
360 */
361 #define ONA_NUM_INC 2
362
363 #ifdef FF_STATUS_TE
364 /*
365 * driver handle for wakeup driver
366 */
367 #define STE_HANDLE 0x0001
368 #endif /* FF_STATUS_TE */
369
370 /*
371 * Timer handle definitions.
372 */
373
374 #define RT_INDEX 0
375 #define TIMER_MAX (RT_INDEX + 1)
376
377 /*==== TYPES ======================================================*/
378
379 #ifdef OPTION_TIMER
380 /*
381 * timer configuration table
382 */
383 typedef struct
384 {
385 UBYTE t_mode;
386 ULONG t_val;
387 } T_TIMER_CONFIG;
388 #endif /* OPTION_TIMER */
389
390 /*
391 * Test environment (simulator) vs. Implementation environment.
392 */
393 typedef enum
394 {
395 TEST_ENV,
396 IMPL_ENV
397 } T_ENVIRONMENT;
398
399 typedef enum
400 {
401 SERVICE_PTX,
402 SERVICE_PRX,
403 SERVICE_FRX,
404 SERVICE_FTX,
405 SERVICE_RT,
406 SERVICE_ARB,
407 SERVICE_PAP,
408 SERVICE_CHAP,
409 SERVICE_LCP,
410 SERVICE_NCP,
411 SERVICE_ONA,
412 NO_SERVICE
413 } T_SERVICE;
414
415 /*
416 * dat structure for each service
417 */
418 typedef struct /* T_RT_DATA */
419 {
420 UBYTE state;
421 /*
422 * Required for state traces.
423 */
424 #ifndef NTRACE
425 char *name;
426 char *state_name;
427 #endif /* !NTRACE */
428
429 /*ab hier service spezif.
430 * timeout value
431 */
432 T_TIME time;
433
434 } T_RT_DATA;
435
436
437 typedef struct /* T_PRX_DATA */
438 {
439 UBYTE state;
440 /*
441 * Required for state traces.
442 */
443 #ifndef NTRACE
444 char *name;
445 char *state_name;
446 #endif /* !NTRACE */
447
448 /* ab hier service spezif.
449 *
450 */
451 #ifdef FF_STATUS_TE
452 UBYTE TE_data_buffered; /* Status of TE-data-buffer asleep/awake */
453 UBYTE TE_data_buffer_p_id; /* When TE asleep here the p_id is buffered */
454 T_desc2* TE_data_buffer_desc_list_first; /* When TE asleep here the desc-list is buffered */
455 #endif /* FF_STATUS_TE */
456
457 } T_PRX_DATA;
458
459
460 typedef struct /* T_PTX_DATA */
461 {
462 UBYTE state;
463 /*
464 * Required for state traces.
465 */
466 #ifndef NTRACE
467 char *name;
468 char *state_name;
469 #endif /* !NTRACE */
470 /*
471 * service specific members
472 */
473 USHORT ftx_buffer_state; /* state of FTX TX buffer */
474 USHORT ptx_buffer_state; /* state of PTX TX buffer */
475
476 } T_PTX_DATA;
477
478
479 typedef struct /* T_FRX_DATA */
480 {
481 UBYTE state;
482 /*
483 * Required for state traces.
484 */
485 #ifndef NTRACE
486 char *name;
487 char *state_name;
488 #endif /* !NTRACE */
489
490 /* ab hier service spezif.
491 *
492 */
493 T_desc2* received_data; /* last received data stream */
494 USHORT proceed_data; /* number of octets already proceeded */
495 UBYTE frame_complete; /* indicates whether a complete frame is
496 received or not */
497 USHORT stored_ptype; /* stored packet type */
498 T_desc2* stored_packet; /* stored packet */
499 USHORT stored_len; /* stored packet length */
500 USHORT calc_fcs; /* calculated fcs */
501 UBYTE escape; /* indicates HDLC Control Escape detection */
502 T_desc2* cur_desc; /* current descriptor for storing */
503 USHORT cur_desc_size; /* size of the current descriptor buffer */
504 UBYTE store_state; /* state of frame decoding */
505 USHORT data_flow_state; /* state of FRX->PTX data flow */
506
507 #ifdef PPP_HDLC_TRACE
508 T_desc2* hdlc_frame; /* complete HDLC frame stored for traces */
509 #endif /* PPP_HDLC_TRACE */
510
511 } T_FRX_DATA;
512
513
514 typedef struct /* T_FTX_DATA */
515 {
516 UBYTE state;
517 /*
518 * Required for state traces.
519 */
520 #ifndef NTRACE
521 char *name;
522 char *state_name;
523 #endif /* !NTRACE */
524
525 /*
526 * from here on service specific
527 */
528
529 UBYTE* accmtab; /* Async-Control-Character-Map Table */
530
531 UBYTE acfc; /* Address and Control Field Compression */
532 UBYTE pfc; /* Protocol Field Compression */
533
534 } T_FTX_DATA;
535
536
537 typedef struct /* T_ARB_DATA */
538 {
539 UBYTE state;
540 /*
541 * Required for state traces.
542 */
543 #ifndef NTRACE
544 char *name;
545 char *state_name;
546 #endif /* !NTRACE */
547
548 /* ab hier service spezif.
549 *
550 */
551 UBYTE pri; /* Protocol Reject Identifier */
552 UBYTE to_counter; /* Time Out Counter */
553 T_desc2* last_ipcp; /* Last sent IPCP packet */
554
555 UBYTE dti_connect_state_prot; /* DTI Connect State for the Protocol Layer */
556 UBYTE dti_connect_state_peer; /* DTI Connect State for the Peer Layer */
557
558 } T_ARB_DATA;
559
560
561 typedef struct /* T_LCP_DATA */
562 {
563 UBYTE state;
564 /*
565 * Required for state traces.
566 */
567 #ifndef NTRACE
568 char *name;
569 char *state_name;
570 #endif /* !NTRACE */
571
572 /* ab hier service spezif.
573 *
574 */
575 USHORT req_mru; /* requested maximum receive unit */
576 ULONG req_accm; /* requested async control character map */
577 UBYTE req_ap; /* requested authetication protocol */
578
579 USHORT s_mru; /* to send maximum receive unit */
580 ULONG s_accm; /* to send async control character map */
581 UBYTE s_pfc; /* to send protocol field compression */
582 UBYTE s_acfc; /* to send address and control field compression */
583 USHORT s_rejected; /* indicator of rejection of sent configuration entity_options */
584
585 USHORT r_mru; /* received maximum receive unit */
586 ULONG r_accm; /* received async control character map */
587 UBYTE r_pfc; /* received protocol field compression */
588 UBYTE r_acfc; /* received address and control field compression */
589
590 UBYTE n_ap; /* negotiated authentication protocol */
591
592 UBYTE scr; /* indicator whether configure request was sent */
593 UBYTE str; /* indicator whether terminate request was sent */
594
595 UBYTE rcr; /* indicator whether configure request was received */
596
597 UBYTE nscri; /* new send configure request identifier */
598 UBYTE nstri; /* new send terminate request identifier */
599 UBYTE nscji; /* new send code reject identifier */
600
601 UBYTE lrcri; /* last received configure request identifier */
602
603 } T_LCP_DATA;
604
605
606 typedef struct /* T_ONA_DATA */
607 {
608 UBYTE state;
609 /*
610 * Required for state traces.
611 */
612 #ifndef NTRACE
613 char *name;
614 char *state_name;
615 #endif /* !NTRACE */
616
617 /* ab hier service spezif.
618 *
619 */
620 UBYTE restarts; /* counter for Configure-Request and Terminate-Request sent */
621 UBYTE failures; /* counter for Configure-Nak and Configure-Reject sent */
622 UBYTE loops; /* counter for Configure-Ack received */
623
624 } T_ONA_DATA;
625
626
627 typedef struct /* T_NCP_DATA */
628 {
629 UBYTE state;
630 /*
631 * Required for state traces.
632 */
633 #ifndef NTRACE
634 char *name;
635 char *state_name;
636 #endif /* !NTRACE */
637
638 /* ab hier service spezif.
639 *
640 */
641 UBYTE req_hc; /* requested header compression protocol */
642 UBYTE req_msid; /* requested max slot identifier */
643 ULONG req_ip; /* requested IP address */
644 ULONG req_pdns; /* requested primary DNS server address */
645 ULONG req_sdns; /* requested secondary DNS server address */
646 ULONG req_gateway; /* requested Gateway address */
647
648 UBYTE s_hc; /* sent header compression */
649 UBYTE s_msid; /* sent max slot identifier */
650 USHORT s_rejected; /* indicator of rejection of sent configuration entity_options */
651
652 UBYTE r_hc; /* received header compression */
653 UBYTE r_msid; /* received max slot identifier */
654
655 ULONG n_ip; /* negotiated IP address */
656 ULONG n_pdns; /* negotiated primary DNS server address */
657 ULONG n_sdns; /* negotiated secondary DNS server address */
658 ULONG n_gateway; /* negotiated Gateway address */
659
660 UBYTE scr; /* indicator whether configure request was sent */
661 UBYTE str; /* indicator whether terminate request was sent */
662
663 UBYTE rcr; /* indicator whether configure request was received */
664
665 UBYTE nscri; /* new send configure request identifier */
666 UBYTE nstri; /* new send terminate request identifier */
667 UBYTE nscji; /* new send code reject identifier */
668
669 UBYTE lrcri; /* last received configure request identifier */
670
671 } T_NCP_DATA;
672
673
674 typedef struct /* T_PAP_DATA */
675 {
676 UBYTE state;
677 /*
678 * Required for state traces.
679 */
680 #ifndef NTRACE
681 char *name;
682 char *state_name;
683 #endif /* !NTRACE */
684
685 /* ab hier service spezif.
686 *
687 */
688 T_login login; /* PAP authentication values (client mode) */
689 T_desc2* ar_packet; /* PAP Authentication Request packet (server mode) */
690 UBYTE counter; /* counter for timer restart */
691 UBYTE nari; /* new authenticate request identifier */
692
693 } T_PAP_DATA;
694
695
696 typedef struct /* T_CHAP_DATA */
697 {
698 UBYTE state;
699 /*
700 * Required for state traces.
701 */
702 #ifndef NTRACE
703 char *name;
704 char *state_name;
705 #endif /* !NTRACE */
706
707 /* ab hier service spezif.
708 *
709 */
710 T_desc2* c_packet; /* CHAP Challenge packet (server mode) */
711 T_desc2* r_packet; /* CHAP Response packet (server mode) */
712 UBYTE counter; /* counter for timer restart */
713 UBYTE fails; /* counter for failed authentication */
714 UBYTE nci; /* new challenge identifier */
715 UBYTE sc; /* indicator whether Challenge packet was sent */
716 UBYTE rc; /* indicator whether Challenge packet was received */
717 UBYTE sr; /* indicator whether Respons packet was sent */
718 UBYTE rs; /* indicator whether Success packet was received */
719
720 } T_CHAP_DATA;
721
722
723 /*
724 * summery of all service
725 */
726
727 typedef struct /* T_PPP_DATA */
728 {
729
730 /*
731 * PPP layer parameters
732 */
733 UBYTE version;
734
735 /*
736 * Service data structures
737 *
738 * Services with multiple incarnations require an array of structures
739 * named xxx_base[] with xxx = service abbrevation, and additionally a
740 * pointer named *xxx, which will be accessed instead of xxx_base.
741 *
742 * Services with only one incarnation just have to declare one structure
743 * named xxx (no need for xxx_base[] and *xxx).
744 *
745 * The differentiation between the two access possibilites is made with
746 * the defines of the service names above (PPP_SERVICE_XXX).
747 */
748 T_RT_DATA rt;
749 T_PRX_DATA prx;
750 T_PTX_DATA ptx;
751 T_FRX_DATA frx;
752 T_FTX_DATA ftx;
753 T_ARB_DATA arb;
754 T_LCP_DATA lcp;
755 T_ONA_DATA ona_base[ONA_NUM_INC];
756 T_ONA_DATA *ona;
757 T_NCP_DATA ncp;
758 T_PAP_DATA pap;
759 T_CHAP_DATA chap;
760
761 /*
762 * global PPP variables
763 */
764
765 UBYTE mode; /* working mode (client, server or transparent) */
766
767 UBYTE mc; /* Max. Configure */
768 UBYTE mt; /* Max. Terminate */
769 UBYTE mf; /* Max. Failure */
770 T_login login; /* CHAP, PAP and AUTO authentication values*/
771
772 U16 ppp_cause; /* cause of PPP termination */
773
774 USHORT mru; /* Maximum Receive Unit */
775 UBYTE n_hc; /* negotiated header compression */
776
777 ULONG pco_mask; /* determines PCO content */
778
779 /*
780 * Global variables used by DTILIB.
781 */
782
783 DTI_HANDLE ppphDTI; /* Handle to DTI Data Base */
784
785 /*
786 * global PPP constants
787 */
788 USHORT* fcstab;
789
790 } T_PPP_DATA;
791
792
793 /*==== EXPORT =====================================================*/
794
795
796 /*
797 * Entity data base
798 */
799
800 #ifdef PPP_PEI_C
801 T_PPP_DATA ppp_data_base, *ppp_data;
802 #else /* PPP_PEI_C */
803 EXTERN T_PPP_DATA ppp_data_base, *ppp_data;
804 #endif /* PPP_PEI_C */
805
806 #define ENTITY_DATA ppp_data
807
808
809 /*
810 * FCS and ACCM lookup tables
811 */
812
813 EXTERN USHORT fcstab_base[256];
814 EXTERN UBYTE accmtab_base[256];
815
816
817 /*
818 * Communication handles (see also PPP_PEI.C, PPP_ARBP.C)
819 */
820 #define hCommMMI ppp_hCommMMI
821 #define hCommPPP ppp_hCommPPP
822 #define hCommUPLINK ppp_hCommUPLINK
823 #define hCommDOWNLINK ppp_hCommDOWNLINK
824 /*
825 * make PPP functions unique
826 */
827 #define pei_create _ENTITY_PREFIXED(pei_create)
828 #define rt_init _ENTITY_PREFIXED(rt_init)
829
830 #ifdef PPP_PEI_C
831 T_HANDLE hCommMMI = VSI_ERROR;
832 T_HANDLE hCommPPP = VSI_ERROR;
833 T_HANDLE hCommUPLINK = VSI_ERROR;
834 T_HANDLE hCommDOWNLINK = VSI_ERROR;
835
836 T_HANDLE PPP_handle;
837
838 #else /* PPP_PEI_C */
839 EXTERN T_HANDLE hCommMMI;
840 EXTERN T_HANDLE hCommPPP;
841 EXTERN T_HANDLE hCommUPLINK;
842 EXTERN T_HANDLE hCommDOWNLINK;
843
844 EXTERN T_HANDLE PPP_handle;
845 #endif /* PPP_PEI_C */
846
847 /*
848 * If all entities are linked into one module this definitions
849 * prefixes the global data with the enity name
850 */
851 #ifdef OPTION_MULTITHREAD
852 #define _decodedMsg _ENTITY_PREFIXED(_decodedMsg)
853 #endif /* OPTION_MULTITHREAD */
854 #endif /* PPP_H */