1/*
2 * Layer Two Tunnelling Protocol Daemon
3 * Copyright (C) 1998 Adtran, Inc.
4 * Copyright (C) 2002 Jeff McAdams
5 *
6 * Mark Spencer
7 *
8 * This software is distributed under the terms
9 * of the GPL, which you should have received
10 * along with this source.
11 *
12 * Control Packet Handling header
13 *
14 */
15
16#include "common.h"
17
18/* Declaration of FIFO used for maintaining
19   a reliable control connection, as well
20   as for queueing stuff for the individual
21   threads */
22#ifndef _CONTROL_H
23#define _CONTROL_H
24/* Control message types  for vendor-ID 0, placed in the VALUE
25   field of AVP requests */
26
27/* Control Connection Management */
28#define SCCRQ 	1               /* Start-Control-Connection-Request */
29#define SCCRP 	2               /* Start-Control-Connection-Reply */
30#define SCCCN 	3               /* Start-Control-Connection-Connected */
31#define StopCCN 4               /* Stop-Control-Connection-Notification */
32/* 5 is reserved */
33#define Hello	6               /* Hello */
34/* Call Management */
35#define OCRQ	7               /* Outgoing-Call-Request */
36#define OCRP	8               /* Outgoing-Call-Reply */
37#define OCCN	9               /* Outgoing-Call-Connected */
38#define ICRQ	10              /* Incoming-Call-Request */
39#define ICRP	11              /* Incoming-Call-Reply */
40#define ICCN	12              /* Incoming-Call-Connected */
41/* 13 is reserved */
42#define CDN	14              /* Call-Disconnect-Notify */
43/* Error Reporting */
44#define WEN	15              /* WAN-Error-Notify */
45/* PPP Sesssion Control */
46#define SLI	16              /* Set-Link-Info */
47
48#define MAX_MSG 16
49
50#define TBIT 0x8000
51#define LBIT 0x4000
52#define RBIT 0x2000
53#define FBIT 0x0800
54
55extern int handle_packet (struct buffer *, struct tunnel *, struct call *);
56extern struct buffer *new_outgoing (struct tunnel *);
57extern void add_control_hdr (struct tunnel *t, struct call *c,
58                             struct buffer *);
59extern int control_finish (struct tunnel *t, struct call *c);
60extern void control_zlb (struct buffer *, struct tunnel *, struct call *);
61extern void recycle_outgoing (struct buffer *, struct sockaddr_in);
62extern void handle_special (struct buffer *, struct call *, _u16);
63extern void hello (void *);
64extern void send_zlb (void *);
65extern void dethrottle (void *);
66
67#endif
68