Blame libiscsi/tests/test_get_network_config.c

Packit Service 37dbff
/*
Packit Service 37dbff
 * iSCSI Administration library
Packit Service 37dbff
 *
Packit Service 37dbff
 * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
Packit Service 37dbff
 * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
Packit Service 37dbff
 * maintained by open-iscsi@googlegroups.com
Packit Service 37dbff
 *
Packit Service 37dbff
 * This program is free software; you can redistribute it and/or modify
Packit Service 37dbff
 * it under the terms of the GNU General Public License as published
Packit Service 37dbff
 * by the Free Software Foundation; either version 2 of the License, or
Packit Service 37dbff
 * (at your option) any later version.
Packit Service 37dbff
 *
Packit Service 37dbff
 * This program is distributed in the hope that it will be useful, but
Packit Service 37dbff
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 37dbff
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Packit Service 37dbff
 * General Public License for more details.
Packit Service 37dbff
 *
Packit Service 37dbff
 * See the file COPYING included with this distribution for more details.
Packit Service 37dbff
 */
Packit Service 37dbff
Packit Service 37dbff
#include <stdio.h>
Packit Service 37dbff
#include <stdlib.h>
Packit Service 37dbff
#include <string.h>
Packit Service 37dbff
#include "libiscsi.h"
Packit Service 37dbff
Packit Service 37dbff
int main(void)
Packit Service 37dbff
{
Packit Service 37dbff
	struct libiscsi_network_config config;
Packit Service 37dbff
Packit Service 37dbff
	if (libiscsi_get_firmware_network_config(&config)) {
Packit Service 37dbff
		fprintf(stderr, "No iscsi boot firmware found\n");
Packit Service 37dbff
		return 1;
Packit Service 37dbff
	}
Packit Service 37dbff
Packit Service 37dbff
	printf("dhcp:\t%d\n", config.dhcp);
Packit Service 37dbff
	printf("iface:\t%s\n", config.iface_name);
Packit Service 37dbff
	printf("mac:\t%s\n", config.mac_address);
Packit Service 37dbff
	printf("ipaddr:\t%s\n", config.ip_address);
Packit Service 37dbff
	printf("mask:\t%s\n", config.netmask);
Packit Service 37dbff
	printf("gate:\t%s\n", config.gateway);
Packit Service 37dbff
	printf("dns1:\t%s\n", config.primary_dns);
Packit Service 37dbff
	printf("dns2:\t%s\n", config.secondary_dns);
Packit Service 37dbff
Packit Service 37dbff
	return 0;
Packit Service 37dbff
}