📄 bt_ipa.h
字号:
/* * bt_ipa.h -- Interface towards IPA Assigner * * Copyright (C) 2000, 2001 Axis Communications AB * * Author: Mattias Agren <mattias.agren@axis.com> * * 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. * * 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. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Exceptionally, Axis Communications AB grants discretionary and * conditional permissions for additional use of the text contained * in the company's release of the AXIS OpenBT Stack under the * provisions set forth hereunder. * * Provided that, if you use the AXIS OpenBT Stack with other files, * that do not implement functionality as specified in the Bluetooth * System specification, to produce an executable, this does not by * itself cause the resulting executable to be covered by the GNU * General Public License. Your use of that executable is in no way * restricted on account of using the AXIS OpenBT Stack code with it. * * This exception does not however invalidate any other reasons why * the executable file might be covered by the provisions of the GNU * General Public License. * * $Id: bt_ipa.h,v 1.3 2001/03/26 15:37:33 mattiasagren Exp $ * */#ifndef __BT_IPA_H__#define __BT_IPA_H__#include <sys/types.h>#include <netinet/in.h>#include "bt_conf.h"#define IPASERVER "/tmp/ipa_server"#define IPA_MSG_MAXSIZE 256/* ================================================================*//* IPA messages *//* Requests */#define IPAREQ_GETIPSET 0#define IPAREQ_RELEASEIPSET 1#define IPAREQ_GETCLIENTIPDHCP 2#define IPAREQ_UPDATEIPMAPPING 3/* Responses */#define IPARSP_STATUS 10#define IPARSP_PEERSETTINGS 11/* Status codes */#define IPA_STATUSSUCCESS 0#define IPA_STATUSFAILED 1/* Error codes */#define ERR_WRONGSTATE 2#define ERR_REQUESTFAILED 3/* ================================================================*//* IPA Client struct */typedef struct ip_set{ struct in_addr ip; /* Returns IP address for the client */ struct in_addr dns[2]; /* Returned DNS servers */ int nbr_of_dns; /* Returns number of found DNS servers. */ struct in_addr wins[2]; /* Returned MS WINS servers */ int nbr_of_wins; /* Returns number of found MS WINS servers*/ struct in_addr netmask; /* Returns the netmask to be used */ int proxyarp; /* Returns 1 if proxyarp will be used */ int useradius; /* Returns 1 if RADIUS is being used */ int useradiusip; /* Returns 1 if IP address assignment via RADIUS is allowed */ int usingmasq; /* Returns 1 if NAT is being used */} ip_set;/* ================================================================*//* IPA message structs */typedef struct ipa_msg{ unsigned short type; unsigned short len; /* Length of msg excluding type and len */ unsigned char msg[0];} ipa_msg;typedef struct ipa_request{ unsigned short id; /* Line associated mapped to this client */ unsigned char remote_bd[6]; /* Requestors BD address */} ipa_request;typedef struct ipa_response{ unsigned short id; /* add request type ? */ unsigned short status; struct ip_set set;} ipa_response;/* acknowledge on a request */typedef struct ipa_status{ unsigned short id; unsigned short status;} ipa_status;int ipa_open(void);void ipa_close(int ipa_fd);int ipa_write(int ipa_fd, ipa_msg *msg);int ipa_read(int ipa_fd, ipa_msg *msg);void show_ipset(struct ip_set* set, int line);#endif /* __BT_IPA_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -