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