/*
* Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2.1 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
* USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
/*
* ifd.h
*
* This header file is used by all ifd clients to send requests to
* ifd (interface daemon).
*/
#ifndef IFD_H
#define IFD_H
#ident "$Id: ifd.h,v 1.1 2000/08/31 19:16:32 vasa Exp $"
#include <ci_err.h>
#include <ci_nlist.h>
#include <ci_cdbkeys.h>
#define IFD_SOCKFILE CI_HACOMM_DIR "/" CI_IFD_PREFIX "_socket"
#define IFD_MAGIC "FACE0DEAD"
#define IFD_VERS 1
/* Macro for IFD CDB parameters */
#define IFD_CDB_INFO \
(CDB_DD CDB_LOCAL CDB_DD CDB_HA CDB_DD CDB_SERVICES CDB_DD CDB_IFD)
typedef enum {
IFREQS_SUCCESS, /* request was successfully completed */
IFREQS_BADMAGIC, /* Bad magic */
IFREQS_INCORRECTVERS, /* Incorrect ifd version */
IFREQS_IFILEINVAL, /* Input file invalid */
IFREQS_OFILEINVAL, /* Output file invalid */
IFREQS_TYPEINVAL /* Request type invalid */
} ifd_reqstatus_t;
typedef enum {
IFDREQ_CHKSTATUS, /* Check status of an ip address */
IFDREQ_GETINTF, /* Get interface for an ip address */
IFDREQ_GETINFO /* Get information about an ip address */
} ifd_reqtype_t;
/* Status returned by IFDREQ_CHKSTATUS command */
typedef enum {
IFD_IPADDRGOOD = 0, /* IP address is configured on a good
* interface */
IFD_IPADDRBADINTF = 1, /* IP address is configured on an
* interface that is marked bad */
IFD_IPADDRNOTAVAIL = 2 /* IP address is not configured on
* any interface */
} ifd_ipstatus_t;
/* ifd command request */
typedef struct ifd_req_s {
char ifd_magic[10]; /* Has to be "FACE0DEAD" */
uint32_t ifd_vers; /* IFD version */
ifd_reqtype_t type; /* command request type */
char ifile[MAXPATHLEN]; /* input file name */
char ofile[MAXPATHLEN]; /* output file name */
ifd_reqstatus_t status; /* request status */
} ifd_req_t;
/* ifd configuration structure */
typedef struct ifd_param_s {
uint32_t valid; /* Valid parameters */
uint32_t scan_period; /* Time period to
* check interfaces */
ci_nlist_t *if_list; /* list of interfaces */
} ifd_param_t;
/* Values for ifd_param_t valid field */
#define IFD_PARAM_SP 0x00000001 /* Scan period */
#define IFD_PARAM_IFL 0x00000002 /* Interfaces list */
/* Routines used by CLI to set/get/check ifd parameters */
ci_err_t ifd_params_get(cdb_handle_t, ifd_param_t *, char *);
ci_err_t ifd_params_set(cdb_handle_t, ifd_param_t *, char *);
ci_err_t ifd_params_check(ifd_param_t *, char *);
#endif /* IFD_H */