OpenHIP 0.9svn1
/home/tomh/svn/openhip/hip/trunk/src/include/hip/hip_mr.h
Go to the documentation of this file.
00001 /* -*- Mode:cc-mode; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
00002 /* vim: set ai sw=2 ts=2 et cindent cino={1s: */
00003 /*
00004  * Host Identity Protocol
00005  * Copyright (c) 2009-2012 the Boeing Company
00006  * 
00007  * Permission is hereby granted, free of charge, to any person obtaining a copy
00008  * of this software and associated documentation files (the "Software"), to deal
00009  * in the Software without restriction, including without limitation the rights
00010  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00011  * copies of the Software, and to permit persons to whom the Software is
00012  * furnished to do so, subject to the following conditions:
00013  * 
00014  * The above copyright notice and this permission notice shall be included in
00015  * all copies or substantial portions of the Software.
00016  * 
00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00018  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00020  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00021  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00022  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00023  * THE SOFTWARE.
00024  *
00025  *  \file  hip_mr.h
00026  *
00027  *  \authors    Jeff Ahrenholz, <jeffrey.m.ahrenholz@boeing.com>
00028  *              Orlie Brewer, <orlie.t.brewer@boeing.com>
00029  *
00030  *  \brief  Mobile router data types
00031  */
00032 
00033 #ifndef _HIP_MR_H_
00034 #define _HIP_MR_H_
00035 
00036 /*
00037  * Mobile router registration extension
00038  */
00039 typedef enum {
00040   CANCELLED = 0,
00041   RESPONSE_SENT,
00042   TIMED_OUT       /* XXX unused */
00043 } MR_STATES;
00044 
00045 typedef struct _hip_proxy_ticket {
00046   __u8 hmac_key[20];
00047   __u16 hmac_key_index;
00048   __u16 transform_type;
00049   __u16 action;
00050   __u16 lifetime;
00051   __u8 hmac[20];
00052 } hip_proxy_ticket;
00053 
00054 typedef struct _hip_spi_nat {
00055   hip_hit peer_hit;
00056   struct sockaddr_storage peer_addr;
00057   struct sockaddr_storage peer_ipv4_addr;
00058   struct sockaddr_storage peer_ipv6_addr;
00059   struct sockaddr_storage last_out_addr;
00060   struct sockaddr_storage rvs_addr;
00061   int use_rvs;
00062   __u32 private_spi;
00063   __u32 public_spi;
00064   __u32 peer_spi;
00065   hip_proxy_ticket ticket;
00066   struct hip_packet_entry rexmt_cache;
00067   struct _hip_spi_nat *next;
00068 } hip_spi_nat;
00069 
00070 typedef struct _hip_mr_client {
00071   hip_hit mn_hit;
00072   struct sockaddr_storage mn_addr;
00073   MR_STATES state;
00074   hip_spi_nat *spi_nats;
00075 } hip_mr_client;
00076 
00077 struct ip_esp_hdr {
00078   __u32 spi;
00079   __u32 seq_no;
00080   __u8 enc_data[0];
00081 };
00082 
00083 #endif /* _HIP_MR_H_*/
00084 
00085