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

📄 bnep_core.h

📁 linux下蓝牙
💻 H
字号:
/*  BlueNIC - Bluetooth PAN profile implementation for BlueZ  Copyright (C) 2002 Sony Corporation  Author: Johannes Loebbert <loebbert@sony.de>  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.  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*//* * $Id: bnep_core.h,v 1.4 2002/07/04 16:04:48 johanloe Exp $*/#ifndef _BNEP_CORE_H#define _BNEP_CORE_H 1#include <linux/timer.h>#include <linux/init.h>#include <net/sock.h>#include <linux/etherdevice.h>#include "kthread.h"#include "bnep_common.h"#define BNEP_REQ_DONE     0#define BNEP_REQ_CANCELED 1#define BNEP_REQ_PENDING  2#define BNEP_CONN_CLOSED 0#define BNEP_CONN_OPEN   1struct bnep_owner_struct {	struct module *owner;};struct request_struct {	int req_status;	int req_result;	wait_queue_head_t req_wait_q;	struct semaphore req_lock;	struct bnep_connection *bnep_conn;};struct bnep_connection {	__u16 destination_uuid;	kthread_t session;	struct socket *sk;	struct filter_info_summary_struct filter_info;	struct list_head list;	struct request_struct connect_request;	struct request_struct filter_request;	struct net_device *net_dev;	__u8 status;};struct bnep_private {	__u16 role_uuid;	spinlock_t lock;	bdaddr_t source_address;	kthread_t listener_thread;	kthread_t bnep_send_thread;	int connection_counter;	struct list_head bnep_connections;	struct socket *bnep_sk;	struct net_device_stats stats;	struct net_device *next_dev;};//**********************************************************************///Function prototypes                                                                            #ifdef CONFIG_NET_FASTROUTEstatic int bnep_accept_fastpath(struct net_device *dev, struct dst_entry *dst);#endifstatic struct net_device_stats *device_get_stats(struct net_device *dev);static void device_set_multicast_list(struct net_device *dev);static struct net_device_stats *device_get_stats(struct net_device *dev);static int bnep_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);static int __init bnep_init_module(void);static void __exit bnep_cleanup_module(void);//Outgoing message handlingstatic int bnep_tx_etherdata(struct bnep_connection *bnep_conn, struct bnep_connection *entry,			       struct sk_buff *skb_input, struct ethhdr *eth, __u16 * h802_1p,			       int ExtensionFlag, __u8 packet_type);			       //Incoming message handlingstatic int bnep_rx_frame(struct bnep_connection *bnep_conn, struct sk_buff *skb_input);static int bnep_rx_etherdata(struct bnep_connection *bnep_conn, struct sk_buff *skb_input,			     int PacketType, int ExtensionFlag);//Device transmit functionsstatic int device_rx_data(struct sk_buff *skb, struct net_device *dev);static int device_tx_data(struct sk_buff *skb, struct net_device *dev);//Incoming Filter messagesstatic int bnep_rx_net_filter(struct bnep_connection *bnep_conn, struct sk_buff *skb_input);static int bnep_rx_multicast_filter(struct bnep_connection *bnep_conn, struct sk_buff *skb_input);static int bnep_rx_net_filter_rsp(struct bnep_connection *bnep_conn, struct sk_buff *skb_input);static int bnep_rx_multicast_filter_rsp(struct bnep_connection *bnep_conn,					struct sk_buff *skb_input);					static int bnep_rx_extension_header(struct bnep_connection *bnep_conn, struct sk_buff *skb_input,				      int *ExtensionsLength);//Outgoing command handlingstatic int bnep_tx_unknown_controldata(struct bnep_connection *bnep_conn,				       __u8 unknown_control_code);static int bnep_tx_apply_protocol_filter(struct bnep_connection *bnep_conn, 						struct ethhdr *eth);static int bnep_tx_apply_multicast_filter(struct bnep_connection *bnep_conn, 						struct ethhdr *eth);int _bnep_tx_filter(struct bnep_connection *bnep_conn,		    struct filter_request_struct *filter_request);//Incoming command handlingstatic int bnep_rx_controldata(struct bnep_connection *bnep_conn, struct sk_buff *skb_input ,			int ExtensionFlag);static int bnep_rx_unknown_controldata(struct bnep_connection *bnep_conn, 			struct sk_buff *skb_input);static int bnep_rx_connect_req(struct bnep_connection *bnep_conn, 			struct sk_buff *skb_input);static int bnep_rx_connect_rsp(struct bnep_connection *bnep_conn, 			struct sk_buff *skb_input);//Thread functionsstatic void bnep_session(kthread_t * kthread);//connect request fctstatic int bnep_connect(struct net_device *net_dev,			struct bnep_connect_mgnt_struct *bnep_connect_mgnt);static int _bnep_request(struct request_struct *request,			 void (*req) (struct request_struct * request, unsigned long opt),			 unsigned long opt, __u32 timeout);static void bnep_connect_req(struct request_struct *request, unsigned long opt);static inline int bnep_request(struct request_struct *request,			       void (*req) (struct request_struct * request, unsigned long opt),			       unsigned long opt, __u32 timeout);static inline struct bnep_private *bnep_get_priv(struct net_device *net_dev){	return (struct bnep_private *) net_dev->priv;}struct bnep_connection;int bnep_tx_etherdata_multiplexor(struct net_device *net, struct bnep_connection *bnep_conn,			       struct sk_buff *skb_input, struct ethhdr *eth, __u16 * h802_1p,			       int ExtensionLength, __u8 packet_type);int bnep_tx_controldata(struct bnep_connection *bnep_conn, __u8 ControlType, int ExtensionFlag,			struct sk_buff *skb);int bnep_tx_net_filter(void);int bnep_tx_multicast_filter(void);struct bnep_connection *bnep_get_conn_by_bdaddr(struct net_device *dev, bdaddr_t * target_addr);#ifdef BNEP_TESTint test_execute_test(struct net_device *net_dev, struct bnep_test_ctrl_struct *bnep_test_ctrl);int test_bnep_packet_prepare(void);#endifint bnep_sock_init(void);int bnep_sock_cleanup(void);#endif

⌨️ 快捷键说明

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