blob: da069f878736cd6824bf374e5adad2e8f65109c1 [file] [log] [blame]
Damien Miller8ed4de82011-12-19 10:52:50 +11001/* $OpenBSD: roaming.h,v 1.6 2011/12/07 05:44:38 djm Exp $ */
Darren Tuckerc5564e12009-06-21 18:53:53 +10002/*
3 * Copyright (c) 2004-2009 AppGate Network Security AB
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef ROAMING_H
19#define ROAMING_H
20
Damien Miller8ed4de82011-12-19 10:52:50 +110021#define DEFAULT_ROAMBUF 65536
22#define MAX_ROAMBUF (2*1024*1024) /* XXX arbitrary */
23#define ROAMING_REQUEST "roaming@appgate.com"
Darren Tucker466df212009-07-06 07:11:52 +100024
Darren Tuckerb7b17be2010-01-08 16:49:52 +110025extern int roaming_enabled;
Darren Tuckerc5564e12009-06-21 18:53:53 +100026extern int resume_in_progress;
27
Darren Tuckerb7b17be2010-01-08 16:49:52 +110028void request_roaming(void);
Darren Tucker466df212009-07-06 07:11:52 +100029int get_snd_buf_size(void);
30int get_recv_buf_size(void);
Darren Tuckerc5564e12009-06-21 18:53:53 +100031void add_recv_bytes(u_int64_t);
Darren Tuckerb7b17be2010-01-08 16:49:52 +110032int wait_for_roaming_reconnect(void);
33void roaming_reply(int, u_int32_t, void *);
Darren Tucker466df212009-07-06 07:11:52 +100034void set_out_buffer_size(size_t);
Darren Tuckerc5564e12009-06-21 18:53:53 +100035ssize_t roaming_write(int, const void *, size_t, int *);
36ssize_t roaming_read(int, void *, size_t, int *);
Darren Tuckere6b590e2009-06-21 19:08:48 +100037size_t roaming_atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t);
Darren Tuckerc5564e12009-06-21 18:53:53 +100038u_int64_t get_recv_bytes(void);
39u_int64_t get_sent_bytes(void);
40void roam_set_bytes(u_int64_t, u_int64_t);
Darren Tucker466df212009-07-06 07:11:52 +100041void resend_bytes(int, u_int64_t *);
Darren Tuckerb7b17be2010-01-08 16:49:52 +110042void calculate_new_key(u_int64_t *, u_int64_t, u_int64_t);
Darren Tuckerc5564e12009-06-21 18:53:53 +100043int resume_kex(void);
44
45#endif /* ROAMING */