/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*-
 *
 * n4: A fast userspace NFSv4 server.
 * $Id: tostr.c,v 1.1 2001/05/30 06:04:59 mbp Exp $
 * 
 * Copyright (C) 2001 by Martin Pool <mbp@samba.org>
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 2.1 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
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <includes.h>


/* Convert internal structures and enumerations to strings.
 * Eventually this ought to be autogenerated. */


MKPROTO const char * n4xdr_str_rpc_msg_type(enum rpc_msg_type val)
{
    switch (val) {
    case RPC_CALL:
        return "RPC_CALL";
    case RPC_REPLY:
        return "RPC_REPLY";
    default:
        return "*UNKNOWN*";
    }
}


MKPROTO const char * n4xdr_str_rpc_reply_stat(enum rpc_reply_stat val)
{
    switch (val) {
    case RPC_MSG_ACCEPTED:
        return "RPC_MSG_ACCEPTED";
    case RPC_MSG_DENIED:
        return "RPC_MSG_DENIED";
    default:
        return "*UNKNOWN rpc_reply_stat*";
    }
}


MKPROTO const char * n4xdr_str_rpc_accept_stat(enum rpc_accept_stat val)
{
    switch (val) {
    case RPC_SUCCESS: return "RPC_SUCCESS";       
    case RPC_PROG_UNAVAIL: return "RPC_PROG_UNAVAIL";  
    case RPC_PROG_MISMATCH: return "RPC_PROG_MISMATCH"; 
    case RPC_PROC_UNAVAIL: return "RPC_PROC_UNAVAIL";  
    case RPC_GARBAGE_ARGS: return "RPC_GARBAGE_ARGS";  
    case RPC_SYSTEM_ERR: return "RPC_SYSTEM_ERR";
    default: return "*UNKNOWN rpc_accept_stat*";
    }
}
