2011-12-31 16:14:18 +08:00
|
|
|
/**
|
|
|
|
* @file config.h
|
|
|
|
* @brief Configuration file code
|
|
|
|
* @note Copyright (C) 2011 Richard Cochran <richardcochran@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
#ifndef HAVE_CONFIG_H
|
|
|
|
#define HAVE_CONFIG_H
|
|
|
|
|
|
|
|
#include "ds.h"
|
2012-08-21 01:56:24 +08:00
|
|
|
#include "dm.h"
|
|
|
|
#include "transport.h"
|
|
|
|
|
|
|
|
#define MAX_PORTS 8
|
|
|
|
|
|
|
|
/** Defines a network interface, with PTP options. */
|
|
|
|
struct interface {
|
|
|
|
char *name;
|
|
|
|
enum delay_mechanism dm;
|
|
|
|
enum transport_type transport;
|
|
|
|
};
|
2011-12-31 16:14:18 +08:00
|
|
|
|
2012-03-21 03:09:40 +08:00
|
|
|
struct config {
|
2012-08-21 01:56:24 +08:00
|
|
|
/* configured interfaces */
|
|
|
|
struct interface iface[MAX_PORTS];
|
|
|
|
int nports;
|
|
|
|
|
2012-03-21 03:09:40 +08:00
|
|
|
struct defaultDS *dds;
|
|
|
|
struct port_defaults *pod;
|
2012-07-28 04:34:34 +08:00
|
|
|
int *assume_two_step;
|
2012-03-21 03:16:58 +08:00
|
|
|
int *tx_timestamp_retries;
|
2012-07-27 18:00:47 +08:00
|
|
|
int *rx_timestamp_l2only;
|
2012-05-03 17:17:34 +08:00
|
|
|
double *pi_proportional_const;
|
|
|
|
double *pi_integral_const;
|
2012-07-27 17:30:22 +08:00
|
|
|
unsigned char *ptp_dst_mac;
|
|
|
|
unsigned char *p2p_dst_mac;
|
2012-03-21 03:09:40 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
int config_read(char *name, struct config *cfg);
|
2011-12-31 16:14:18 +08:00
|
|
|
|
|
|
|
#endif
|