/*
 * Please do not edit this file.
 * It was generated using rpcgen.
 */

#include "nicinfo.h"

bool_t
xdr_NicInfoVersion (XDR *xdrs, NicInfoVersion *objp)
{

	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_NicInfoAddrType (XDR *xdrs, NicInfoAddrType *objp)
{

	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_VmIpAddress (XDR *xdrs, VmIpAddress *objp)
{

	int i;
	 if (!xdr_NicInfoAddrType (xdrs, &objp->addressFamily))
		 return FALSE;
	 if (!xdr_Bool (xdrs, &objp->dhcpEnabled))
		 return FALSE;
	 if (!xdr_vector (xdrs, (char *)objp->ipAddress, NICINFO_MAX_IP_LEN,
		sizeof (char), (xdrproc_t) xdr_char))
		 return FALSE;
	 if (!xdr_vector (xdrs, (char *)objp->subnetMask, NICINFO_MAX_IP_LEN,
		sizeof (char), (xdrproc_t) xdr_char))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_GuestNic (XDR *xdrs, GuestNic *objp)
{

	int i;
	 if (!xdr_vector (xdrs, (char *)objp->macAddress, NICINFO_MAC_LEN,
		sizeof (char), (xdrproc_t) xdr_char))
		 return FALSE;
	 if (!xdr_array (xdrs, (char **)&objp->ips.ips_val, (u_int *) &objp->ips.ips_len, NICINFO_MAX_IPS,
		sizeof (VmIpAddress), (xdrproc_t) xdr_VmIpAddress))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_GuestNicList (XDR *xdrs, GuestNicList *objp)
{

	 if (!xdr_array (xdrs, (char **)&objp->nics.nics_val, (u_int *) &objp->nics.nics_len, NICINFO_MAX_NICS,
		sizeof (GuestNic), (xdrproc_t) xdr_GuestNic))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_InetAddress (XDR *xdrs, InetAddress *objp)
{

	 if (!xdr_bytes (xdrs, (char **)&objp->InetAddress_val, (u_int *) &objp->InetAddress_len, INET_ADDRESS_MAX_LEN))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_InetAddressType (XDR *xdrs, InetAddressType *objp)
{

	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_InetAddressPrefixLength (XDR *xdrs, InetAddressPrefixLength *objp)
{

	 if (!xdr_u_int (xdrs, objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_IpAddressOrigin (XDR *xdrs, IpAddressOrigin *objp)
{

	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_IpAddressStatus (XDR *xdrs, IpAddressStatus *objp)
{

	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_TypedIpAddress (XDR *xdrs, TypedIpAddress *objp)
{

	 if (!xdr_InetAddressType (xdrs, &objp->ipAddressAddrType))
		 return FALSE;
	 if (!xdr_InetAddress (xdrs, &objp->ipAddressAddr))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_IpAddressEntry (XDR *xdrs, IpAddressEntry *objp)
{

	 if (!xdr_TypedIpAddress (xdrs, &objp->ipAddressAddr))
		 return FALSE;
	 if (!xdr_InetAddressPrefixLength (xdrs, &objp->ipAddressPrefixLength))
		 return FALSE;
	 if (!xdr_pointer (xdrs, (char **)&objp->ipAddressOrigin, sizeof (IpAddressOrigin), (xdrproc_t) xdr_IpAddressOrigin))
		 return FALSE;
	 if (!xdr_pointer (xdrs, (char **)&objp->ipAddressStatus, sizeof (IpAddressStatus), (xdrproc_t) xdr_IpAddressStatus))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_DnsHostname (XDR *xdrs, DnsHostname *objp)
{

	 if (!xdr_string (xdrs, objp, DNSINFO_MAX_ADDRLEN))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_DnsConfigInfo (XDR *xdrs, DnsConfigInfo *objp)
{

	 if (!xdr_pointer (xdrs, (char **)&objp->hostName, sizeof (DnsHostname), (xdrproc_t) xdr_DnsHostname))
		 return FALSE;
	 if (!xdr_pointer (xdrs, (char **)&objp->domainName, sizeof (DnsHostname), (xdrproc_t) xdr_DnsHostname))
		 return FALSE;
	 if (!xdr_array (xdrs, (char **)&objp->serverList.serverList_val, (u_int *) &objp->serverList.serverList_len, DNSINFO_MAX_SERVERS,
		sizeof (TypedIpAddress), (xdrproc_t) xdr_TypedIpAddress))
		 return FALSE;
	 if (!xdr_array (xdrs, (char **)&objp->searchSuffixes.searchSuffixes_val, (u_int *) &objp->searchSuffixes.searchSuffixes_len, DNSINFO_MAX_SUFFIXES,
		sizeof (DnsHostname), (xdrproc_t) xdr_DnsHostname))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_WinsConfigInfo (XDR *xdrs, WinsConfigInfo *objp)
{

	 if (!xdr_TypedIpAddress (xdrs, &objp->primary))
		 return FALSE;
	 if (!xdr_TypedIpAddress (xdrs, &objp->secondary))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_InetCidrRouteType (XDR *xdrs, InetCidrRouteType *objp)
{

	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_InetCidrRouteEntry (XDR *xdrs, InetCidrRouteEntry *objp)
{

	 if (!xdr_TypedIpAddress (xdrs, &objp->inetCidrRouteDest))
		 return FALSE;
	 if (!xdr_InetAddressPrefixLength (xdrs, &objp->inetCidrRoutePfxLen))
		 return FALSE;
	 if (!xdr_pointer (xdrs, (char **)&objp->inetCidrRouteNextHop, sizeof (TypedIpAddress), (xdrproc_t) xdr_TypedIpAddress))
		 return FALSE;
	 if (!xdr_uint32 (xdrs, &objp->inetCidrRouteIfIndex))
		 return FALSE;
	 if (!xdr_InetCidrRouteType (xdrs, &objp->inetCidrRouteType))
		 return FALSE;
	 if (!xdr_uint32 (xdrs, &objp->inetCidrRouteMetric))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_DhcpConfigInfo (XDR *xdrs, DhcpConfigInfo *objp)
{

	 if (!xdr_bool (xdrs, &objp->enabled))
		 return FALSE;
	 if (!xdr_string (xdrs, &objp->dhcpSettings, DHCP_MAX_CONFIG_SIZE))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_GuestNicV3 (XDR *xdrs, GuestNicV3 *objp)
{

	 if (!xdr_string (xdrs, &objp->macAddress, NICINFO_MAC_LEN))
		 return FALSE;
	 if (!xdr_array (xdrs, (char **)&objp->ips.ips_val, (u_int *) &objp->ips.ips_len, NICINFO_MAX_IPS,
		sizeof (IpAddressEntry), (xdrproc_t) xdr_IpAddressEntry))
		 return FALSE;
	 if (!xdr_pointer (xdrs, (char **)&objp->dnsConfigInfo, sizeof (DnsConfigInfo), (xdrproc_t) xdr_DnsConfigInfo))
		 return FALSE;
	 if (!xdr_pointer (xdrs, (char **)&objp->winsConfigInfo, sizeof (WinsConfigInfo), (xdrproc_t) xdr_WinsConfigInfo))
		 return FALSE;
	 if (!xdr_pointer (xdrs, (char **)&objp->dhcpConfigInfov4, sizeof (DhcpConfigInfo), (xdrproc_t) xdr_DhcpConfigInfo))
		 return FALSE;
	 if (!xdr_pointer (xdrs, (char **)&objp->dhcpConfigInfov6, sizeof (DhcpConfigInfo), (xdrproc_t) xdr_DhcpConfigInfo))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_NicInfoV3 (XDR *xdrs, NicInfoV3 *objp)
{

	 if (!xdr_array (xdrs, (char **)&objp->nics.nics_val, (u_int *) &objp->nics.nics_len, NICINFO_MAX_NICS,
		sizeof (GuestNicV3), (xdrproc_t) xdr_GuestNicV3))
		 return FALSE;
	 if (!xdr_array (xdrs, (char **)&objp->routes.routes_val, (u_int *) &objp->routes.routes_len, NICINFO_MAX_ROUTES,
		sizeof (InetCidrRouteEntry), (xdrproc_t) xdr_InetCidrRouteEntry))
		 return FALSE;
	 if (!xdr_pointer (xdrs, (char **)&objp->dnsConfigInfo, sizeof (DnsConfigInfo), (xdrproc_t) xdr_DnsConfigInfo))
		 return FALSE;
	 if (!xdr_pointer (xdrs, (char **)&objp->winsConfigInfo, sizeof (WinsConfigInfo), (xdrproc_t) xdr_WinsConfigInfo))
		 return FALSE;
	 if (!xdr_pointer (xdrs, (char **)&objp->dhcpConfigInfov4, sizeof (DhcpConfigInfo), (xdrproc_t) xdr_DhcpConfigInfo))
		 return FALSE;
	 if (!xdr_pointer (xdrs, (char **)&objp->dhcpConfigInfov6, sizeof (DhcpConfigInfo), (xdrproc_t) xdr_DhcpConfigInfo))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_GuestNicProto (XDR *xdrs, GuestNicProto *objp)
{

	 if (!xdr_NicInfoVersion (xdrs, &objp->ver))
		 return FALSE;
	switch (objp->ver) {
	case NIC_INFO_V2:
		 if (!xdr_pointer (xdrs, (char **)&objp->GuestNicProto_u.nicsV2, sizeof (GuestNicList), (xdrproc_t) xdr_GuestNicList))
			 return FALSE;
		break;
	case NIC_INFO_V3:
		 if (!xdr_pointer (xdrs, (char **)&objp->GuestNicProto_u.nicInfoV3, sizeof (NicInfoV3), (xdrproc_t) xdr_NicInfoV3))
			 return FALSE;
		break;
	default:
		return FALSE;
	}
	return TRUE;
}
