/***************************************************************************
 *   Nipper - The network infrastructure parser                            *
 *   Copyright (C) 2006 - 2008 by Ian Ventura-Whiting (Fizz)               *
 *   fizz@titania.co.uk                                                    *
 *                                                                         *
 *   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 3 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, see <http://www.gnu.org/licenses/>.  *
 ***************************************************************************/


void pixSSHConfig(struct nipperConfig *nipper)
{
	output_table(nipper, true, settings_ssh_table, &settings_general_heading);
	if (nipper->pix->ssh->version == 0)
		fprintf(nipper->reportFile, "%sProtocol Version%s1 and 2%s", nipper->tablerow_start, nipper->tablerow_mid, nipper->tablerow_end);
	else
		fprintf(nipper->reportFile, "%sProtocol Version%s%d%s", nipper->tablerow_start, nipper->tablerow_mid, nipper->pix->ssh->version, nipper->tablerow_end);
	fprintf(nipper->reportFile, "%sSession Timeout%s", nipper->tablerow_start, nipper->tablerow_mid);
	numToWord(nipper->reportFile, nipper->pix->ssh->timeout);
	fprintf(nipper->reportFile, " minutes%s", nipper->tablerow_end);
	if (nipper->pix->ssh->ipAddress[0] == 0)
		fprintf(nipper->reportFile, "%sManagement Host%sAny%s", nipper->tablerow_start, nipper->tablerow_mid, nipper->tablerow_end);
	else
		fprintf(nipper->reportFile, "%sManagement Host%s%s %s%s", nipper->tablerow_start, nipper->tablerow_mid, nipper->pix->ssh->ipAddress, nipper->pix->ssh->netMask, nipper->tablerow_end);
	fprintf(nipper->reportFile, "%sManagement Interface%s%s%s", nipper->tablerow_start, nipper->tablerow_mid, nipper->pix->ssh->interface, nipper->tablerow_end);
	output_table(nipper, false, settings_ssh_table, &settings_general_heading);
	addAbbreviation("SSH", false);
}


void pixSSHIssue(struct nipperConfig *nipper)
{
	// Variables...
	int tempInt = 0;

	if ((nipper->versionMajor < 7) || ((nipper->versionMajor == 7) && (nipper->versionMinor == 0) && (nipper->versionRevision == 0)))
		tempInt = -1;
	else
		tempInt = 0;
	output_parseText(report_sshproto_obs, nipper, section_obs, rate_none, tempInt, 0);
	output_endsection(nipper, section_obs);
	output_parseText(report_sshproto_impact, nipper, section_imp, rate_med, tempInt, 0);
	output_endsection(nipper, section_imp);
	output_parseText(report_sshproto_ease, nipper, section_ease, rate_difficult, tempInt, 0);
	output_endsection(nipper, section_ease);
	output_parseText(report_sshproto_rec1, nipper, section_rec, rate_none, tempInt, 0);
	output_endsection(nipper, section_rec);
}

