ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/connection.h
(Generate patch)

Comparing gvpe/src/connection.h (file contents):
Revision 1.1 by pcg, Wed Apr 2 03:06:22 2003 UTC vs.
Revision 1.6 by pcg, Sun Apr 6 04:17:36 2003 UTC

17*/ 17*/
18 18
19#ifndef VPE_CONNECTION_H__ 19#ifndef VPE_CONNECTION_H__
20#define VPE_CONNECTION_H__ 20#define VPE_CONNECTION_H__
21 21
22#include <netinet/ip.h> // for tos etc.
23
24#include <openssl/rand.h>
25#include <openssl/hmac.h> 22#include <openssl/hmac.h>
26#include <openssl/evp.h>
27#include <openssl/rsa.h>
28#include <openssl/err.h>
29 23
30#include "global.h" 24#include "global.h"
31#include "conf.h" 25#include "conf.h"
32#include "sockinfo.h" 26#include "sockinfo.h"
33#include "util.h" 27#include "util.h"
79 }; 73 };
80 74
81 u8 type; 75 u8 type;
82 u8 srcdst, src1, dst1; 76 u8 srcdst, src1, dst1;
83 77
84 void set_hdr (ptype type, unsigned int dst); 78 void set_hdr (ptype type_, unsigned int dst);
85 79
86 unsigned int src () const 80 unsigned int src () const
87 { 81 {
88 return src1 | ((srcdst >> 4) << 8); 82 return src1 | ((srcdst >> 4) << 8);
89 } 83 }
136 crypto_ctx *octx, *ictx; 130 crypto_ctx *octx, *ictx;
137 131
138 enum conf_node::connectmode connectmode; 132 enum conf_node::connectmode connectmode;
139 u8 prot_minor; // minor number of other side 133 u8 prot_minor; // minor number of other side
140 134
141 void reset_dstaddr (); 135 void reset_si ();
136 const sockinfo &forward_si (const sockinfo &si) const;
142 137
143 void shutdown (); 138 void shutdown ();
144 void reset_connection (); 139 void reset_connection ();
145 void establish_connection_cb (tstamp &ts); time_watcher establish_connection; 140 void establish_connection_cb (time_watcher &w); time_watcher establish_connection;
146 void rekey_cb (tstamp &ts); time_watcher rekey; // next rekying (actually current reset + reestablishing) 141 void rekey_cb (time_watcher &w); time_watcher rekey; // next rekying (actually current reset + reestablishing)
147 void keepalive_cb (tstamp &ts); time_watcher keepalive; // next keepalive probe 142 void keepalive_cb (time_watcher &w); time_watcher keepalive; // next keepalive probe
148 143
149 void send_auth_request (const sockinfo &si, bool initiate); 144 void send_auth_request (const sockinfo &si, bool initiate);
150 void send_auth_response (const sockinfo &si, const rsaid &id, const rsachallenge &chg); 145 void send_auth_response (const sockinfo &si, const rsaid &id, const rsachallenge &chg);
151 void send_connect_info (int rid, const sockinfo &rsi, u8 rprotocols); 146 void send_connect_info (int rid, const sockinfo &rsi, u8 rprotocols);
152 void send_reset (const sockinfo &dsi); 147 void send_reset (const sockinfo &dsi);
153 void send_ping (const sockinfo &dsi, u8 pong = 0); 148 void send_ping (const sockinfo &dsi, u8 pong = 0);
154 void send_data_packet (tap_packet *pkt, bool broadcast = false); 149 void send_data_packet (tap_packet *pkt, bool broadcast = false);
155 void inject_data_packet (tap_packet *pkt, bool broadcast = false); 150 void inject_data_packet (tap_packet *pkt, bool broadcast = false);
151 void inject_vpn_packet (vpn_packet *pkt, int tos = 0); // for forwarding
156 void connect_request (int id); 152 void connect_request (int id);
157 153
158 void send_vpn_packet (vpn_packet *pkt, const sockinfo &si, int tos = IPTOS_RELIABILITY);
159 void recv_vpn_packet (vpn_packet *pkt, const sockinfo &rsi); 154 void recv_vpn_packet (vpn_packet *pkt, const sockinfo &rsi);
160 155
161 void script_node (); 156 void script_node ();
162 const char *script_node_up (int); 157 const char *script_node_up ();
163 const char *script_node_down (int); 158 const char *script_node_down ();
164 159
165 void dump_status (); 160 void dump_status ();
166 161
167 connection(struct vpn *vpn_); 162 connection(struct vpn *vpn_);
168 ~connection (); 163 ~connection ();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines