/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*-
 *
 * n4: A fast userspace NFSv4 server.
 * $Id: attrmap.c,v 1.3 2001/06/26 13:51:01 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.
 */

/**
 * \file attrmap.c Manage NFS4 attribute bitmaps.  These are used on
 * the READDIR and GETATTR calls to indicate which of the file's
 * attributes are of interest or available.  They're packed into a
 * variable-length bit vector.
 *
 * RFC3010 defines a fairly small set of mandatory and recommended
 * attributes, which are the only ones identified by name.  So for the
 * in-memory representation we simply allocate a fixed-length array.
 * When writing to the network, we write the minimum amount necessary
 * to represent the set bits.
 *
 * The last defined bit for this is 54 (FATTR4_TIME_MODIFY_SET), so we
 * can pack everything into a uint64_t.  Sweet!
 **/

#include "includes.h"

n4err n4fattr_bitmap_unpack(struct n4inbuf *inb)
{
    int n_words;

    CHECK_ERR(n4inbuf_need(inb, 1));
    n_words = FROM_NET(UNPACK(inb));

    n4trace("read %d word attribute bitmap", n_words);

    // So, our idea is that it should be 64 bits.  I wonder what we do
    // if they sent much more data than we expected?

    return N4OK;
}
