00001 /********************************************************************* 00002 * 00003 * Filename: discovery.h 00004 * Version: 00005 * Description: 00006 * Status: Experimental. 00007 * Author: Dag Brattli <dagb@cs.uit.no> 00008 * Created at: Tue Apr 6 16:53:53 1999 00009 * Modified at: Tue Oct 5 10:05:10 1999 00010 * Modified by: Dag Brattli <dagb@cs.uit.no> 00011 * 00012 * Copyright (c) 1999 Dag Brattli, All Rights Reserved. 00013 * 00014 * This program is free software; you can redistribute it and/or 00015 * modify it under the terms of the GNU General Public License as 00016 * published by the Free Software Foundation; either version 2 of 00017 * the License, or (at your option) any later version. 00018 * 00019 * This program is distributed in the hope that it will be useful, 00020 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 * GNU General Public License for more details. 00023 * 00024 * You should have received a copy of the GNU General Public License 00025 * along with this program; if not, write to the Free Software 00026 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00027 * MA 02111-1307 USA 00028 * 00029 ********************************************************************/ 00030 00031 #ifndef DISCOVERY_H 00032 #define DISCOVERY_H 00033 00034 #include <asm/param.h> 00035 00036 #include <net/irda/irda.h> 00037 #include <net/irda/irqueue.h> 00038 00039 #define DISCOVERY_EXPIRE_TIMEOUT 6*HZ 00040 #define DISCOVERY_DEFAULT_SLOTS 0 00041 00042 #define NICKNAME_MAX_LEN 21 00043 00044 /* 00045 * The DISCOVERY structure is used for both discovery requests and responses 00046 */ 00047 typedef struct { 00048 queue_t q; /* Must be first! */ 00049 00050 __u32 saddr; /* Which link the device was discovered */ 00051 __u32 daddr; /* Remote device address */ 00052 LAP_REASON condition; /* More info about the discovery */ 00053 00054 __u16_host_order hints; /* Discovery hint bits */ 00055 __u8 charset; /* Encoding of nickname */ 00056 char nickname[22]; /* The name of the device (21 bytes + \0) */ 00057 int name_len; /* Lenght of nickname */ 00058 00059 int gen_addr_bit; /* Need to generate a new device address? */ 00060 int nslots; /* Number of slots to use when discovering */ 00061 unsigned long timestamp; /* Time discovered */ 00062 } discovery_t; 00063 00064 void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *discovery); 00065 void irlmp_add_discovery_log(hashbin_t *cachelog, hashbin_t *log); 00066 void irlmp_expire_discoveries(hashbin_t *log, __u32 saddr, int force); 00067 00068 #endif