/*
 * @(#)HostInfo.java
 *
 * Copyright (c) 2001-2002 JScape
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JScape. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JScape.
 */

package com.jscape.inet.dns.record;


import com.jscape.inet.dns.DnsInputStream;

import java.io.IOException;


/**
 * HostInfo records are used to acquire general information about a host.  The
 * main use is for protocols such as FTP that can use special procedures
 * when talking between machines or operating systems of the same type.
 */
public class HostInfo
        extends DnsRecord {
    private String cpu;
    private String os;

    protected void decode(DnsInputStream inputStream)
            throws IOException {
        cpu = inputStream.readString();
        os = inputStream.readString();
    }

    /**
     * Gets CPU information for host.
     * A character-string which specifies the CPU type.
     *
     * @return cpu description
     */
    public String getCPUInfo() {
        return cpu;
    }

    /**
     * Gets operating system (OS) information for host.
     * A character-string which specifies the operating system type.
     *
     * @return os description
     */
    public String getOSInfo() {
        return os;
    }

    /**
     * Gets String representation of this record.
     *
     * @return String
     */
    public String toString() {
        return getRecordName() + "\tOS = " + os + ", CPU = " + cpu;
    }
}

