| 1 |
/* LIBAX25 - Library for AX.25 programs |
| 2 |
* Copyright (C) 1997-1999 Jonathan Naylor, Tomi Manninen, Jean-Paul Roubelat |
| 3 |
* and Alan Cox. |
| 4 |
* |
| 5 |
* This library is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU Lesser General Public |
| 7 |
* License as published by the Free Software Foundation; either |
| 8 |
* version 2.1 of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This library is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* Library General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU Lesser General Public |
| 16 |
* License along with this library; if not, see |
| 17 |
* <https://www.gnu.org/licenses/>. |
| 18 |
*/ |
| 19 |
/* |
| 20 |
* This file contains the definitions of the entry points into the NET/ROM |
| 21 |
* configuration functions. |
| 22 |
*/ |
| 23 |
|
| 24 |
#ifndef _NRCONFIG_H |
| 25 |
#define _NRCONFIG_H |
| 26 |
|
| 27 |
#ifndef TRUE |
| 28 |
#define TRUE 1 |
| 29 |
#endif |
| 30 |
|
| 31 |
#ifndef FALSE |
| 32 |
#define FALSE 0 |
| 33 |
#endif |
| 34 |
|
| 35 |
#ifdef __cplusplus |
| 36 |
extern "C" { |
| 37 |
#endif |
| 38 |
|
| 39 |
/* |
| 40 |
* This function must be called before using any of the other functions in |
| 41 |
* this part of the library. It returns the number of active ports, or 0 |
| 42 |
* on failure. |
| 43 |
*/ |
| 44 |
extern int nr_config_load_ports(void); |
| 45 |
|
| 46 |
/* |
| 47 |
* This function allows the enumeration of all the active configured ports. |
| 48 |
* Passing NULL as the argument returns the first port name in the list, |
| 49 |
* subsequent calls to this function should be made with the last port name |
| 50 |
* returned. A NULL return indicates either an error, or the end of the list. |
| 51 |
*/ |
| 52 |
extern char *nr_config_get_next(char *); |
| 53 |
|
| 54 |
/* |
| 55 |
* This function maps the device name onto the port name (as used in the axports |
| 56 |
* file. On error a NULL is returned. |
| 57 |
*/ |
| 58 |
extern char *nr_config_get_name(char *); |
| 59 |
|
| 60 |
/* |
| 61 |
* This function maps the port name onto the callsign of the port. On error a |
| 62 |
* NULL is returned. |
| 63 |
*/ |
| 64 |
extern char *nr_config_get_addr(char *); |
| 65 |
|
| 66 |
/* |
| 67 |
* This function maps the port name onto the device name of the port. On error a |
| 68 |
* NULL is returned. |
| 69 |
*/ |
| 70 |
extern char *nr_config_get_dev(char *); |
| 71 |
|
| 72 |
/* |
| 73 |
* This function maps the callsign in AX.25 shifted format onto the port name. |
| 74 |
* On error, NULL is returned. |
| 75 |
*/ |
| 76 |
extern char *nr_config_get_port(ax25_address *); |
| 77 |
|
| 78 |
/* |
| 79 |
* This function takes the port name and returns the alias of the port. On |
| 80 |
* error NULL is returned. |
| 81 |
*/ |
| 82 |
extern char *nr_config_get_alias(char *); |
| 83 |
|
| 84 |
/* |
| 85 |
* This function takes the port name and returns the maximum packet length. |
| 86 |
* On error a 0 is returned. |
| 87 |
*/ |
| 88 |
extern int nr_config_get_paclen(char *); |
| 89 |
|
| 90 |
/* |
| 91 |
* This function takes the port name and returns the description of the port. |
| 92 |
* On error a NULL is returned. |
| 93 |
*/ |
| 94 |
extern char *nr_config_get_desc(char *); |
| 95 |
|
| 96 |
#ifdef __cplusplus |
| 97 |
} |
| 98 |
#endif |
| 99 |
|
| 100 |
#endif |