10SN/A/*-
29330SN/A * hcsecd.h
30SN/A *
40SN/A * SPDX-License-Identifier: BSD-2-Clause
50SN/A *
60SN/A * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com>
72362SN/A * All rights reserved.
80SN/A *
92362SN/A * Redistribution and use in source and binary forms, with or without
100SN/A * modification, are permitted provided that the following conditions
110SN/A * are met:
120SN/A * 1. Redistributions of source code must retain the above copyright
130SN/A *    notice, this list of conditions and the following disclaimer.
140SN/A * 2. Redistributions in binary form must reproduce the above copyright
150SN/A *    notice, this list of conditions and the following disclaimer in the
160SN/A *    documentation and/or other materials provided with the distribution.
170SN/A *
180SN/A * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
190SN/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
200SN/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
212362SN/A * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
222362SN/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
232362SN/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
240SN/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
250SN/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
260SN/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
270SN/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
280SN/A * SUCH DAMAGE.
290SN/A *
300SN/A * $Id: hcsecd.h,v 1.3 2003/09/08 18:54:21 max Exp $
310SN/A */
320SN/A
330SN/A#ifndef _HCSECD_H_
340SN/A#define _HCSECD_H_ 1
350SN/A
360SN/A#define HCSECD_BUFFER_SIZE	512
370SN/A#define HCSECD_IDENT		"hcsecd"
380SN/A#define HCSECD_PIDFILE		"/var/run/" HCSECD_IDENT ".pid"
390SN/A#define HCSECD_KEYSFILE		"/var/db/"  HCSECD_IDENT ".keys"
400SN/A
410SN/Astruct link_key
420SN/A{
430SN/A	bdaddr_t		 bdaddr; /* remote device BDADDR */
440SN/A	char			*name;   /* remote device name */
450SN/A	uint8_t			*key;    /* link key (or NULL if no key) */
460SN/A	char			*pin;    /* pin (or NULL if no pin) */
470SN/A	LIST_ENTRY(link_key)	 next;   /* link to the next */
480SN/A};
490SN/Atypedef struct link_key		link_key_t;
500SN/Atypedef struct link_key *	link_key_p;
510SN/A
520SN/Aextern char	*config_file;
530SN/A
540SN/A#if __config_debug__
550SN/Avoid		dump_config	(void);
560SN/A#endif
570SN/A
580SN/Avoid		read_config_file(void);
590SN/Avoid		clean_config	(void);
600SN/Alink_key_p	get_key		(bdaddr_p bdaddr, int exact_match);
610SN/A
620SN/Aint		read_keys_file  (void);
630SN/Aint		dump_keys_file  (void);
640SN/A
650SN/A#endif /* ndef _HCSECD_H_ */
660SN/A
670SN/A