lx_proc.h revision 67dbe2be0c0f1e2eb428b89088bb5667e8f0b9f6
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _LXPROC_H
#define _LXPROC_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* lxproc.h: declarations, data structures and macros for lxprocfs
*/
#include <sys/pathname.h>
#include <sys/sysmacros.h>
/*
* Convert a vnode into an lxpr_mnt_t
*/
/*
* convert a vnode into an lxpr_node
*/
/*
* convert a lxprnode into a vnode
*/
/*
* convert a lxpr_node into zone for fs
*/
/*
* Pretend that a directory entry takes 16 bytes
*/
#define LXPR_SDSIZE 16
/*
* (directories and files contained therein).
*/
typedef enum lxpr_nodetype {
LXPR_PROCDIR, /* /proc */
LXPR_PIDDIR, /* /proc/<pid> */
LXPR_PID_CMDLINE, /* /proc/<pid>/cmdline */
LXPR_PID_CPU, /* /proc/<pid>/cpu */
LXPR_PID_CURDIR, /* /proc/<pid>/cwd */
LXPR_PID_ENV, /* /proc/<pid>/environ */
LXPR_PID_EXE, /* /proc/<pid>/exe */
LXPR_PID_MAPS, /* /proc/<pid>/maps */
LXPR_PID_MEM, /* /proc/<pid>/mem */
LXPR_PID_ROOTDIR, /* /proc/<pid>/root */
LXPR_PID_STAT, /* /proc/<pid>/stat */
LXPR_PID_STATM, /* /proc/<pid>/statm */
LXPR_PID_STATUS, /* /proc/<pid>/status */
LXPR_PID_FDDIR, /* /proc/<pid>/fd */
LXPR_PID_FD_FD, /* /proc/<pid>/fd/nn */
LXPR_CMDLINE, /* /proc/cmdline */
LXPR_CPUINFO, /* /proc/cpuinfo */
LXPR_DEVICES, /* /proc/devices */
LXPR_FILESYSTEMS, /* /proc/filesystems */
LXPR_INTERRUPTS, /* /proc/interrupts */
LXPR_IOPORTS, /* /proc/ioports */
LXPR_KCORE, /* /proc/kcore */
LXPR_LOADAVG, /* /proc/loadavg */
LXPR_MEMINFO, /* /proc/meminfo */
LXPR_MOUNTS, /* /proc/mounts */
LXPR_NETDIR, /* /proc/net */
LXPR_NET_ARP, /* /proc/net/arp */
LXPR_NET_DEV, /* /proc/net/dev */
LXPR_NET_DEV_MCAST, /* /proc/net/dev_mcast */
LXPR_NET_IGMP, /* /proc/net/igmp */
LXPR_NET_IP_MR_CACHE, /* /proc/net/ip_mr_cache */
LXPR_NET_IP_MR_VIF, /* /proc/net/ip_mr_vif */
LXPR_NET_MCFILTER, /* /proc/net/mcfilter */
LXPR_NET_NETSTAT, /* /proc/net/netstat */
LXPR_NET_RAW, /* /proc/net/raw */
LXPR_NET_ROUTE, /* /proc/net/route */
LXPR_NET_RPC, /* /proc/net/rpc */
LXPR_NET_RT_CACHE, /* /proc/net/rt_cache */
LXPR_NET_SOCKSTAT, /* /proc/net/sockstat */
LXPR_NET_SNMP, /* /proc/net/snmp */
LXPR_NET_STAT, /* /proc/net/stat */
LXPR_NET_TCP, /* /proc/net/tcp */
LXPR_NET_UDP, /* /proc/net/udp */
LXPR_NET_UNIX, /* /proc/net/unix */
LXPR_PARTITIONS, /* /proc/partitions */
LXPR_UPTIME, /* /proc/uptime */
LXPR_VERSION, /* /proc/version */
LXPR_NFILES /* number of lx /proc file types */
/*
* Number of fds allowed for in the inode number calculation
* per process (if a process has more fds then inode numbers
* may be duplicated)
*/
#define LXPR_FD_PERPROC 2000
/*
* external dirent characteristics
*/
#define LXPRMAXNAMELEN 14
typedef struct {
char d_name[LXPRMAXNAMELEN];
/*
* This is the lxprocfs private data object
* which is attached to v_data in the vnode structure
*/
typedef struct lxpr_node {
} lxpr_node_t;
struct zone; /* forward declaration */
/*
* This is the lxprocfs private data object
* which is attached to vfs_data in the vfs structure
*/
typedef struct lxpr_mnt {
} lxpr_mnt_t;
extern vnodeops_t *lxpr_vnodeops;
extern int nproc_highbit; /* highbit(v.v_nproc) */
extern void lxpr_initnodecache();
extern void lxpr_fininodecache();
extern void lxpr_freenode(lxpr_node_t *);
typedef struct lxpr_uiobuf lxpr_uiobuf_t;
extern void lxpr_uiobuf_free(lxpr_uiobuf_t *);
extern int lxpr_uiobuf_flush(lxpr_uiobuf_t *);
extern void lxpr_uiobuf_printf(lxpr_uiobuf_t *, const char *, ...);
extern void lxpr_uiobuf_seterr(lxpr_uiobuf_t *, int);
void lxpr_unlock(proc_t *);
#ifdef __cplusplus
}
#endif
#endif /* _LXPROC_H */