Logo Search packages:      
Sourcecode: libnl version File versions  Download package

types.h

/*
 * netlink/netlink-types.h    Netlink Types
 *
 *    This library 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 version 2.1
 *    of the License.
 *
 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
 */

#ifndef __NETLINK_TYPES_H_
#define __NETLINK_TYPES_H_

#include <stdio.h>

/**
 * Dumping types (dp_type)
 * @ingroup utils
 */
00021 enum nl_dump_type {
00022       NL_DUMP_BRIEF,          /**< Dump object in a brief one-liner */
00023       NL_DUMP_FULL,           /**< Dump all attributes but no statistics */
00024       NL_DUMP_STATS,          /**< Dump all attributes including statistics */
00025       NL_DUMP_XML,            /**< Dump all attribtes in XML format */
00026       NL_DUMP_ENV,            /**< Dump all attribtues as env variables */
00027       NL_DUMP_EVENTS,         /**< Dump event */
      __NL_DUMP_MAX,
};
#define NL_DUMP_MAX (__NL_DUMP_MAX - 1)

/**
 * Dumping parameters
 * @ingroup utils
 */
00036 struct nl_dump_params
{
      /**
       * Specifies the type of dump that is requested.
       */
00041       enum nl_dump_type dp_type;

      /**
       * Specifies the number of whitespaces to be put in front
       * of every new line (indentation).
       */
00047       int               dp_prefix;

      /**
       * Causes the cache index to be printed for each element.
       */
00052       int               dp_print_index;

      /**
       * Causes each element to be prefixed with the message type.
       */
00057       int               dp_dump_msgtype;

      /**
       * A callback invoked for output
       *
       * Passed arguments are:
       *  - dumping parameters
       *  - string to append to the output
       */
00066       void              (*dp_cb)(struct nl_dump_params *, char *);

      /**
       * A callback invoked for every new line, can be used to
       * customize the indentation.
       *
       * Passed arguments are:
       *  - dumping parameters
       *  - line number starting from 0
       */
00076       void              (*dp_nl_cb)(struct nl_dump_params *, int);

      /**
       * User data pointer, can be used to pass data to callbacks.
       */
00081       void              *dp_data;

      /**
       * File descriptor the dumping output should go to
       */
00086       FILE *                  dp_fd;

      /**
       * Alternatively the output may be redirected into a buffer
       */
00091       char *                  dp_buf;

      /**
       * Length of the buffer dp_buf
       */
00096       size_t                  dp_buflen;

      /**
       * PRIVATE
       * Set if a dump was performed prior to the actual dump handler.
       */
00102       int               dp_pre_dump;
};

#endif

Generated by  Doxygen 1.6.0   Back to index