2007-06-21 15:25:28 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 Martin Willi
|
|
|
|
* Hochschule fuer Technik Rapperswil
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
2008-03-13 14:14:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @defgroup ike_mobike ike_mobike
|
|
|
|
* @{ @ingroup tasks
|
2007-06-21 15:25:28 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef IKE_MOBIKE_H_
|
|
|
|
#define IKE_MOBIKE_H_
|
|
|
|
|
|
|
|
typedef struct ike_mobike_t ike_mobike_t;
|
|
|
|
|
|
|
|
#include <library.h>
|
|
|
|
#include <sa/ike_sa.h>
|
|
|
|
#include <sa/tasks/task.h>
|
2007-09-03 12:37:25 +00:00
|
|
|
#include <network/packet.h>
|
2007-06-21 15:25:28 +00:00
|
|
|
|
|
|
|
/**
|
2008-03-13 14:14:44 +00:00
|
|
|
* Task of type ike_mobike, detects and handles MOBIKE extension.
|
2007-06-21 15:25:28 +00:00
|
|
|
*
|
|
|
|
* The MOBIKE extension is defined in RFC4555. It allows to update IKE
|
|
|
|
* and IPsec tunnel addresses.
|
|
|
|
* This tasks handles the MOBIKE_SUPPORTED notify exchange to detect MOBIKE
|
|
|
|
* support, allows the exchange of ADDITIONAL_*_ADDRESS to exchange additional
|
2009-09-04 11:46:09 +00:00
|
|
|
* endpoints and handles the UPDATE_SA_ADDRESS notify to finally update
|
2007-06-21 15:25:28 +00:00
|
|
|
* endpoints.
|
|
|
|
*/
|
|
|
|
struct ike_mobike_t {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements the task_t interface
|
|
|
|
*/
|
|
|
|
task_t task;
|
2009-09-04 11:46:09 +00:00
|
|
|
|
2010-10-05 14:49:20 +00:00
|
|
|
/**
|
|
|
|
* Use the task to update the list of additional addresses.
|
|
|
|
*/
|
|
|
|
void (*addresses)(ike_mobike_t *this);
|
|
|
|
|
2007-06-21 15:25:28 +00:00
|
|
|
/**
|
2008-03-13 14:14:44 +00:00
|
|
|
* Use the task to roam to other addresses.
|
2007-06-21 15:25:28 +00:00
|
|
|
*
|
2007-07-03 12:32:38 +00:00
|
|
|
* @param address TRUE to include address list update
|
2007-06-21 15:25:28 +00:00
|
|
|
*/
|
2007-07-03 12:32:38 +00:00
|
|
|
void (*roam)(ike_mobike_t *this, bool address);
|
2009-09-04 11:46:09 +00:00
|
|
|
|
2008-10-06 13:37:04 +00:00
|
|
|
/**
|
|
|
|
* Use the task for a DPD check which detects changes in NAT mappings.
|
|
|
|
*/
|
|
|
|
void (*dpd)(ike_mobike_t *this);
|
2009-09-04 11:46:09 +00:00
|
|
|
|
2007-09-03 12:37:25 +00:00
|
|
|
/**
|
2008-03-13 14:14:44 +00:00
|
|
|
* Transmision hook, called by task manager.
|
2007-09-03 12:37:25 +00:00
|
|
|
*
|
2009-09-04 11:46:09 +00:00
|
|
|
* The task manager calls this hook whenever it transmits a packet. It
|
2007-09-03 12:37:25 +00:00
|
|
|
* allows the mobike task to send the packet on multiple paths to do path
|
|
|
|
* probing.
|
|
|
|
*
|
|
|
|
* @param packet the packet to transmit
|
|
|
|
*/
|
|
|
|
void (*transmit)(ike_mobike_t *this, packet_t *packet);
|
2009-09-04 11:46:09 +00:00
|
|
|
|
2007-09-28 08:22:37 +00:00
|
|
|
/**
|
2008-03-13 14:14:44 +00:00
|
|
|
* Check if this task is probing for routability.
|
2007-09-28 08:22:37 +00:00
|
|
|
*
|
|
|
|
* @return TRUE if task is probing
|
|
|
|
*/
|
2009-09-04 11:46:09 +00:00
|
|
|
bool (*is_probing)(ike_mobike_t *this);
|
2007-06-21 15:25:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2008-03-13 14:14:44 +00:00
|
|
|
* Create a new ike_mobike task.
|
2007-06-21 15:25:28 +00:00
|
|
|
*
|
|
|
|
* @param ike_sa IKE_SA this task works for
|
|
|
|
* @param initiator TRUE if taks is initiated by us
|
2009-09-04 12:58:05 +00:00
|
|
|
* @return ike_mobike task to handle by the task_manager
|
2007-06-21 15:25:28 +00:00
|
|
|
*/
|
|
|
|
ike_mobike_t *ike_mobike_create(ike_sa_t *ike_sa, bool initiator);
|
|
|
|
|
2009-03-24 17:43:01 +00:00
|
|
|
#endif /** IKE_MOBIKE_H_ @}*/
|