⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dyn_api.h

📁 mobile ip 在linux下的一种实现
💻 H
字号:
/* $Id: dyn_api.h,v 1.38 2001/06/18 16:16:25 jm Exp $ * Dynamics API declaration * * Dynamic hierarchial IP tunnel * Copyright (C) 1998-2000, Dynamics group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. See README and COPYING for * more details. */#ifndef DYN_API_H#define DYN_API_H#include <asm/types.h>#include <netinet/in.h>#ifndef ETH_ALEN#define ETH_ALEN 6#endif#ifndef IFNAMSIZ#define IFNAMSIZ 16#endif/* Error codes */#define API_SUCCESS 0#define API_NOT_PERMITTED -1#define API_ILLEGAL_PARAMETERS -2#define API_UNDEFINED -3#define API_UNREACHABLE -4#define API_TIMEOUT -5#define API_INSUFFICIENT_SPACE -6#define API_NOT_SUPPORTED -7#define API_NOT_AVAILABLE -8#define API_IN_PROGRESS -9#define API_CANCELLED -10#define API_FAILED -11#define API_ERROR -12enum tunneling_modes {        API_TUNNEL_NONE,	API_TUNNEL_FULL,	API_TUNNEL_TRIANGLE,	API_TUNNEL_FULL_HA /* directly to HA without FAs */};/* This structure is used to pass mobile status information from * mobile to users. It is intended for use within same computer * (host byte order is used). */#define API_STATE_LEN 24#define API_VERSION_LEN 16#define API_INFO_LEN 80#define MAX_MON_CONF_VAR_LEN 30#define API_MAX_NAI_LEN 255struct dynamics_mobile_status {        char version[API_VERSION_LEN + 1]; /* version of MN */	int state;                         /* State of mobile encoded in int */	char state_str[API_STATE_LEN + 1]; /* State of the mobile in text */	struct in_addr local_addr;         /* Local address used in network					      interface */	struct in_addr co_addr;            /* used co-addr */	struct in_addr fa_addr;            /* used Foreign Agent */	struct in_addr ha_addr;            /* used Home Agent */	struct in_addr home_addr;          /* used home address */	int tunnel_up;                     /* Is tunnel up? */	int tunnel_mode;                   /* tunneling mode */	int lifetime;                      /* lifetime left */	unsigned char last_reply_code;     /* Reply code received in the last					    * registration reply */	time_t last_reply_rcvd;	time_t last_request_sent;	char info_str[API_INFO_LEN + 1];   /* information text to the user */	int device_count;                  /* number of available interfaces */	char warn_str[API_INFO_LEN + 1];   /* warning text to the user */	unsigned long discarded_msgs;      /* number of discarded messages */};#define API_MA_FLAGS_FA 0x01#define API_MA_FLAGS_HA 0x02#define API_MA_FLAGS_BUSY 0x04#define API_MA_FLAGS_DYNAMICS 0x08struct dynamics_mobile_fa_list {	struct in_addr addr;               /* FA IP address */	char interface[IFNAMSIZ];          /* interface name */	int in_use;                        /* in use? */	int current_adv;                   /* current adv? */	int quality_avg;                   /* wireless: quality average */	int priority;                      /* last set priority */	int reduce;                        /* priority is reduced, in percent*/	long last;                         /* timestamp for last agent adv. */	unsigned int flags;                /* flags (API_MA_FLAGS_*) */};struct dynamics_mobile_fa_info {	struct dynamics_mobile_fa_list list;	int ifindex;                       /* interface index */	long expire;                       /* last agent. adv. will expire */	int arpentry;                      /* 1 = own ARP entry used */	char nai[API_MAX_NAI_LEN + 1];     /* Network Access Identifier */};struct dynamics_mn_iw_ch_info {	char ifname[IFNAMSIZ];             /* Interface name */	int channel;                       /* channel number */	char ap_hwaddr[ETH_ALEN];};struct dynamics_mn_mon_conf_var {	char name[MAX_MON_CONF_VAR_LEN];	int len;	int value;};/* This structure is used to pass foreign agent information to user. */struct dynamics_fa_status {	char version[API_VERSION_LEN + 1]; /* agent version */	int tunnel_count;                  /* count of active tunnels */	unsigned long req_rejected;	unsigned long req_accepted;	unsigned long adv_sent;	unsigned long apicalls_admin;	unsigned long apicalls_read;	int pending_count; /* number of pending registration requests */	unsigned long discarded_unknown_ext;	unsigned long discarded_malformed_msg;	unsigned long discarded_vendor_ext;	unsigned long rep_rejected;	unsigned long rep_accepted;};/* This structure is used to pass home agent information to the user. */struct dynamics_ha_status {	char version[API_VERSION_LEN + 1]; /* agent version */	int tunnel_count;                  /* count of active tunnels */	unsigned long req_rejected;	unsigned long req_accepted;	unsigned long adv_sent;	unsigned long apicalls_admin;	unsigned long apicalls_read;	unsigned long discarded_unknown_ext;	unsigned long discarded_malformed_msg;	unsigned long discarded_vendor_ext;	unsigned long discarded_not_request;};struct dyn_tunnel_id_struct {	struct in_addr mn_addr;	struct in_addr ha_addr;	__u32 priv_ha;};typedef struct dyn_tunnel_id_struct dyn_tunnel_id;/* This structure is used pass tunnel information from agent to the user. * Intended for use within same computer (host byte order used). */struct dynamics_tunnel_info {	dyn_tunnel_id id;       /* tunnel id */	struct in_addr mn_addr; /* Mobile Nodes address */	struct in_addr co_addr; /* Address of mobiles current careof agent */	struct in_addr ha_addr; /* Home Agent address for the mobile */	time_t creation_time;   /* time of tunnel creation */	time_t expiration_time; /* expiration time of tunnel */	time_t refresh_time;    /* time when tunnel was last refreshed */	__u32 last_timestamp[2];/* timestamp of last received				   signaling message */	int confirmed;          /* boolean value indicating if the binding				 * is confirmed or not */	int spi;                /* associated authentication method */	int timeout;            /* binding timeout in seconds */	__u32 priv_ha;		/* private HA identifier */};/* Advertisement parameter */struct dyn_param_adv {	__u8 mac[6];	int ifindex;};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -