/*
*/
/*
* BSD 3 Clause License
*
* Copyright (c) 2007, The Storage Networking Industry Association.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* distribution.
*
* - Neither the name of The Storage Networking Industry Association (SNIA)
* nor the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <locale.h>
#include <libndmp.h>
#include "ndmpadm.h"
/* static functions prototype */
static void ndmp_tprint_addr(char *, ndmp_ad_type_t, char *);
static void ndmp_print_env(ndmp_session_info_t *);
static void ndmp_connect_print_conn(ndmp_session_info_t *);
static void ndmp_connect_print_scsi_v2(ndmp_session_info_t *);
static void ndmp_connect_print_tape_v2(ndmp_session_info_t *);
static void ndmp_connect_print_mover_v2(ndmp_session_info_t *);
static void ndmp_connect_print_data_v2(ndmp_session_info_t *);
static void ndmp_connect_print_v2(int, ndmp_session_info_t *);
static void ndmp_connect_print_mover_v3(ndmp_session_info_t *);
static void ndmp_connect_print_data_v3(ndmp_session_info_t *);
static void ndmp_connect_print_v3(int, ndmp_session_info_t *);
static void ndmp_connection_print(int, ndmp_session_info_t *);
/* Boolean to string. */
/*
* Print the address type and IP address if the address type is tcp
*/
static void
{
return;
switch (addr_type) {
case NDMP_AD_LOCAL:
break;
case NDMP_AD_TCP:
break;
case NDMP_AD_FC:
break;
case NDMP_AD_IPC:
break;
default:
gettext("\t%s addr type unknown (0x%x)\n"),
}
}
/*
* Print all the data environment variables for the active session
*/
static void
{
int i, n;
}
}
/*
* Print common fields of the active connection.
*/
static void
{
}
/*
* Print the connection SCSI info.
*/
static void
{
}
}
/*
* Print the connection tape info.
*/
static void
{
case NDMP_TP_READ_MODE:
gettext("\ttape.mode:\t\tRead-only\n"));
break;
case NDMP_TP_WRITE_MODE:
break;
case NDMP_TP_RAW1_MODE:
gettext("\ttape.mode:\t\tRaw\n"));
break;
default:
gettext("\ttape.mode:\t\tUnknown (0x%x)\n"),
}
gettext("\ttape.device name:\t%s\n"),
gettext("\ttape.adapter name:\t\"%s\"\n"),
} else
}
/*
* Print the connection mover info.
*/
static void
{
case NDMP_MV_STATE_IDLE:
break;
case NDMP_MV_STATE_LISTEN:
break;
case NDMP_MV_STATE_ACTIVE:
break;
case NDMP_MV_STATE_PAUSED:
break;
case NDMP_MV_STATE_HALTED:
break;
default:
}
case NDMP_MV_MODE_READ:
break;
case NDMP_MV_MODE_WRITE:
break;
default:
gettext("\tmover.mode:\t\tUnknown (0x%x)\n"),
}
case NDMP_MV_PAUSE_NA:
break;
case NDMP_MV_PAUSE_EOM:
break;
case NDMP_MV_PAUSE_EOF:
break;
case NDMP_MV_PAUSE_SEEK:
gettext("\tmover.pause reason:\tSeek\n"));
break;
gettext("\tmover.pause reason:\tMedia Error\n"));
break;
default:
gettext("\tmover.pause reason:\tUnknown (0x%x)\n"),
}
case NDMP_MV_HALT_NA:
break;
break;
case NDMP_MV_HALT_ABORTED:
break;
break;
break;
default:
}
}
/*
* Print the connection data info.
*/
static void
{
int i;
case NDMP_DT_OP_NOACTION:
break;
case NDMP_DT_OP_BACKUP:
gettext("\tdata.operation:\t\tBackup\n"));
break;
case NDMP_DT_OP_RECOVER:
gettext("\tdata.operation:\t\tRestore\n"));
break;
default:
gettext("\tdata.operation:\t\tUnknown (0x%x)\n"),
}
case NDMP_DT_STATE_IDLE:
break;
case NDMP_DT_STATE_ACTIVE:
break;
case NDMP_DT_STATE_HALTED:
break;
default:
}
case NDMP_DT_HALT_NA:
break;
case NDMP_DT_HALT_SUCCESSFUL:
break;
case NDMP_DT_HALT_ABORTED:
break;
break;
break;
default:
}
case NDMP_AD_LOCAL:
break;
case NDMP_AD_TCP:
gettext("\tdata.mover address:\t%s\n"),
break;
default:
gettext("\tdata.mover type:\tUnknown (0x%x)\n"),
}
gettext("\tdata.nlist[%d]:\tname: "
"\"%s\"\n\t\tdest:\"%s\"\n"),
}
}
}
/*
* Print V2 connection info for the given category.
*/
static void
{
if (cat & NDMP_CAT_SCSI)
if (cat & NDMP_CAT_TAPE)
if (cat & NDMP_CAT_MOVER)
if (cat & NDMP_CAT_DATA)
}
/*
* Print the V3 connection mover info.
*/
static void
{
case NDMP_MV_STATE_IDLE:
break;
case NDMP_MV_STATE_LISTEN:
break;
case NDMP_MV_STATE_ACTIVE:
break;
case NDMP_MV_STATE_PAUSED:
break;
case NDMP_MV_STATE_HALTED:
break;
default:
}
case NDMP_MV_MODE_READ:
break;
case NDMP_MV_MODE_WRITE:
break;
default:
gettext("\tmover.mode:\t\tUnknown (0x%x)\n"),
}
case NDMP_MV_PAUSE_NA:
break;
case NDMP_MV_PAUSE_EOM:
break;
case NDMP_MV_PAUSE_EOF:
break;
case NDMP_MV_PAUSE_SEEK:
gettext("\tmover.pause reason:\tSeek\n"));
break;
gettext("\tmover.pause reason:\tMedia Error\n"));
break;
case NDMP_MV_PAUSE_EOW:
break;
default:
gettext("\tmover.pause reason:\tUnknown (0x%x)\n"),
}
case NDMP_MV_HALT_NA:
break;
break;
case NDMP_MV_HALT_ABORTED:
break;
break;
break;
default:
}
case NDMP_MV_STATE_IDLE:
gettext("\tmover.listenSock:\t%d\n"),
break;
case NDMP_MV_STATE_LISTEN:
break;
case NDMP_MV_STATE_ACTIVE:
case NDMP_MV_STATE_PAUSED:
case NDMP_MV_STATE_HALTED:
break;
}
}
/*
* Print the connection data info.
*/
static void
{
int i;
case NDMP_DT_OP_NOACTION:
break;
case NDMP_DT_OP_BACKUP:
gettext("\tdata.operation:\t\tBackup\n"));
break;
case NDMP_DT_OP_RECOVER:
gettext("\tdata.operation:\t\tRestore\n"));
break;
default:
gettext("\tdata.operation:\t\tUnknown (0x%x)\n"),
}
case NDMP_DT_STATE_IDLE:
break;
case NDMP_DT_STATE_ACTIVE:
break;
case NDMP_DT_STATE_HALTED:
break;
case NDMP_DT_STATE_LISTEN:
break;
case NDMP_DT_STATE_CONNECTED:
break;
default:
}
case NDMP_DT_HALT_NA:
break;
case NDMP_DT_HALT_SUCCESSFUL:
break;
case NDMP_DT_HALT_ABORTED:
break;
break;
break;
default:
}
case NDMP_DT_STATE_IDLE:
gettext("\tdata.data socket:\t%d\n"),
gettext("\tdata.data socket:\t%d\n"),
break;
case NDMP_DT_STATE_LISTEN:
break;
case NDMP_DT_STATE_ACTIVE:
case NDMP_DT_STATE_HALTED:
case NDMP_DT_STATE_CONNECTED:
break;
}
gettext("\tdata.bytes processed:\t%lld\n"),
i);
else
np->nn3_fh_info);
}
}
/*
* Print V3 connection info for given category.
*/
static void
{
if (cat & NDMP_CAT_SCSI)
if (cat & NDMP_CAT_TAPE)
if (cat & NDMP_CAT_MOVER)
if (cat & NDMP_CAT_DATA)
}
/*
* Print the list of all active sessions to the clients. For each version,
* call the appropriate print function.
*/
static void
{
case NDMP_V2:
break;
case NDMP_V3:
case NDMP_V4:
break;
default:
}
}
/*
* Print the list of all active sessions to the clients.
*/
void
{
int i;
}
if (num == 0) {
} else {
}
}
/*
* Print the connection information for the given category.
*/
void
{
}
void
{
int i;
return;
}
/*
* Don't print dead links.
*/
continue;
switch (dip->nd_dev_type) {
case NDMP_SINQ_TAPE_ROBOT:
break;
break;
}
if (dip->nd_product)
if (dip->nd_revision)
}
}