1114879Sjulian/* 2114879Sjulian * hcsecd.h 3114879Sjulian * 4114879Sjulian * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com> 5114879Sjulian * All rights reserved. 6114879Sjulian * 7114879Sjulian * Redistribution and use in source and binary forms, with or without 8114879Sjulian * modification, are permitted provided that the following conditions 9114879Sjulian * are met: 10114879Sjulian * 1. Redistributions of source code must retain the above copyright 11114879Sjulian * notice, this list of conditions and the following disclaimer. 12114879Sjulian * 2. Redistributions in binary form must reproduce the above copyright 13114879Sjulian * notice, this list of conditions and the following disclaimer in the 14114879Sjulian * documentation and/or other materials provided with the distribution. 15114879Sjulian * 16114879Sjulian * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17114879Sjulian * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18114879Sjulian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19114879Sjulian * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20114879Sjulian * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21114879Sjulian * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22114879Sjulian * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23114879Sjulian * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24114879Sjulian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25114879Sjulian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26114879Sjulian * SUCH DAMAGE. 27114879Sjulian * 28121054Semax * $Id: hcsecd.h,v 1.3 2003/09/08 18:54:21 max Exp $ 29114879Sjulian * $FreeBSD: releng/10.2/usr.sbin/bluetooth/hcsecd/hcsecd.h 128079 2004-04-09 23:58:53Z emax $ 30114879Sjulian */ 31114879Sjulian 32114879Sjulian#ifndef _HCSECD_H_ 33114879Sjulian#define _HCSECD_H_ 1 34114879Sjulian 35121054Semax#define HCSECD_BUFFER_SIZE 512 36121054Semax#define HCSECD_IDENT "hcsecd" 37121054Semax#define HCSECD_PIDFILE "/var/run/" HCSECD_IDENT ".pid" 38121054Semax#define HCSECD_KEYSFILE "/var/db/" HCSECD_IDENT ".keys" 39121054Semax 40114879Sjulianstruct link_key 41114879Sjulian{ 42114879Sjulian bdaddr_t bdaddr; /* remote device BDADDR */ 43114879Sjulian char *name; /* remote device name */ 44128079Semax uint8_t *key; /* link key (or NULL if no key) */ 45114879Sjulian char *pin; /* pin (or NULL if no pin) */ 46114879Sjulian LIST_ENTRY(link_key) next; /* link to the next */ 47114879Sjulian}; 48114879Sjuliantypedef struct link_key link_key_t; 49114879Sjuliantypedef struct link_key * link_key_p; 50114879Sjulian 51114879Sjulianextern char *config_file; 52114879Sjulian 53114879Sjulian#if __config_debug__ 54114879Sjulianvoid dump_config (void); 55114879Sjulian#endif 56114879Sjulian 57121054Semaxvoid read_config_file(void); 58114879Sjulianvoid clean_config (void); 59114879Sjulianlink_key_p get_key (bdaddr_p bdaddr, int exact_match); 60114879Sjulian 61121054Semaxint read_keys_file (void); 62121054Semaxint dump_keys_file (void); 63121054Semax 64114879Sjulian#endif /* ndef _HCSECD_H_ */ 65114879Sjulian 66