Matty
2006-Jun-01 21:12 UTC
[dtrace-discuss] Errors generating header file for inclusion in script
Howdy, I am trying to generate a header file to use with DTrace, and thought the following should work: $ cat ick.c sip_msg h; $ /usr/sfw/bin/cpp ick.c > openser.h When I attempt to include openser.h in my DTrace script, I am greeted with the following errors: $ dtrace -xcpppath=/usr/sfw/bin/cpp -C -s test.d <command line>:10:1: warning: "__STDC__" redefined dtrace: failed to compile script test.d: ".././parser/hf.h", line 137: syntax error near "str" Does anyone see anything wrong with what I am attempting to do? If the above steps are correct, does anyone happen to know how I can get openser.h (attached to this message) to work with DTrace? Thanks, - Ryan -- UNIX Administrator http://daemons.net/~matty -------------- next part -------------- # 1 "ick.c" # 1 "<built-in>" # 1 "<command line>" # 1 "ick.c" # 1 "msg_parser.h" 1 # 42 "msg_parser.h" # 1 "../str.h" 1 # 28 "../str.h" struct _str{ char* s; int len; }; typedef struct _str str; # 43 "msg_parser.h" 2 # 1 "../lump_struct.h" 1 # 39 "../lump_struct.h" # 1 ".././parser/hf.h" 1 # 33 ".././parser/hf.h" # 1 ".././parser/../str.h" 1 # 34 ".././parser/hf.h" 2 # 44 ".././parser/hf.h" enum _hdr_types_t { HDR_ERROR_T = -1 , HDR_OTHER_T = 0 , HDR_VIA_T = 1 , HDR_VIA1_T = 1 , HDR_VIA2_T = 2 , HDR_TO_T , HDR_FROM_T , HDR_CSEQ_T , HDR_CALLID_T , HDR_CONTACT_T , HDR_MAXFORWARDS_T , HDR_ROUTE_T , HDR_RECORDROUTE_T , HDR_CONTENTTYPE_T , HDR_CONTENTLENGTH_T , HDR_AUTHORIZATION_T , HDR_EXPIRES_T , HDR_PROXYAUTH_T , HDR_SUPPORTED_T , HDR_PROXYREQUIRE_T , HDR_UNSUPPORTED_T , HDR_ALLOW_T , HDR_EVENT_T , HDR_ACCEPT_T , HDR_ACCEPTLANGUAGE_T , HDR_ORGANIZATION_T , HDR_PRIORITY_T , HDR_SUBJECT_T , HDR_USERAGENT_T , HDR_ACCEPTDISPOSITION_T , HDR_CONTENTDISPOSITION_T , HDR_DIVERSION_T , HDR_RPID_T , HDR_REFER_TO_T , HDR_EOH_T }; typedef unsigned long long hdr_flags_t; # 130 ".././parser/hf.h" typedef enum _hdr_types_t hdr_types_t; struct hdr_field { hdr_types_t type; str name; str body; int len; void* parsed; struct hdr_field* next; }; static inline int hdr_allocs_parse(struct hdr_field* hdr) { switch(hdr->type){ case HDR_VIA_T: case HDR_TO_T: case HDR_FROM_T: case HDR_CONTACT_T: case HDR_ROUTE_T: case HDR_RECORDROUTE_T: case HDR_AUTHORIZATION_T: case HDR_EXPIRES_T: case HDR_PROXYAUTH_T: case HDR_EVENT_T: case HDR_ACCEPT_T: case HDR_CONTENTDISPOSITION_T: case HDR_DIVERSION_T: case HDR_RPID_T: case HDR_REFER_TO_T: return 1; default: return 0; } } void clean_hdr_field(struct hdr_field* hf); void free_hdr_field_lst(struct hdr_field* hf); void dump_hdr_field( struct hdr_field* hf ); # 40 "../lump_struct.h" 2 enum lump_op { LUMP_NOP=0, LUMP_DEL, LUMP_ADD, LUMP_ADD_SUBST, LUMP_ADD_OPT }; enum lump_subst{ SUBST_NOP=0, SUBST_RCV_IP, SUBST_SND_IP, SUBST_RCV_PORT, SUBST_SND_PORT, SUBST_RCV_PROTO, SUBST_SND_PROTO, SUBST_RCV_ALL, SUBST_SND_ALL }; # 57 "../lump_struct.h" enum lump_conditions { COND_FALSE, COND_TRUE, COND_IF_DIFF_REALMS, COND_IF_DIFF_AF, COND_IF_DIFF_PROTO, COND_IF_DIFF_PORT, COND_IF_DIFF_IP, COND_IF_RAND }; enum lump_flag { LUMPFLAG_NONE=0, LUMPFLAG_DUPED=1, LUMPFLAG_SHMEM=2 , LUMPFLAG_BRANCH=4}; struct lump{ enum _hdr_types_t type; enum lump_op op; union{ int offset; enum lump_subst subst; enum lump_conditions cond; char * value; }u; int len; struct lump* before; struct lump* after; struct lump* next; enum lump_flag flags; }; # 120 "../lump_struct.h" void free_lump(struct lump* l); void free_lump_list(struct lump* lump_list); # 44 "msg_parser.h" 2 # 1 "../flags.h" 1 # 28 "../flags.h" enum { FL_WHITE=1, FL_YELLOW, FL_GREEN, FL_RED, FL_BLUE, FL_MAGENTA, FL_BROWN, FL_BLACK, FL_ACC, FL_MAX }; typedef unsigned int flag_t; struct sip_msg; int setflag( struct sip_msg* msg, flag_t flag ); int resetflag( struct sip_msg* msg, flag_t flag ); int isflagset( struct sip_msg* msg, flag_t flag ); int flag_in_range( flag_t flag ); # 45 "msg_parser.h" 2 # 1 "../ip_addr.h" 1 # 32 "../ip_addr.h" # 1 "/usr/include/string.h" 1 3 4 # 16 "/usr/include/string.h" 3 4 #pragma ident "@(#)string.h 1.26 04/06/30 SMI" # 1 "/usr/include/iso/string_iso.h" 1 3 4 # 28 "/usr/include/iso/string_iso.h" 3 4 #pragma ident "@(#)string_iso.h 1.5 04/06/18 SMI" # 1 "/usr/include/sys/feature_tests.h" 1 3 4 # 9 "/usr/include/sys/feature_tests.h" 3 4 #pragma ident "@(#)feature_tests.h 1.24 04/09/28 SMI" # 1 "/usr/include/sys/ccompile.h" 1 3 4 # 9 "/usr/include/sys/ccompile.h" 3 4 #pragma ident "@(#)ccompile.h 1.2 04/11/08 SMI" # 12 "/usr/include/sys/feature_tests.h" 2 3 4 # 1 "/usr/include/sys/isa_defs.h" 1 3 4 # 9 "/usr/include/sys/isa_defs.h" 3 4 #pragma ident "@(#)isa_defs.h 1.27 04/10/01 SMI" # 13 "/usr/include/sys/feature_tests.h" 2 3 4 # 31 "/usr/include/iso/string_iso.h" 2 3 4 # 45 "/usr/include/iso/string_iso.h" 3 4 typedef unsigned int size_t; # 59 "/usr/include/iso/string_iso.h" 3 4 extern int memcmp(const void *, const void *, size_t); extern void *memcpy(void *, const void *, size_t); extern void *memmove(void *, const void *, size_t); extern void *memset(void *, int, size_t); extern char *strcat(char *, const char *); extern int strcmp(const char *, const char *); extern char *strcpy(char *, const char *); extern int strcoll(const char *, const char *); extern size_t strcspn(const char *, const char *); extern char *strerror(int); extern size_t strlen(const char *); extern char *strncat(char *, const char *, size_t); extern int strncmp(const char *, const char *, size_t); extern char *strncpy(char *, const char *, size_t); extern size_t strspn(const char *, const char *); extern char *strtok(char *, const char *); extern size_t strxfrm(char *, const char *, size_t); # 129 "/usr/include/iso/string_iso.h" 3 4 extern void *memchr(const void *, int, size_t); extern char *strchr(const char *, int); extern char *strpbrk(const char *, const char *); extern char *strrchr(const char *, int); extern char *strstr(const char *, const char *); # 19 "/usr/include/string.h" 2 3 4 # 59 "/usr/include/string.h" 3 4 extern int strerror_r(int, char *, size_t); extern char *strtok_r(char *, const char *, char **); extern void *memccpy(void *, const void *, int, size_t); extern char *strsignal(int); extern int ffs(int); extern int strcasecmp(const char *, const char *); extern int strncasecmp(const char *, const char *, size_t); extern size_t strlcpy(char *, const char *, size_t); extern size_t strlcat(char *, const char *, size_t); extern char *strdup(const char *); # 33 "../ip_addr.h" 2 # 1 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 1 3 4 # 25 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 #pragma ident "@(#)types.h 1.84 04/09/28 SMI" # 1 "/usr/include/sys/machtypes.h" 1 3 4 # 16 "/usr/include/sys/machtypes.h" 3 4 #pragma ident "@(#)machtypes.h 1.13 99/05/04 SMI" # 33 "/usr/include/sys/machtypes.h" 3 4 typedef struct _label_t { long val[2]; } label_t; typedef unsigned char lock_t; # 34 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 2 3 4 # 45 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 # 1 "/usr/include/sys/int_types.h" 1 3 4 # 9 "/usr/include/sys/int_types.h" 3 4 #pragma ident "@(#)int_types.h 1.10 04/09/28 SMI" # 54 "/usr/include/sys/int_types.h" 3 4 typedef char int8_t; typedef short int16_t; typedef int int32_t; typedef long long int64_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; typedef unsigned long long uint64_t; # 88 "/usr/include/sys/int_types.h" 3 4 typedef int64_t intmax_t; typedef uint64_t uintmax_t; # 104 "/usr/include/sys/int_types.h" 3 4 typedef int intptr_t; typedef unsigned int uintptr_t; typedef char int_fast8_t; typedef int int_fast16_t; typedef int int_fast32_t; typedef long long int_fast64_t; typedef unsigned char uint_fast8_t; typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; typedef unsigned long long uint_fast64_t; # 145 "/usr/include/sys/int_types.h" 3 4 typedef char int_least8_t; typedef short int_least16_t; typedef int int_least32_t; typedef long long int_least64_t; typedef unsigned char uint_least8_t; typedef unsigned short uint_least16_t; typedef unsigned int uint_least32_t; typedef unsigned long long uint_least64_t; # 46 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 2 3 4 # 62 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef long long longlong_t; typedef unsigned long long u_longlong_t; # 85 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef long t_scalar_t; typedef unsigned long t_uscalar_t; typedef unsigned char uchar_t; typedef unsigned short ushort_t; typedef unsigned int uint_t; typedef unsigned long ulong_t; typedef char *caddr_t; typedef long daddr_t; typedef short cnt_t; # 112 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef int ptrdiff_t; # 121 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef ulong_t pfn_t; typedef ulong_t pgcnt_t; typedef long spgcnt_t; typedef uchar_t use_t; typedef short sysid_t; typedef short index_t; typedef void *timeout_id_t; typedef void *bufcall_id_t; # 143 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef long off_t; # 152 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef longlong_t off64_t; typedef ulong_t ino_t; typedef long blkcnt_t; typedef ulong_t fsblkcnt_t; typedef ulong_t fsfilcnt_t; # 177 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef u_longlong_t ino64_t; typedef longlong_t blkcnt64_t; typedef u_longlong_t fsblkcnt64_t; typedef u_longlong_t fsfilcnt64_t; typedef long blksize_t; typedef enum { B_FALSE, B_TRUE } boolean_t; # 209 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef int64_t pad64_t; typedef uint64_t upad64_t; # 223 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef union { long double _q; int32_t _l[4]; } pad128_t; typedef union { long double _q; uint32_t _l[4]; } upad128_t; typedef longlong_t offset_t; typedef u_longlong_t u_offset_t; typedef u_longlong_t len_t; typedef u_longlong_t diskaddr_t; # 257 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef union { offset_t _f; struct { int32_t _u; int32_t _l; } _p; } lloff_t; # 277 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef union { longlong_t _f; struct { int32_t _u; int32_t _l; } _p; } lldaddr_t; typedef uint_t k_fltset_t; # 300 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef long id_t; typedef uint_t useconds_t; typedef long suseconds_t; # 321 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef ulong_t major_t; typedef ulong_t minor_t; typedef short pri_t; typedef ushort_t cpu_flag_t; # 347 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef ushort_t o_mode_t; typedef short o_dev_t; typedef ushort_t o_uid_t; typedef o_uid_t o_gid_t; typedef short o_nlink_t; typedef short o_pid_t; typedef ushort_t o_ino_t; typedef int key_t; typedef ulong_t mode_t; typedef long uid_t; typedef uid_t gid_t; typedef id_t taskid_t; typedef id_t projid_t; typedef id_t poolid_t; typedef id_t zoneid_t; typedef id_t ctid_t; typedef uint_t pthread_t; typedef uint_t pthread_key_t; typedef struct _pthread_mutex { struct { uint16_t __pthread_mutex_flag1; uint8_t __pthread_mutex_flag2; uint8_t __pthread_mutex_ceiling; uint16_t __pthread_mutex_type; uint16_t __pthread_mutex_magic; } __pthread_mutex_flags; union { struct { uint8_t __pthread_mutex_pad[8]; } __pthread_mutex_lock64; struct { uint32_t __pthread_ownerpid; uint32_t __pthread_lockword; } __pthread_mutex_lock32; upad64_t __pthread_mutex_owner64; } __pthread_mutex_lock; upad64_t __pthread_mutex_data; } pthread_mutex_t; typedef struct _pthread_cond { struct { uint8_t __pthread_cond_flag[4]; uint16_t __pthread_cond_type; uint16_t __pthread_cond_magic; } __pthread_cond_flags; upad64_t __pthread_cond_data; } pthread_cond_t; typedef struct _pthread_rwlock { int32_t __pthread_rwlock_readers; uint16_t __pthread_rwlock_type; uint16_t __pthread_rwlock_magic; pthread_mutex_t __pthread_rwlock_mutex; pthread_cond_t __pthread_rwlock_readercv; pthread_cond_t __pthread_rwlock_writercv; } pthread_rwlock_t; typedef struct { uint32_t __pthread_barrier_count; uint32_t __pthread_barrier_current; upad64_t __pthread_barrier_cycle; upad64_t __pthread_barrier_reserved; pthread_mutex_t __pthread_barrier_lock; pthread_cond_t __pthread_barrier_cond; } pthread_barrier_t; typedef pthread_mutex_t pthread_spinlock_t; typedef struct _pthread_attr { void *__pthread_attrp; } pthread_attr_t; typedef struct _pthread_mutexattr { void *__pthread_mutexattrp; } pthread_mutexattr_t; typedef struct _pthread_condattr { void *__pthread_condattrp; } pthread_condattr_t; typedef struct _once { upad64_t __pthread_once_pad[4]; } pthread_once_t; typedef struct _pthread_rwlockattr { void *__pthread_rwlockattrp; } pthread_rwlockattr_t; typedef struct { void *__pthread_barrierattrp; } pthread_barrierattr_t; typedef ulong_t dev_t; typedef ulong_t nlink_t; typedef long pid_t; # 529 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef int ssize_t; typedef long time_t; typedef long clock_t; typedef int clockid_t; typedef int timer_t; typedef unsigned char unchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; # 610 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 3 4 typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; typedef unsigned long u_long; typedef struct _quad { int val[2]; } quad_t; typedef quad_t quad; # 1 "/usr/include/sys/select.h" 1 3 4 # 15 "/usr/include/sys/select.h" 3 4 #pragma ident "@(#)select.h 1.19 04/01/28 SMI" # 1 "/usr/include/sys/time_impl.h" 1 3 4 # 19 "/usr/include/sys/time_impl.h" 3 4 #pragma ident "@(#)time_impl.h 1.11 05/05/19 SMI" # 38 "/usr/include/sys/time_impl.h" 3 4 typedef struct timespec { time_t tv_sec; long tv_nsec; } timespec_t; # 62 "/usr/include/sys/time_impl.h" 3 4 typedef struct timespec timestruc_t; # 76 "/usr/include/sys/time_impl.h" 3 4 typedef struct itimerspec { struct timespec it_interval; struct timespec it_value; } itimerspec_t; # 22 "/usr/include/sys/select.h" 2 3 4 # 1 "/usr/include/sys/time.h" 1 3 4 # 22 "/usr/include/sys/time.h" 3 4 #pragma ident "@(#)time.h 2.76 05/06/14 SMI" # 49 "/usr/include/sys/time.h" 3 4 struct timeval { time_t tv_sec; suseconds_t tv_usec; }; # 81 "/usr/include/sys/time.h" 3 4 struct timezone { int tz_minuteswest; int tz_dsttime; }; # 99 "/usr/include/sys/time.h" 3 4 # 1 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 1 3 4 # 100 "/usr/include/sys/time.h" 2 3 4 # 150 "/usr/include/sys/time.h" 3 4 struct itimerval { struct timeval it_interval; struct timeval it_value; }; # 197 "/usr/include/sys/time.h" 3 4 typedef longlong_t hrtime_t; # 321 "/usr/include/sys/time.h" 3 4 int adjtime(struct timeval *, struct timeval *); # 330 "/usr/include/sys/time.h" 3 4 int futimesat(int, const char *, const struct timeval *); # 341 "/usr/include/sys/time.h" 3 4 int getitimer(int, struct itimerval *); int utimes(const char *, const struct timeval *); int setitimer(int, struct itimerval *, struct itimerval *); # 379 "/usr/include/sys/time.h" 3 4 int settimeofday(struct timeval *, void *); hrtime_t gethrtime(void); hrtime_t gethrvtime(void); # 398 "/usr/include/sys/time.h" 3 4 int gettimeofday(struct timeval *, void *); # 418 "/usr/include/sys/time.h" 3 4 # 1 "/usr/include/time.h" 1 3 4 # 16 "/usr/include/time.h" 3 4 #pragma ident "@(#)time.h 1.44 04/09/28 SMI" # 1 "/usr/include/iso/time_iso.h" 1 3 4 # 28 "/usr/include/iso/time_iso.h" 3 4 #pragma ident "@(#)time_iso.h 1.4 04/09/07 SMI" # 69 "/usr/include/iso/time_iso.h" 3 4 struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; extern char *asctime(const struct tm *); extern clock_t clock(void); extern char *ctime(const time_t *); extern double difftime(time_t, time_t); extern struct tm *gmtime(const time_t *); extern struct tm *localtime(const time_t *); extern time_t mktime(struct tm *); extern time_t time(time_t *); extern size_t strftime(char *, size_t, const char *, const struct tm *); # 20 "/usr/include/time.h" 2 3 4 # 65 "/usr/include/time.h" 3 4 extern struct tm *gmtime_r(const time_t *, struct tm *); extern struct tm *localtime_r(const time_t *, struct tm *); # 83 "/usr/include/time.h" 3 4 extern char *strptime(const char *, const char *, struct tm *); # 103 "/usr/include/time.h" 3 4 union sigval { int sival_int; void *sival_ptr; }; struct sigevent { int sigev_notify; int sigev_signo; union sigval sigev_value; void (*sigev_notify_function)(union sigval); pthread_attr_t *sigev_notify_attributes; int __sigev_pad2; }; extern int clock_getres(clockid_t, struct timespec *); extern int clock_gettime(clockid_t, struct timespec *); extern int clock_settime(clockid_t, const struct timespec *); extern int timer_create(clockid_t, struct sigevent *, timer_t *); extern int timer_delete(timer_t); extern int timer_getoverrun(timer_t); extern int timer_gettime(timer_t, struct itimerspec *); extern int timer_settime(timer_t, int, const struct itimerspec *, struct itimerspec *); extern int nanosleep(const struct timespec *, struct timespec *); extern int clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *); extern void tzset(void); extern char *tzname[2]; extern long _sysconf(int); extern long timezone; extern int daylight; extern int cftime(char *, char *, const time_t *); extern int ascftime(char *, const char *, const struct tm *); extern long altzone; extern struct tm *getdate(const char *); extern int getdate_err; # 298 "/usr/include/time.h" 3 4 extern char *asctime_r(const struct tm *, char *, int); extern char *ctime_r(const time_t *, char *, int); # 419 "/usr/include/sys/time.h" 2 3 4 # 430 "/usr/include/sys/time.h" 3 4 # 1 "/usr/include/sys/select.h" 1 3 4 # 431 "/usr/include/sys/time.h" 2 3 4 # 24 "/usr/include/sys/select.h" 2 3 4 # 44 "/usr/include/sys/select.h" 3 4 typedef struct { unsigned int __sigbits[4]; } sigset_t; # 88 "/usr/include/sys/select.h" 3 4 typedef long fd_mask; typedef long fds_mask; # 116 "/usr/include/sys/select.h" 3 4 typedef struct fd_set { long fds_bits[(((1024)+(((sizeof (fds_mask) * 8))-1))/((sizeof (fds_mask) * 8)))]; } fd_set; # 140 "/usr/include/sys/select.h" 3 4 extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); extern int pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *); # 623 "/usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/include/sys/types.h" 2 3 4 # 34 "../ip_addr.h" 2 # 1 "/usr/include/sys/socket.h" 1 3 4 # 16 "/usr/include/sys/socket.h" 3 4 #pragma ident "@(#)socket.h 1.74 05/08/02 SMI" # 38 "/usr/include/sys/socket.h" 3 4 # 1 "/usr/include/sys/uio.h" 1 3 4 # 16 "/usr/include/sys/uio.h" 3 4 #pragma ident "@(#)uio.h 1.32 04/03/23 SMI" # 39 "/usr/include/sys/uio.h" 3 4 typedef struct iovec { caddr_t iov_base; long iov_len; } iovec_t; # 64 "/usr/include/sys/uio.h" 3 4 typedef enum uio_seg { UIO_USERSPACE, UIO_SYSSPACE, UIO_USERISPACE } uio_seg_t; typedef struct uio { iovec_t *uio_iov; int uio_iovcnt; lloff_t _uio_offset; uio_seg_t uio_segflg; short uio_fmode; lloff_t _uio_limit; ssize_t uio_resid; } uio_t; # 93 "/usr/include/sys/uio.h" 3 4 typedef enum uio_rw { UIO_READ, UIO_WRITE } uio_rw_t; # 109 "/usr/include/sys/uio.h" 3 4 extern ssize_t readv(int, const struct iovec *, int); extern ssize_t writev(int, const struct iovec *, int); # 39 "/usr/include/sys/socket.h" 2 3 4 # 1 "/usr/include/sys/socket_impl.h" 1 3 4 # 36 "/usr/include/sys/socket_impl.h" 3 4 #pragma ident "@(#)socket_impl.h 1.1 05/08/02 SMI" typedef uint16_t sa_family_t; struct sockaddr { sa_family_t sa_family; char sa_data[14]; }; # 1 "/usr/include/sys/un.h" 1 3 4 # 34 "/usr/include/sys/un.h" 3 4 #pragma ident "@(#)un.h 1.11 02/10/02 SMI" # 48 "/usr/include/sys/un.h" 3 4 struct sockaddr_un { sa_family_t sun_family; char sun_path[108]; }; # 58 "/usr/include/sys/socket_impl.h" 2 3 4 # 1 "/usr/include/net/if_dl.h" 1 3 4 # 41 "/usr/include/net/if_dl.h" 3 4 #pragma ident "@(#)if_dl.h 1.10 03/05/21 SMI" # 69 "/usr/include/net/if_dl.h" 3 4 struct sockaddr_dl { ushort_t sdl_family; ushort_t sdl_index; uchar_t sdl_type; uchar_t sdl_nlen; uchar_t sdl_alen; uchar_t sdl_slen; char sdl_data[244]; }; extern char *_link_ntoa(const unsigned char *, char *, int, int); extern unsigned char *_link_aton(const char *, int *); # 59 "/usr/include/sys/socket_impl.h" 2 3 4 # 86 "/usr/include/sys/socket_impl.h" 3 4 typedef double sockaddr_maxalign_t; # 97 "/usr/include/sys/socket_impl.h" 3 4 struct sockaddr_storage { sa_family_t ss_family; char _ss_pad1[((sizeof (sockaddr_maxalign_t)) - sizeof (sa_family_t))]; sockaddr_maxalign_t _ss_align; char _ss_pad2[(256 - (sizeof (sa_family_t)+ ((sizeof (sockaddr_maxalign_t)) - sizeof (sa_family_t)) + (sizeof (sockaddr_maxalign_t))))]; }; # 41 "/usr/include/sys/socket.h" 2 3 4 # 1 "/usr/include/sys/netconfig.h" 1 3 4 # 16 "/usr/include/sys/netconfig.h" 3 4 #pragma ident "@(#)netconfig.h 1.24 04/02/27 SMI" # 25 "/usr/include/sys/netconfig.h" 3 4 struct netconfig { char *nc_netid; unsigned int nc_semantics; unsigned int nc_flag; char *nc_protofmly; char *nc_proto; char *nc_device; unsigned int nc_nlookups; char **nc_lookups; unsigned int nc_unused[8]; }; typedef struct { struct netconfig **nc_head; struct netconfig **nc_curr; } NCONF_HANDLE; # 124 "/usr/include/sys/netconfig.h" 3 4 extern void *setnetconfig(void); extern int endnetconfig(void *); extern struct netconfig *getnetconfig(void *); extern struct netconfig *getnetconfigent(const char *); extern void freenetconfigent(struct netconfig *); extern void *setnetpath(void); extern int endnetpath(void *); extern struct netconfig *getnetpath(void *); extern void nc_perror(const char *); extern char *nc_sperror(void); # 44 "/usr/include/sys/socket.h" 2 3 4 # 1 "/usr/include/netinet/in.h" 1 3 4 # 30 "/usr/include/netinet/in.h" 3 4 #pragma ident "@(#)in.h 1.49 05/08/02 SMI" # 54 "/usr/include/netinet/in.h" 3 4 typedef uint32_t socklen_t; typedef void *Psocklen_t; # 1 "/usr/include/sys/stream.h" 1 3 4 # 16 "/usr/include/sys/stream.h" 3 4 #pragma ident "@(#)stream.h 1.113 06/01/06 SMI" # 1 "/usr/include/sys/vnode.h" 1 3 4 # 37 "/usr/include/sys/vnode.h" 3 4 #pragma ident "@(#)vnode.h 1.123 05/05/17 SMI" # 1 "/usr/include/sys/t_lock.h" 1 3 4 # 15 "/usr/include/sys/t_lock.h" 3 4 #pragma ident "@(#)t_lock.h 1.45 98/02/01 SMI" # 1 "/usr/include/sys/machlock.h" 1 3 4 # 9 "/usr/include/sys/machlock.h" 3 4 #pragma ident "@(#)machlock.h 1.25 03/09/02 SMI" # 37 "/usr/include/sys/machlock.h" 3 4 typedef lock_t disp_lock_t; # 56 "/usr/include/sys/machlock.h" 3 4 extern int hres_lock; # 19 "/usr/include/sys/t_lock.h" 2 3 4 # 1 "/usr/include/sys/param.h" 1 3 4 # 37 "/usr/include/sys/param.h" 3 4 #pragma ident "@(#)param.h 1.82 06/01/30 SMI" # 438 "/usr/include/sys/param.h" 3 4 # 1 "/usr/include/sys/unistd.h" 1 3 4 # 24 "/usr/include/sys/unistd.h" 3 4 #pragma ident "@(#)unistd.h 1.42 04/09/10 SMI" # 439 "/usr/include/sys/param.h" 2 3 4 extern long _sysconf(int); # 20 "/usr/include/sys/t_lock.h" 2 3 4 # 1 "/usr/include/sys/mutex.h" 1 3 4 # 9 "/usr/include/sys/mutex.h" 3 4 #pragma ident "@(#)mutex.h 1.20 98/02/01 SMI" # 39 "/usr/include/sys/mutex.h" 3 4 typedef enum { MUTEX_ADAPTIVE = 0, MUTEX_SPIN = 1, MUTEX_DRIVER = 4, MUTEX_DEFAULT = 6 } kmutex_type_t; typedef struct mutex { void *_opaque[2]; } kmutex_t; # 21 "/usr/include/sys/t_lock.h" 2 3 4 # 1 "/usr/include/sys/rwlock.h" 1 3 4 # 9 "/usr/include/sys/rwlock.h" 3 4 #pragma ident "@(#)rwlock.h 1.9 98/02/18 SMI" # 23 "/usr/include/sys/rwlock.h" 3 4 typedef enum { RW_DRIVER = 2, RW_DEFAULT = 4 } krw_type_t; typedef enum { RW_WRITER, RW_READER } krw_t; typedef struct _krwlock { void *_opaque[1]; } krwlock_t; # 22 "/usr/include/sys/t_lock.h" 2 3 4 # 1 "/usr/include/sys/semaphore.h" 1 3 4 # 9 "/usr/include/sys/semaphore.h" 3 4 #pragma ident "@(#)semaphore.h 1.5 98/02/01 SMI" # 25 "/usr/include/sys/semaphore.h" 3 4 typedef enum { SEMA_DEFAULT, SEMA_DRIVER } ksema_type_t; typedef struct _ksema { void * _opaque[2]; } ksema_t; # 23 "/usr/include/sys/t_lock.h" 2 3 4 # 1 "/usr/include/sys/condvar.h" 1 3 4 # 17 "/usr/include/sys/condvar.h" 3 4 #pragma ident "@(#)condvar.h 1.14 04/10/21 SMI" # 37 "/usr/include/sys/condvar.h" 3 4 typedef struct _kcondvar { ushort_t _opaque; } kcondvar_t; typedef enum { CV_DEFAULT, CV_DRIVER } kcv_type_t; # 24 "/usr/include/sys/t_lock.h" 2 3 4 # 41 "/usr/include/sys/vnode.h" 2 3 4 # 1 "/usr/include/sys/rwstlock.h" 1 3 4 # 9 "/usr/include/sys/rwstlock.h" 3 4 #pragma ident "@(#)rwstlock.h 1.4 04/11/09 SMI" # 21 "/usr/include/sys/rwstlock.h" 3 4 # 1 "/usr/include/sys/ksynch.h" 1 3 4 # 12 "/usr/include/sys/ksynch.h" 3 4 #pragma ident "@(#)ksynch.h 1.6 97/10/22 SMI" # 22 "/usr/include/sys/rwstlock.h" 2 3 4 typedef struct rwstlock { intptr_t rwst_count; kcondvar_t rwst_rcv; kcondvar_t rwst_wcv; kmutex_t rwst_lock; } rwstlock_t; # 57 "/usr/include/sys/rwstlock.h" 3 4 extern void rwst_enter(rwstlock_t *, krw_t); extern int rwst_enter_sig(rwstlock_t *, krw_t); extern void rwst_exit(rwstlock_t *); extern void rwst_init(rwstlock_t *, char *, krw_type_t, void *); extern void rwst_destroy(rwstlock_t *); extern int rwst_lock_held(rwstlock_t *, krw_t); extern int rwst_tryenter(rwstlock_t *, krw_t); # 42 "/usr/include/sys/vnode.h" 2 3 4 # 1 "/usr/include/sys/cred.h" 1 3 4 # 36 "/usr/include/sys/cred.h" 3 4 #pragma ident "@(#)cred.h 1.26 04/07/13 SMI" # 49 "/usr/include/sys/cred.h" 3 4 typedef struct cred cred_t; # 44 "/usr/include/sys/vnode.h" 2 3 4 # 1 "/usr/include/sys/resource.h" 1 3 4 # 16 "/usr/include/sys/resource.h" 3 4 #pragma ident "@(#)resource.h 1.36 04/09/28 SMI" # 71 "/usr/include/sys/resource.h" 3 4 typedef unsigned long rlim_t; # 106 "/usr/include/sys/resource.h" 3 4 struct rlimit { rlim_t rlim_cur; rlim_t rlim_max; }; typedef u_longlong_t rlim64_t; struct rlimit64 { rlim64_t rlim_cur; rlim64_t rlim_max; }; # 145 "/usr/include/sys/resource.h" 3 4 struct rusage { struct timeval ru_utime; struct timeval ru_stime; long ru_maxrss; long ru_ixrss; long ru_idrss; long ru_isrss; long ru_minflt; long ru_majflt; long ru_nswap; long ru_inblock; long ru_oublock; long ru_msgsnd; long ru_msgrcv; long ru_nsignals; long ru_nvcsw; long ru_nivcsw; }; # 236 "/usr/include/sys/resource.h" 3 4 extern int setrlimit(int, const struct rlimit *); extern int getrlimit(int, struct rlimit *); extern int setrlimit64(int, const struct rlimit64 *); extern int getrlimit64(int, struct rlimit64 *); extern int getpriority(int, id_t); extern int setpriority(int, id_t, int); extern int getrusage(int, struct rusage *); # 46 "/usr/include/sys/vnode.h" 2 3 4 # 1 "/usr/include/vm/seg_enum.h" 1 3 4 # 37 "/usr/include/vm/seg_enum.h" 3 4 #pragma ident "@(#)seg_enum.h 1.8 05/05/17 SMI" # 53 "/usr/include/vm/seg_enum.h" 3 4 enum fault_type { F_INVAL, F_PROT, F_SOFTLOCK, F_SOFTUNLOCK }; enum lock_type { L_PAGELOCK, L_PAGEUNLOCK, L_PAGERECLAIM }; enum seg_rw { S_OTHER, S_READ, S_WRITE, S_EXEC, S_CREATE, S_READ_NOCOW }; # 47 "/usr/include/sys/vnode.h" 2 3 4 # 56 "/usr/include/sys/vnode.h" 3 4 typedef int (*fs_generic_func_p) (); # 65 "/usr/include/sys/vnode.h" 3 4 typedef struct fs_operation_def { char *name; fs_generic_func_p func; } fs_operation_def_t; # 82 "/usr/include/sys/vnode.h" 3 4 typedef struct fs_operation_trans_def { char *name; int offset; fs_generic_func_p defaultFunc; fs_generic_func_p errorFunc; } fs_operation_trans_def_t; # 122 "/usr/include/sys/vnode.h" 3 4 typedef enum vtype { VNON = 0, VREG = 1, VDIR = 2, VBLK = 3, VCHR = 4, VLNK = 5, VFIFO = 6, VDOOR = 7, VPROC = 8, VSOCK = 9, VPORT = 10, VBAD = 11 } vtype_t; # 178 "/usr/include/sys/vnode.h" 3 4 struct fem_head; typedef struct vnode { kmutex_t v_lock; uint_t v_flag; uint_t v_count; void *v_data; struct vfs *v_vfsp; struct stdata *v_stream; enum vtype v_type; dev_t v_rdev; struct vfs *v_vfsmountedhere; struct vnodeops *v_op; struct page *v_pages; pgcnt_t v_npages; pgcnt_t v_msnpages; struct page *v_scanfront; struct page *v_scanback; struct filock *v_filocks; struct shrlocklist *v_shrlocks; krwlock_t v_nbllock; kcondvar_t v_cv; void *v_locality; struct fem_head *v_femhead; char *v_path; uint_t v_rdcnt; uint_t v_wrcnt; u_longlong_t v_mmap_read; u_longlong_t v_mmap_write; void *v_mpssdata; hrtime_t v_scantime; ushort_t v_mset; uint_t v_msflags; struct vnode *v_msnext; struct vnode *v_msprev; krwlock_t v_mslock; } vnode_t; # 236 "/usr/include/sys/vnode.h" 3 4 typedef struct vn_vfslocks_entry { rwstlock_t ve_lock; void *ve_vpvfs; struct vn_vfslocks_entry *ve_next; uint32_t ve_refcnt; char pad[64 - sizeof (rwstlock_t) - 2 * sizeof (void *) - sizeof (uint32_t)]; } vn_vfslocks_entry_t; # 302 "/usr/include/sys/vnode.h" 3 4 typedef struct vattr { uint_t va_mask; vtype_t va_type; mode_t va_mode; uid_t va_uid; gid_t va_gid; dev_t va_fsid; u_longlong_t va_nodeid; nlink_t va_nlink; u_offset_t va_size; timestruc_t va_atime; timestruc_t va_mtime; timestruc_t va_ctime; dev_t va_rdev; uint_t va_blksize; u_longlong_t va_nblocks; uint_t va_seq; } vattr_t; # 356 "/usr/include/sys/vnode.h" 3 4 typedef vattr_t vattr32_t; # 418 "/usr/include/sys/vnode.h" 3 4 enum rm { RMFILE, RMDIRECTORY }; enum symfollow { NO_FOLLOW, FOLLOW }; enum vcexcl { NONEXCL, EXCL }; enum create { CRCREAT, CRMKNOD, CRMKDIR }; typedef enum rm rm_t; typedef enum symfollow symfollow_t; typedef enum vcexcl vcexcl_t; typedef enum create create_t; typedef enum vnevent { VE_SUPPORT = 0, VE_RENAME_SRC = 1, VE_RENAME_DEST = 2, VE_REMOVE = 3, VE_RMDIR = 4 } vnevent_t; enum v_mode { V_READ, V_WRITE, V_RDORWR, V_RDANDWR }; typedef enum v_mode v_mode_t; # 451 "/usr/include/sys/vnode.h" 3 4 typedef struct vsecattr { uint_t vsa_mask; int vsa_aclcnt; void *vsa_aclentp; int vsa_dfaclcnt; void *vsa_dfaclentp; } vsecattr_t; # 477 "/usr/include/sys/vnode.h" 3 4 typedef struct caller_context { pid_t cc_pid; int cc_sysid; u_longlong_t cc_caller_id; } caller_context_t; struct pathname; struct fid; struct flock64; struct flk_callback; struct shrlock; struct page; struct seg; struct as; struct pollhead; typedef struct vnodeops { const char *vnop_name; int (*vop_open)(vnode_t **, int, cred_t *); int (*vop_close)(vnode_t *, int, int, offset_t, cred_t *); int (*vop_read)(vnode_t *, uio_t *, int, cred_t *, caller_context_t *); int (*vop_write)(vnode_t *, uio_t *, int, cred_t *, caller_context_t *); int (*vop_ioctl)(vnode_t *, int, intptr_t, int, cred_t *, int *); int (*vop_setfl)(vnode_t *, int, int, cred_t *); int (*vop_getattr)(vnode_t *, vattr_t *, int, cred_t *); int (*vop_setattr)(vnode_t *, vattr_t *, int, cred_t *, caller_context_t *); int (*vop_access)(vnode_t *, int, int, cred_t *); int (*vop_lookup)(vnode_t *, char *, vnode_t **, struct pathname *, int, vnode_t *, cred_t *); int (*vop_create)(vnode_t *, char *, vattr_t *, vcexcl_t, int, vnode_t **, cred_t *, int); int (*vop_remove)(vnode_t *, char *, cred_t *); int (*vop_link)(vnode_t *, vnode_t *, char *, cred_t *); int (*vop_rename)(vnode_t *, char *, vnode_t *, char *, cred_t *); int (*vop_mkdir)(vnode_t *, char *, vattr_t *, vnode_t **, cred_t *); int (*vop_rmdir)(vnode_t *, char *, vnode_t *, cred_t *); int (*vop_readdir)(vnode_t *, uio_t *, cred_t *, int *); int (*vop_symlink)(vnode_t *, char *, vattr_t *, char *, cred_t *); int (*vop_readlink)(vnode_t *, uio_t *, cred_t *); int (*vop_fsync)(vnode_t *, int, cred_t *); void (*vop_inactive)(vnode_t *, cred_t *); int (*vop_fid)(vnode_t *, struct fid *); int (*vop_rwlock)(vnode_t *, int, caller_context_t *); void (*vop_rwunlock)(vnode_t *, int, caller_context_t *); int (*vop_seek)(vnode_t *, offset_t, offset_t *); int (*vop_cmp)(vnode_t *, vnode_t *); int (*vop_frlock)(vnode_t *, int, struct flock64 *, int, offset_t, struct flk_callback *, cred_t *); int (*vop_space)(vnode_t *, int, struct flock64 *, int, offset_t, cred_t *, caller_context_t *); int (*vop_realvp)(vnode_t *, vnode_t **); int (*vop_getpage)(vnode_t *, offset_t, size_t, uint_t *, struct page **, size_t, struct seg *, caddr_t, enum seg_rw, cred_t *); int (*vop_putpage)(vnode_t *, offset_t, size_t, int, cred_t *); int (*vop_map)(vnode_t *, offset_t, struct as *, caddr_t *, size_t, uchar_t, uchar_t, uint_t, cred_t *); int (*vop_addmap)(vnode_t *, offset_t, struct as *, caddr_t, size_t, uchar_t, uchar_t, uint_t, cred_t *); int (*vop_delmap)(vnode_t *, offset_t, struct as *, caddr_t, size_t, uint_t, uint_t, uint_t, cred_t *); int (*vop_poll)(vnode_t *, short, int, short *, struct pollhead **); int (*vop_dump)(vnode_t *, caddr_t, int, int); int (*vop_pathconf)(vnode_t *, int, ulong_t *, cred_t *); int (*vop_pageio)(vnode_t *, struct page *, u_offset_t, size_t, int, cred_t *); int (*vop_dumpctl)(vnode_t *, int, int *); void (*vop_dispose)(vnode_t *, struct page *, int, int, cred_t *); int (*vop_setsecattr)(vnode_t *, vsecattr_t *, int, cred_t *); int (*vop_getsecattr)(vnode_t *, vsecattr_t *, int, cred_t *); int (*vop_shrlock)(vnode_t *, int, struct shrlock *, int, cred_t *); int (*vop_vnevent)(vnode_t *, vnevent_t); } vnodeops_t; # 23 "/usr/include/sys/stream.h" 2 3 4 # 1 "/usr/include/sys/poll.h" 1 3 4 # 16 "/usr/include/sys/poll.h" 3 4 #pragma ident "@(#)poll.h 1.28 98/11/23 SMI" # 26 "/usr/include/sys/poll.h" 3 4 typedef struct pollfd { int fd; short events; short revents; } pollfd_t; typedef unsigned long nfds_t; # 124 "/usr/include/sys/poll.h" 3 4 int poll(struct pollfd *, nfds_t, int); # 24 "/usr/include/sys/stream.h" 2 3 4 # 1 "/usr/include/sys/strmdep.h" 1 3 4 # 16 "/usr/include/sys/strmdep.h" 3 4 #pragma ident "@(#)strmdep.h 1.10 98/01/06 SMI" # 25 "/usr/include/sys/stream.h" 2 3 4 # 1 "/usr/include/sys/model.h" 1 3 4 # 9 "/usr/include/sys/model.h" 3 4 #pragma ident "@(#)model.h 1.24 04/09/28 SMI" # 54 "/usr/include/sys/model.h" 3 4 typedef unsigned int model_t; # 28 "/usr/include/sys/stream.h" 2 3 4 # 1 "/usr/include/sys/strft.h" 1 3 4 # 9 "/usr/include/sys/strft.h" 3 4 #pragma ident "@(#)strft.h 1.2 00/03/17 SMI" # 31 "/usr/include/sys/strft.h" 3 4 typedef hrtime_t tdelta_t [12][2]; typedef hrtime_t ts_t; extern ts_t _tstamp_c; # 213 "/usr/include/sys/strft.h" 3 4 struct ftevnt { ts_t ts; char *mid; ushort_t evnt; ushort_t data; }; struct ftblk { struct ftblk *nxt; int ix; struct ftevnt ev[0x9]; }; # 239 "/usr/include/sys/strft.h" 3 4 struct fthdr { struct ftblk *tail; unsigned hash; void *thread; int cpu_seqid; struct ftblk first; }; struct ftflwe { char *mid; ushort_t evnt; ushort_t data; tdelta_t td; }; struct ftflw { struct ftflw *nxt; int hash; int count; struct ftflwe ev[1]; }; typedef struct ftevnt ftevnt_t; typedef struct ftblk ftblk_t; typedef struct fthdr fthdr_t; typedef struct ftflwe ftflwe_t; typedef struct ftflw ftflw_t; typedef struct ftevents ftevents_t; # 29 "/usr/include/sys/stream.h" 2 3 4 # 67 "/usr/include/sys/stream.h" 3 4 typedef struct queue { struct qinit *q_qinfo; struct msgb *q_first; struct msgb *q_last; struct queue *q_next; struct queue *q_link; void *q_ptr; size_t q_count; uint_t q_flag; ssize_t q_minpsz; ssize_t q_maxpsz; size_t q_hiwat; size_t q_lowat; struct qband *q_bandp; kmutex_t q_lock; struct stdata *q_stream; struct syncq *q_syncq; unsigned char q_nband; kcondvar_t q_wait; kcondvar_t q_sync; struct queue *q_nfsrv; struct queue *q_nbsrv; ushort_t q_draining; short q_struiot; uint_t q_syncqmsgs; size_t q_mblkcnt; # 103 "/usr/include/sys/stream.h" 3 4 struct msgb *q_sqhead; struct msgb *q_sqtail; uint_t q_sqflags; size_t q_rwcnt; struct queue *q_sqnext; struct queue *q_sqprev; clock_t q_sqtstamp; clock_t q_qtstamp; pri_t q_spri; struct fmodsw_impl *q_fp; } queue_t; # 170 "/usr/include/sys/stream.h" 3 4 typedef struct qband { struct qband *qb_next; size_t qb_count; struct msgb *qb_first; struct msgb *qb_last; size_t qb_hiwat; size_t qb_lowat; uint_t qb_flag; size_t qb_mblkcnt; } qband_t; # 196 "/usr/include/sys/stream.h" 3 4 typedef enum qfields { QHIWAT = 0, QLOWAT = 1, QMAXPSZ = 2, QMINPSZ = 3, QCOUNT = 4, QFIRST = 5, QLAST = 6, QFLAG = 7, QSTRUIOT = 8, QBAD = 9 } qfields_t; struct module_info { ushort_t mi_idnum; char *mi_idname; ssize_t mi_minpsz; ssize_t mi_maxpsz; size_t mi_hiwat; size_t mi_lowat; }; struct qinit { int (*qi_putp)(); int (*qi_srvp)(); int (*qi_qopen)(); int (*qi_qclose)(); int (*qi_qadmin)(); struct module_info *qi_minfo; struct module_stat *qi_mstat; int (*qi_rwp)(); int (*qi_infop)(); int qi_struiot; }; # 249 "/usr/include/sys/stream.h" 3 4 struct streamtab { struct qinit *st_rdinit; struct qinit *st_wrinit; struct qinit *st_muxrinit; struct qinit *st_muxwinit; }; struct linkblk { queue_t *l_qtop; queue_t *l_qbot; int l_index; }; typedef struct free_rtn { void (*free_func)(); caddr_t free_arg; } frtn_t; # 284 "/usr/include/sys/stream.h" 3 4 typedef struct datab { frtn_t *db_frtnp; unsigned char *db_base; unsigned char *db_lim; unsigned char db_ref; unsigned char db_type; unsigned char db_flags; unsigned char db_struioflag; pid_t db_cpid; void *db_cache; struct msgb *db_mblk; void (*db_free)(struct msgb *, struct datab *); void (*db_lastfree)(struct msgb *, struct datab *); intptr_t db_cksumstart; intptr_t db_cksumend; intptr_t db_cksumstuff; union { double enforce_alignment; unsigned char data[8]; struct { union { uint32_t u32; uint16_t u16; } cksum_val; uint16_t flags; uint16_t pad; } cksum; } db_struioun; fthdr_t *db_fthdr; cred_t *db_credp; } dblk_t; # 332 "/usr/include/sys/stream.h" 3 4 typedef struct msgb { struct msgb *b_next; struct msgb *b_prev; struct msgb *b_cont; unsigned char *b_rptr; unsigned char *b_wptr; struct datab *b_datap; unsigned char b_band; unsigned char b_ftflag; unsigned short b_flag; queue_t *b_queue; } mblk_t; typedef struct bcache { kmutex_t mutex; struct kmem_cache *buffer_cache; struct kmem_cache *dblk_cache; int alloc; int destroy; size_t size; uint_t align; } bcache_t; # 452 "/usr/include/sys/stream.h" 3 4 struct iocblk { int ioc_cmd; cred_t *ioc_cr; uint_t ioc_id; size_t ioc_count; int ioc_error; int ioc_rval; int ioc_fill1; uint_t ioc_flag; int ioc_filler[2]; }; typedef struct iocblk *IOCP; # 495 "/usr/include/sys/stream.h" 3 4 struct copyreq { int cq_cmd; cred_t *cq_cr; uint_t cq_id; caddr_t cq_addr; size_t cq_size; uint_t cq_flag; mblk_t *cq_private; int cq_filler[4]; }; # 521 "/usr/include/sys/stream.h" 3 4 struct copyresp { int cp_cmd; cred_t *cp_cr; uint_t cp_id; caddr_t cp_rval; size_t cp_pad1; uint_t cp_pad2; mblk_t *cp_private; uint_t cp_flag; int cp_filler[3]; }; union ioctypes { struct iocblk iocblk; struct copyreq copyreq; struct copyresp copyresp; }; struct stroptions { uint_t so_flags; short so_readopt; ushort_t so_wroff; ssize_t so_minpsz; ssize_t so_maxpsz; size_t so_hiwat; size_t so_lowat; unsigned char so_band; ushort_t so_erropt; ssize_t so_maxblk; ushort_t so_copyopt; ushort_t so_tail; }; # 805 "/usr/include/sys/stream.h" 3 4 extern int nstrpush; # 67 "/usr/include/netinet/in.h" 2 3 4 # 1 "/usr/include/sys/byteorder.h" 1 3 4 # 16 "/usr/include/sys/byteorder.h" 3 4 #pragma ident "@(#)byteorder.h 1.18 04/09/28 SMI" # 74 "/usr/include/netinet/in.h" 2 3 4 typedef uint16_t in_port_t; # 94 "/usr/include/netinet/in.h" 3 4 typedef uint32_t in_addr_t; typedef uint32_t ipaddr_t; struct in6_addr { union { # 121 "/usr/include/netinet/in.h" 3 4 uint8_t _S6_u8[16]; uint32_t _S6_u32[4]; uint32_t __S6_align; } _S6_un; }; typedef struct in6_addr in6_addr_t; # 257 "/usr/include/netinet/in.h" 3 4 struct in_addr { union { struct { uint8_t s_b1, s_b2, s_b3, s_b4; } S_un_b; struct { uint16_t s_w1, s_w2; } S_un_w; uint32_t S_addr; } S_un; }; # 345 "/usr/include/netinet/in.h" 3 4 struct sockaddr_in { sa_family_t sin_family; in_port_t sin_port; struct in_addr sin_addr; char sin_zero[8]; }; struct sockaddr_in6 { sa_family_t sin6_family; in_port_t sin6_port; uint32_t sin6_flowinfo; struct in6_addr sin6_addr; uint32_t sin6_scope_id; uint32_t __sin6_src_id; }; # 825 "/usr/include/netinet/in.h" 3 4 typedef struct ipsec_req { uint_t ipsr_ah_req; uint_t ipsr_esp_req; uint_t ipsr_self_encap_req; uint8_t ipsr_auth_alg; uint8_t ipsr_esp_alg; uint8_t ipsr_esp_auth_alg; } ipsec_req_t; # 900 "/usr/include/netinet/in.h" 3 4 struct ip_mreq { struct in_addr imr_multiaddr; struct in_addr imr_interface; }; struct ip_mreq_source { struct in_addr imr_multiaddr; struct in_addr imr_sourceaddr; struct in_addr imr_interface; }; struct ipv6_mreq { struct in6_addr ipv6mr_multiaddr; unsigned int ipv6mr_interface; }; # 938 "/usr/include/netinet/in.h" 3 4 struct group_req { uint32_t gr_interface; struct sockaddr_storage gr_group; }; struct group_source_req { uint32_t gsr_interface; struct sockaddr_storage gsr_group; struct sockaddr_storage gsr_source; }; struct group_filter { uint32_t gf_interface; struct sockaddr_storage gf_group; uint32_t gf_fmode; uint32_t gf_numsrc; struct sockaddr_storage gf_slist[1]; }; # 975 "/usr/include/netinet/in.h" 3 4 struct ip_msfilter { struct in_addr imsf_multiaddr; struct in_addr imsf_interface; uint32_t imsf_fmode; uint32_t imsf_numsrc; struct in_addr imsf_slist[1]; }; # 991 "/usr/include/netinet/in.h" 3 4 int setsourcefilter(int, uint32_t, struct sockaddr *, socklen_t, uint32_t, uint_t, struct sockaddr_storage *); int getsourcefilter(int, uint32_t, struct sockaddr *, socklen_t, uint32_t *, uint_t *, struct sockaddr_storage *); int setipv4sourcefilter(int, struct in_addr, struct in_addr, uint32_t, uint32_t, struct in_addr *); int getipv4sourcefilter(int, struct in_addr, struct in_addr, uint32_t *, uint32_t *, struct in_addr *); # 1012 "/usr/include/netinet/in.h" 3 4 struct in6_pktinfo { struct in6_addr ipi6_addr; unsigned int ipi6_ifindex; }; struct ip6_mtuinfo { struct sockaddr_in6 ip6m_addr; uint32_t ip6m_mtu; }; extern socklen_t inet6_rth_space(int type, int segments); extern void *inet6_rth_init(void *bp, socklen_t bp_len, int type, int segments); extern int inet6_rth_add(void *bp, const struct in6_addr *addr); extern int inet6_rth_reverse(const void *in, void *out); extern int inet6_rth_segments(const void *bp); extern struct in6_addr *inet6_rth_getaddr(const void *bp, int index); extern int inet6_opt_init(void *extbuf, socklen_t extlen); extern int inet6_opt_append(void *extbuf, socklen_t extlen, int offset, uint8_t type, socklen_t len, uint_t align, void **databufp); extern int inet6_opt_finish(void *extbuf, socklen_t extlen, int offset); extern int inet6_opt_set_val(void *databuf, int offset, void *val, socklen_t vallen); extern int inet6_opt_next(void *extbuf, socklen_t extlen, int offset, uint8_t *typep, socklen_t *lenp, void **databufp); extern int inet6_opt_find(void *extbufp, socklen_t extlen, int offset, uint8_t type, socklen_t *lenp, void **databufp); extern int inet6_opt_get_val(void *databuf, int offset, void *val, socklen_t vallen); typedef struct { struct in_addr in_prefix_addr; unsigned int in_prefix_len; } in_prefix_t; # 1200 "/usr/include/netinet/in.h" 3 4 extern const struct in6_addr in6addr_any; extern const struct in6_addr in6addr_loopback; # 46 "/usr/include/sys/socket.h" 2 3 4 # 162 "/usr/include/sys/socket.h" 3 4 struct linger { int l_onoff; int l_linger; }; # 252 "/usr/include/sys/socket.h" 3 4 struct msghdr { void *msg_name; socklen_t msg_namelen; struct iovec *msg_iov; int msg_iovlen; caddr_t msg_accrights; int msg_accrightslen; }; # 332 "/usr/include/sys/socket.h" 3 4 struct cmsghdr { socklen_t cmsg_len; int cmsg_level; int cmsg_type; }; # 418 "/usr/include/sys/socket.h" 3 4 extern int accept(int, struct sockaddr *, Psocklen_t); extern int bind(int, const struct sockaddr *, socklen_t); extern int connect(int, const struct sockaddr *, socklen_t); extern int getpeername(int, struct sockaddr *, Psocklen_t); extern int getsockname(int, struct sockaddr *, Psocklen_t); extern int getsockopt(int, int, int, void *, Psocklen_t); extern int listen(int, int); extern int socketpair(int, int, int, int *); extern ssize_t recv(int, void *, size_t, int); extern ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, Psocklen_t); extern ssize_t recvmsg(int, struct msghdr *, int); extern ssize_t send(int, const void *, size_t, int); extern ssize_t sendmsg(int, const struct msghdr *, int); extern ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t); extern int setsockopt(int, int, int, const void *, socklen_t); extern int shutdown(int, int); extern int socket(int, int, int); extern int sockatmark(int); # 35 "../ip_addr.h" 2 # 1 "/usr/include/netdb.h" 1 3 4 # 95 "/usr/include/netdb.h" 3 4 #pragma ident "@(#)netdb.h 1.30 03/12/04 SMI" # 117 "/usr/include/netdb.h" 3 4 struct hostent { char *h_name; char **h_aliases; int h_addrtype; int h_length; char **h_addr_list; }; # 133 "/usr/include/netdb.h" 3 4 struct addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; socklen_t ai_addrlen; char *ai_canonname; struct sockaddr *ai_addr; struct addrinfo *ai_next; }; # 202 "/usr/include/netdb.h" 3 4 typedef struct ipsecalgent { char **a_names; int a_proto_num; int a_alg_num; char *a_mech_name; int *a_block_sizes; int *a_key_sizes; int a_key_increment; } ipsecalgent_t; # 222 "/usr/include/netdb.h" 3 4 struct netent { char *n_name; char **n_aliases; int n_addrtype; in_addr_t n_net; }; struct protoent { char *p_name; char **p_aliases; int p_proto; }; struct servent { char *s_name; char **s_aliases; int s_port; char *s_proto; }; struct hostent *gethostbyname_r (const char *, struct hostent *, char *, int, int *h_errnop); struct hostent *gethostbyaddr_r (const char *, int, int, struct hostent *, char *, int, int *h_errnop); struct hostent *getipnodebyname(const char *, int, int, int *); struct hostent *getipnodebyaddr(const void *, size_t, int, int *); void freehostent(struct hostent *); struct hostent *gethostent_r(struct hostent *, char *, int, int *h_errnop); struct servent *getservbyname_r (const char *name, const char *, struct servent *, char *, int); struct servent *getservbyport_r (int port, const char *, struct servent *, char *, int); struct servent *getservent_r(struct servent *, char *, int); struct netent *getnetbyname_r (const char *, struct netent *, char *, int); struct netent *getnetbyaddr_r(long, int, struct netent *, char *, int); struct netent *getnetent_r(struct netent *, char *, int); struct protoent *getprotobyname_r (const char *, struct protoent *, char *, int); struct protoent *getprotobynumber_r (int, struct protoent *, char *, int); struct protoent *getprotoent_r(struct protoent *, char *, int); int getnetgrent_r(char **, char **, char **, char *, int); int innetgr(const char *, const char *, const char *, const char *); struct hostent *gethostbyname(const char *); struct hostent *gethostent(void); struct netent *getnetbyaddr(in_addr_t, int); struct netent *getnetbyname(const char *); struct netent *getnetent(void); struct protoent *getprotobyname(const char *); struct protoent *getprotobynumber(int); struct protoent *getprotoent(void); struct servent *getservbyname(const char *, const char *); struct servent *getservbyport(int, const char *); struct servent *getservent(void); struct hostent *gethostbyaddr(const void *, socklen_t, int); int endhostent(void); int endnetent(void); int endprotoent(void); int endservent(void); int sethostent(int); int setnetent(int); int setprotoent(int); int setservent(int); # 324 "/usr/include/netdb.h" 3 4 int getaddrinfo(const char *, const char *, const struct addrinfo *, struct addrinfo **); void freeaddrinfo(struct addrinfo *); const char *gai_strerror(int); int getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, int); int getnetgrent(char **, char **, char **); int setnetgrent(const char *); int endnetgrent(void); int rcmd(char **, unsigned short, const char *, const char *, const char *, int *); int rcmd_af(char **, unsigned short, const char *, const char *, const char *, int *, int); int rresvport_af(int *, int); int rresvport_addr(int *, struct sockaddr_storage *); int rexec(char **, unsigned short, const char *, const char *, const char *, int *); int rexec_af(char **, unsigned short, const char *, const char *, const char *, int *, int); int rresvport(int *); int ruserok(const char *, int, const char *, const char *); struct hostent *gethostbyname2(const char *, int); void herror(const char *); const char *hstrerror(int); struct ipsecalgent *getipsecalgbyname(const char *, int, int *); struct ipsecalgent *getipsecalgbynum(int, int, int *); int getipsecprotobyname(const char *doi_name); char *getipsecprotobynum(int doi_domain); void freeipsecalgent(struct ipsecalgent *ptr); # 447 "/usr/include/netdb.h" 3 4 extern int h_errno; # 37 "../ip_addr.h" 2 # 1 "../str.h" 1 # 38 "../ip_addr.h" 2 # 1 "../dprint.h" 1 # 28 "../dprint.h" # 1 "/usr/include/syslog.h" 1 3 4 # 11 "/usr/include/syslog.h" 3 4 #pragma ident "@(#)syslog.h 1.11 96/05/17 SMI" # 1 "/usr/include/sys/syslog.h" 1 3 4 # 22 "/usr/include/sys/syslog.h" 3 4 #pragma ident "@(#)syslog.h 1.11 03/06/10 SMI" # 15 "/usr/include/syslog.h" 2 3 4 # 1 "/usr/include/sys/va_list.h" 1 3 4 # 16 "/usr/include/sys/va_list.h" 3 4 #pragma ident "@(#)va_list.h 1.15 04/11/19 SMI" # 99 "/usr/include/sys/va_list.h" 3 4 typedef __builtin_va_list __gnuc_va_list; typedef __builtin_va_list __va_list; # 16 "/usr/include/syslog.h" 2 3 4 void openlog(const char *, int, int); void syslog(int, const char *, ...); void closelog(void); int setlogmask(int); void vsyslog(int, const char *, __va_list); # 29 "../dprint.h" 2 # 41 "../dprint.h" extern int debug; extern int log_stderr; extern int log_facility; extern char* log_name; void dprint (char* format, ...); int str2facility(char *s); # 41 "../ip_addr.h" 2 enum sip_protos { PROTO_NONE, PROTO_UDP, PROTO_TCP, PROTO_TLS, PROTO_SCTP }; struct ip_addr{ unsigned int af; unsigned int len; union { unsigned long addrl[16/sizeof(long)]; unsigned int addr32[4]; unsigned short addr16[8]; unsigned char addr[16]; }u; }; struct net{ struct ip_addr ip; struct ip_addr mask; }; union sockaddr_union{ struct sockaddr s; struct sockaddr_in sin; }; enum si_flags { SI_NONE=0, SI_IS_IP=1, SI_IS_LO=2, SI_IS_MCAST=4 }; struct socket_info{ int socket; str name; struct ip_addr address; str address_str; unsigned short port_no; str port_no_str; enum si_flags flags; union sockaddr_union su; int proto; struct socket_info* next; struct socket_info* prev; }; struct receive_info{ struct ip_addr src_ip; struct ip_addr dst_ip; unsigned short src_port; unsigned short dst_port; int proto; int proto_reserved1; int proto_reserved2; union sockaddr_union src_su; struct socket_info* bind_address; }; struct dest_info{ int proto; int proto_reserved1; union sockaddr_union to; struct socket_info* send_sock; }; struct socket_id{ char* name; int proto; int port; struct socket_id* next; }; # 163 "../ip_addr.h" struct net* mk_net(struct ip_addr* ip, struct ip_addr* mask); struct net* mk_net_bitlen(struct ip_addr* ip, unsigned int bitlen); void print_ip(char* prefix, struct ip_addr* ip, char* suffix); void stdout_print_ip(struct ip_addr* ip); void print_net(struct net* net); # 177 "../ip_addr.h" inline static int matchnet(struct ip_addr* ip, struct net* net) { unsigned int r; int ret; ret=-1; if (ip->af == net->ip.af){ for(r=0; r<ip->len/4; r++){ if ((ip->u.addr32[r]&net->mask.u.addr32[r])! net->ip.u.addr32[r]){ return 0; } } return 1; }; return -1; } static inline void sockaddr2ip_addr(struct ip_addr* ip, struct sockaddr* sa) { switch(sa->sa_family){ case 2: ip->af=2; ip->len=4; memcpy(ip->u.addr, &((struct sockaddr_in*)sa)->sin_addr, 4); break; default: do { if (debug>=(-2)){ if (log_stderr) dprint ("sockaddr2ip_addr: BUG: unknown address family %d\n", sa->sa_family); else { switch(-2){ case -2: syslog(2|log_facility, "sockaddr2ip_addr: BUG: unknown address family %d\n", sa->sa_family); break; case -3: syslog(1|log_facility, "sockaddr2ip_addr: BUG: unknown address family %d\n", sa->sa_family); break; case -1: syslog(3|log_facility, "sockaddr2ip_addr: BUG: unknown address family %d\n", sa->sa_family); break; case 1: syslog(4|log_facility, "sockaddr2ip_addr: BUG: unknown address family %d\n", sa->sa_family); break; case 2: syslog(5|log_facility, "sockaddr2ip_addr: BUG: unknown address family %d\n", sa->sa_family); break; case 3: syslog(6|log_facility, "sockaddr2ip_addr: BUG: unknown address family %d\n", sa->sa_family); break; case 4: syslog(7|log_facility, "sockaddr2ip_addr: BUG: unknown address family %d\n", sa->sa_family); break; } } } }while(0); } } # 231 "../ip_addr.h" static inline int su_cmp(union sockaddr_union* s1, union sockaddr_union* s2) { if (s1->s.sa_family!=s2->s.sa_family) return 0; switch(s1->s.sa_family){ case 2: return (s1->sin.sin_port==s2->sin.sin_port)&& (memcmp(&s1->sin.sin_addr, &s2->sin.sin_addr, 4)==0); default: do { if (debug>=(-2)){ if (log_stderr) dprint ("su_cmp: BUG: unknown address family %d\n", s1->s.sa_family); else { switch(-2){ case -2: syslog(2|log_facility, "su_cmp: BUG: unknown address family %d\n", s1->s.sa_family); break; case -3: syslog(1|log_facility, "su_cmp: BUG: unknown address family %d\n", s1->s.sa_family); break; case -1: syslog(3|log_facility, "su_cmp: BUG: unknown address family %d\n", s1->s.sa_family); break; case 1: syslog(4|log_facility, "su_cmp: BUG: unknown address family %d\n", s1->s.sa_family); break; case 2: syslog(5|log_facility, "su_cmp: BUG: unknown address family %d\n", s1->s.sa_family); break; case 3: syslog(6|log_facility, "su_cmp: BUG: unknown address family %d\n", s1->s.sa_family); break; case 4: syslog(7|log_facility, "su_cmp: BUG: unknown address family %d\n", s1->s.sa_family); break; } } } }while(0); return 0; } } static inline unsigned short su_getport(union sockaddr_union* su) { switch(su->s.sa_family){ case 2: return (su->sin.sin_port); default: do { if (debug>=(-2)){ if (log_stderr) dprint ("su_get_port: BUG: unknown address family %d\n", su->s.sa_family); else { switch(-2){ case -2: syslog(2|log_facility, "su_get_port: BUG: unknown address family %d\n", su->s.sa_family); break; case -3: syslog(1|log_facility, "su_get_port: BUG: unknown address family %d\n", su->s.sa_family); break; case -1: syslog(3|log_facility, "su_get_port: BUG: unknown address family %d\n", su->s.sa_family); break; case 1: syslog(4|log_facility, "su_get_port: BUG: unknown address family %d\n", su->s.sa_family); break; case 2: syslog(5|log_facility, "su_get_port: BUG: unknown address family %d\n", su->s.sa_family); break; case 3: syslog(6|log_facility, "su_get_port: BUG: unknown address family %d\n", su->s.sa_family); break; case 4: syslog(7|log_facility, "su_get_port: BUG: unknown address family %d\n", su->s.sa_family); break; } } } }while(0); return 0; } } static inline void su_setport(union sockaddr_union* su, unsigned short port) { switch(su->s.sa_family){ case 2: su->sin.sin_port=(port); break; default: do { if (debug>=(-2)){ if (log_stderr) dprint ("su_set_port: BUG: unknown address family %d\n", su->s.sa_family); else { switch(-2){ case -2: syslog(2|log_facility, "su_set_port: BUG: unknown address family %d\n", su->s.sa_family); break; case -3: syslog(1|log_facility, "su_set_port: BUG: unknown address family %d\n", su->s.sa_family); break; case -1: syslog(3|log_facility, "su_set_port: BUG: unknown address family %d\n", su->s.sa_family); break; case 1: syslog(4|log_facility, "su_set_port: BUG: unknown address family %d\n", su->s.sa_family); break; case 2: syslog(5|log_facility, "su_set_port: BUG: unknown address family %d\n", su->s.sa_family); break; case 3: syslog(6|log_facility, "su_set_port: BUG: unknown address family %d\n", su->s.sa_family); break; case 4: syslog(7|log_facility, "su_set_port: BUG: unknown address family %d\n", su->s.sa_family); break; } } } }while(0); } } static inline void su2ip_addr(struct ip_addr* ip, union sockaddr_union* su) { switch(su->s.sa_family){ case 2: ip->af=2; ip->len=4; memcpy(ip->u.addr, &su->sin.sin_addr, 4); break; default: do { if (debug>=(-2)){ if (log_stderr) dprint ("su2ip_addr: BUG: unknown address family %d\n", su->s.sa_family); else { switch(-2){ case -2: syslog(2|log_facility, "su2ip_addr: BUG: unknown address family %d\n", su->s.sa_family); break; case -3: syslog(1|log_facility, "su2ip_addr: BUG: unknown address family %d\n", su->s.sa_family); break; case -1: syslog(3|log_facility, "su2ip_addr: BUG: unknown address family %d\n", su->s.sa_family); break; case 1: syslog(4|log_facility, "su2ip_addr: BUG: unknown address family %d\n", su->s.sa_family); break; case 2: syslog(5|log_facility, "su2ip_addr: BUG: unknown address family %d\n", su->s.sa_family); break; case 3: syslog(6|log_facility, "su2ip_addr: BUG: unknown address family %d\n", su->s.sa_family); break; case 4: syslog(7|log_facility, "su2ip_addr: BUG: unknown address family %d\n", su->s.sa_family); break; } } } }while(0); } } # 320 "../ip_addr.h" static inline int init_su( union sockaddr_union* su, struct ip_addr* ip, unsigned short port ) { memset(su, 0, sizeof(union sockaddr_union)); su->s.sa_family=ip->af; switch(ip->af){ # 336 "../ip_addr.h" case 2: memcpy(&su->sin.sin_addr, ip->u.addr, ip->len); su->sin.sin_port=(port); break; default: do { if (debug>=(-2)){ if (log_stderr) dprint ("init_ss: BUG: unknown address family %d\n", ip->af); else { switch(-2){ case -2: syslog(2|log_facility, "init_ss: BUG: unknown address family %d\n", ip->af); break; case -3: syslog(1|log_facility, "init_ss: BUG: unknown address family %d\n", ip->af); break; case -1: syslog(3|log_facility, "init_ss: BUG: unknown address family %d\n", ip->af); break; case 1: syslog(4|log_facility, "init_ss: BUG: unknown address family %d\n", ip->af); break; case 2: syslog(5|log_facility, "init_ss: BUG: unknown address family %d\n", ip->af); break; case 3: syslog(6|log_facility, "init_ss: BUG: unknown address family %d\n", ip->af); break; case 4: syslog(7|log_facility, "init_ss: BUG: unknown address family %d\n", ip->af); break; } } } }while(0); return -1; } return 0; } static inline int hostent2su( union sockaddr_union* su, struct hostent* he, unsigned int idx, unsigned short port ) { memset(su, 0, sizeof(union sockaddr_union)); su->s.sa_family=he->h_addrtype; switch(he->h_addrtype){ # 373 "../ip_addr.h" case 2: memcpy(&su->sin.sin_addr, he->h_addr_list[idx], he->h_length); su->sin.sin_port=(port); break; default: do { if (debug>=(-2)){ if (log_stderr) dprint ("hostent2su: BUG: unknown address family %d\n", he->h_addrtype); else { switch(-2){ case -2: syslog(2|log_facility, "hostent2su: BUG: unknown address family %d\n", he->h_addrtype); break; case -3: syslog(1|log_facility, "hostent2su: BUG: unknown address family %d\n", he->h_addrtype); break; case -1: syslog(3|log_facility, "hostent2su: BUG: unknown address family %d\n", he->h_addrtype); break; case 1: syslog(4|log_facility, "hostent2su: BUG: unknown address family %d\n", he->h_addrtype); break; case 2: syslog(5|log_facility, "hostent2su: BUG: unknown address family %d\n", he->h_addrtype); break; case 3: syslog(6|log_facility, "hostent2su: BUG: unknown address family %d\n", he->h_addrtype); break; case 4: syslog(7|log_facility, "hostent2su: BUG: unknown address family %d\n", he->h_addrtype); break; } } } }while(0); return -1; } return 0; } static inline char* ip_addr2a(struct ip_addr* ip) { static char buff[40]; int offset; register unsigned char a,b,c; int r; offset=0; switch(ip->af){ # 468 "../ip_addr.h" case 2: for(r=0;r<3;r++){ a=ip->u.addr[r]/100; c=ip->u.addr[r]%10; b=ip->u.addr[r]%100/10; if (a){ buff[offset]=a+''0''; buff[offset+1]=b+''0''; buff[offset+2]=c+''0''; buff[offset+3]=''.''; offset+=4; }else if (b){ buff[offset]=b+''0''; buff[offset+1]=c+''0''; buff[offset+2]=''.''; offset+=3; }else{ buff[offset]=c+''0''; buff[offset+1]=''.''; offset+=2; } } a=ip->u.addr[r]/100; c=ip->u.addr[r]%10; b=ip->u.addr[r]%100/10; if (a){ buff[offset]=a+''0''; buff[offset+1]=b+''0''; buff[offset+2]=c+''0''; buff[offset+3]=0; }else if (b){ buff[offset]=b+''0''; buff[offset+1]=c+''0''; buff[offset+2]=0; }else{ buff[offset]=c+''0''; buff[offset+1]=0; } break; default: do { if (debug>=(-2)){ if (log_stderr) dprint ("BUG: ip_addr2a: unknown address family %d\n", ip->af); else { switch(-2){ case -2: syslog(2|log_facility, "BUG: ip_addr2a: unknown address family %d\n", ip->af); break; case -3: syslog(1|log_facility, "BUG: ip_addr2a: unknown address family %d\n", ip->af); break; case -1: syslog(3|log_facility, "BUG: ip_addr2a: unknown address family %d\n", ip->af); break; case 1: syslog(4|log_facility, "BUG: ip_addr2a: unknown address family %d\n", ip->af); break; case 2: syslog(5|log_facility, "BUG: ip_addr2a: unknown address family %d\n", ip->af); break; case 3: syslog(6|log_facility, "BUG: ip_addr2a: unknown address family %d\n", ip->af); break; case 4: syslog(7|log_facility, "BUG: ip_addr2a: unknown address family %d\n", ip->af); break; } } } }while(0); return 0; } return buff; } static inline struct hostent* ip_addr2he(str* name, struct ip_addr* ip) { static struct hostent he; static char hostname[256]; static char* p_aliases[1]; static char* p_addr[2]; static char address[16]; p_aliases[0]=0; p_addr[1]=0; p_addr[0]=address; strncpy(hostname, name->s, (name->len<256)?(name->len)+1:256); if (ip->len>16) return 0; memcpy(address, ip->u.addr, ip->len); he.h_addrtype=ip->af; he.h_length=ip->len; he.h_addr_list=p_addr; he.h_aliases=p_aliases; he.h_name=hostname; return &he; } # 46 "msg_parser.h" 2 # 1 "../md5utils.h" 1 # 31 "../md5utils.h" void MDStringArray (char *dst, str src[], int size); # 47 "msg_parser.h" 2 # 1 "../config.h" 1 # 34 "../config.h" # 1 "../types.h" 1 # 27 "../types.h" typedef unsigned int process_bm_t; # 35 "../config.h" 2 # 48 "msg_parser.h" 2 # 1 "parse_def.h" 1 # 49 "msg_parser.h" 2 # 1 "parse_cseq.h" 1 # 30 "parse_cseq.h" struct cseq_body{ int error; str number; str method; int method_id; }; # 45 "parse_cseq.h" char* parse_cseq(char *buf, char* end, struct cseq_body* cb); void free_cseq(struct cseq_body* cb); # 50 "msg_parser.h" 2 # 1 "parse_to.h" 1 # 30 "parse_to.h" enum { TAG_PARAM = 400, GENERAL_PARAM }; struct to_param{ int type; str name; str value; struct to_param* next; }; struct to_body{ int error; str body; str uri; str display; str tag_value; struct to_param *param_lst; struct to_param *last_param; }; # 60 "parse_to.h" char* parse_to(char* buffer, char *end, struct to_body *to_b); void free_to(struct to_body* tb); # 51 "msg_parser.h" 2 # 1 "parse_via.h" 1 # 44 "parse_via.h" enum { PARAM_HIDDEN=230, PARAM_TTL, PARAM_BRANCH, PARAM_MADDR, PARAM_RECEIVED, PARAM_RPORT, PARAM_I, PARAM_ALIAS, GEN_PARAM, PARAM_ERROR }; struct via_param { int type; str name; str value; char* start; int size; struct via_param* next; }; struct via_body { int error; str hdr; str name; str version; str transport; int proto; str host; int port; str port_str; str params; str comment; int bsize; struct via_param* param_lst; struct via_param* last_param; struct via_param* branch; str tid; struct via_param* received; struct via_param* rport; struct via_param* i; struct via_param* alias; struct via_body* next; }; char* parse_via(char* buffer, char* end, struct via_body *vb); void free_via_list(struct via_body *vb); # 52 "msg_parser.h" 2 # 1 "parse_fline.h" 1 # 54 "parse_fline.h" struct msg_start { int type; int len; union { struct { str method; str uri; str version; int method_value; } request; struct { str version; str status; str reason; unsigned int statuscode; } reply; }u; }; char* parse_first_line(char* buffer, unsigned int len, struct msg_start * fl); char* parse_fline(char* buffer, char* end, struct msg_start* fl); # 53 "msg_parser.h" 2 # 1 "hf.h" 1 # 54 "msg_parser.h" 2 # 63 "msg_parser.h" enum request_method { METHOD_UNDEF=0, METHOD_INVITE=1, METHOD_CANCEL=2, METHOD_ACK=4, METHOD_BYE=8, METHOD_INFO=16, METHOD_OPTIONS=32, METHOD_UPDATE=64, METHOD_REGISTER=128, METHOD_MESSAGE=256, METHOD_SUBSCRIBE=512, METHOD_NOTIFY=1024, METHOD_PRACK=2048, METHOD_REFER=4096, METHOD_OTHER=8192 }; # 125 "msg_parser.h" enum _uri_type{ERROR_URI_T=0, SIP_URI_T, SIPS_URI_T, TEL_URI_T, TELS_URI_T}; typedef enum _uri_type uri_type; struct sip_uri { str user; str passwd; str host; str port; str params; str headers; unsigned short port_no; unsigned short proto; uri_type type; str transport; str ttl; str user_param; str maddr; str method; str lr; str r2; str transport_val; str ttl_val; str user_param_val; str maddr_val; str method_val; str lr_val; str r2_val; }; struct sip_msg { unsigned int id; struct msg_start first_line; struct via_body* via1; struct via_body* via2; struct hdr_field* headers; struct hdr_field* last_header; hdr_flags_t parsed_flag; struct hdr_field* h_via1; struct hdr_field* h_via2; struct hdr_field* callid; struct hdr_field* to; struct hdr_field* cseq; struct hdr_field* from; struct hdr_field* contact; struct hdr_field* maxforwards; struct hdr_field* route; struct hdr_field* record_route; struct hdr_field* content_type; struct hdr_field* content_length; struct hdr_field* authorization; struct hdr_field* expires; struct hdr_field* proxy_auth; struct hdr_field* supported; struct hdr_field* proxy_require; struct hdr_field* unsupported; struct hdr_field* allow; struct hdr_field* event; struct hdr_field* accept; struct hdr_field* accept_language; struct hdr_field* organization; struct hdr_field* priority; struct hdr_field* subject; struct hdr_field* user_agent; struct hdr_field* content_disposition; struct hdr_field* accept_disposition; struct hdr_field* diversion; struct hdr_field* rpid; struct hdr_field* refer_to; char* eoh; char* unparsed; struct receive_info rcv; char* buf; unsigned int len; str new_uri; str dst_uri; int parsed_uri_ok; struct sip_uri parsed_uri; int parsed_orig_ruri_ok; struct sip_uri parsed_orig_ruri; struct lump* add_rm; struct lump* body_lumps; struct lump_rpl *reply_lump; char add_to_branch_s[((sizeof("z9hG4bK")-1)+8 + 1 + 32 + 1 + 8 + 1 )]; int add_to_branch_len; unsigned int hash_index; flag_t flags; unsigned int msg_flags; str set_global_address; str set_global_port; struct socket_info* force_send_socket; }; # 262 "msg_parser.h" extern int via_cnt; int parse_msg(char* buf, unsigned int len, struct sip_msg* msg); int parse_headers(struct sip_msg* msg, hdr_flags_t flags, int next); char* get_hdr_field(char* buf, char* end, struct hdr_field* hdr); void free_sip_msg(struct sip_msg* msg); int check_transaction_quadruple( struct sip_msg* msg ); inline static int char_msg_val( struct sip_msg *msg, char *cv ) { str src[8]; if (!check_transaction_quadruple(msg)) { do { if (debug>=(-1)){ if (log_stderr) dprint ("ERROR: can''t calculate char_value due " "to a parsing error\n"); else { switch(-1){ case -2: syslog(2|log_facility, "ERROR: can''t calculate char_value due " "to a parsing error\n"); break; case -3: syslog(1|log_facility, "ERROR: can''t calculate char_value due " "to a parsing error\n"); break; case -1: syslog(3|log_facility, "ERROR: can''t calculate char_value due " "to a parsing error\n"); break; case 1: syslog(4|log_facility, "ERROR: can''t calculate char_value due " "to a parsing error\n"); break; case 2: syslog(5|log_facility, "ERROR: can''t calculate char_value due " "to a parsing error\n"); break; case 3: syslog(6|log_facility, "ERROR: can''t calculate char_value due " "to a parsing error\n"); break; case 4: syslog(7|log_facility, "ERROR: can''t calculate char_value due " "to a parsing error\n"); break; } } } }while(0); memset( cv, ''0'', 32 ); return 0; } src[0]= msg->from->body; src[1]= msg->to->body; src[2]= msg->callid->body; src[3]= msg->first_line.u.request.uri; src[4]= ((struct cseq_body*)(msg)->cseq->parsed)->number; src[5]= msg->via1->host; src[6]= msg->via1->port_str; if (msg->via1->branch) { src[7]= msg->via1->branch->value; MDStringArray ( cv, src, 8 ); } else { MDStringArray( cv, src, 7 ); } return 1; } inline static char* get_body(struct sip_msg *msg) { int offset; int len; if ( parse_headers(msg,(((HDR_EOH_T)!=HDR_EOH_T)?((hdr_flags_t)1<<(HDR_EOH_T)):(~(hdr_flags_t)0)), 0)==-1 ) return 0; if (msg->unparsed){ len=(int)(msg->unparsed-msg->buf); }else return 0; if ((len+2<=msg->len) && (strncmp("\r\n",msg->unparsed,(sizeof("\r\n") - 1))==0) ) offset = (sizeof("\r\n") - 1); else if ( (len+1<=msg->len) && (*(msg->unparsed)==''\n'' || *(msg->unparsed)==''\r'' ) ) offset = 1; else return 0; return msg->unparsed + offset; } int set_dst_uri(struct sip_msg* msg, str* uri); # 2 "ick.c" 2 sip_msg foo;
Michael Shapiro
2006-Jun-02 18:38 UTC
[dtrace-discuss] Errors generating header file for inclusion in script
> > Howdy, > > I am trying to generate a header file to use with DTrace, and thought the > following should work: > > $ cat ick.c > > sip_msg h; > > $ /usr/sfw/bin/cpp ick.c > openser.h > > When I attempt to include openser.h in my DTrace script, I am greeted with > the following errors: > > $ dtrace -xcpppath=/usr/sfw/bin/cpp -C -s test.d > <command line>:10:1: warning: "__STDC__" redefined > dtrace: failed to compile script test.d: ".././parser/hf.h", line 137: > syntax error near "str" > > Does anyone see anything wrong with what I am attempting to do? If the > above steps are correct, does anyone happen to know how I can get > openser.h (attached to this message) to work with DTrace? > > Thanks, > - Ryan > -- > UNIX Administrator > http://daemons.net/~mattyUse dtrace -Xs to not define __STDC__ and then gcc cpp will do its default thing. As you see, it complains when __STDC__ is modified on its command-line. -Mike -- Mike Shapiro, Solaris Kernel Development. blogs.sun.com/mws/
Matty
2006-Jun-02 19:39 UTC
[dtrace-discuss] Errors generating header file for inclusion in script
On Fri, 2 Jun 2006, Michael Shapiro wrote:> Use dtrace -Xs to not define __STDC__ and then gcc cpp will do its > default thing. As you see, it complains when __STDC__ is modified > on its command-line.That fixes the STDC complaint, but DTrace is still having problems with the header file: $ dtrace -Hv -Xs -xcpppath=/usr/sfw/bin/cpp -C -s test.d . /export/home/matty/dev/ser_dtrace/openser.h .. msg_parser.h [ ... ] dtrace: failed to compile script test.d: ".././parser/hf.h", line 137: syntax error near "str" Does anyone have any thoughts on how to get the header file to work with DTrace? I haven''t done a ton of cpp debugging, and am hopeful someone on the list with more experience can help guide me toward a working solution. Thanks, - Ryan -- UNIX Administrator http://daemons.net/~matty
Bryan Cantrill
2006-Jun-02 22:27 UTC
[dtrace-discuss] Errors generating header file for inclusion in script
On Fri, Jun 02, 2006 at 03:39:43PM -0400, Matty wrote:> On Fri, 2 Jun 2006, Michael Shapiro wrote: > > >Use dtrace -Xs to not define __STDC__ and then gcc cpp will do its > >default thing. As you see, it complains when __STDC__ is modified > >on its command-line. > > That fixes the STDC complaint, but DTrace is still having problems with > the header file: > > $ dtrace -Hv -Xs -xcpppath=/usr/sfw/bin/cpp -C -s test.d > . /export/home/matty/dev/ser_dtrace/openser.h > .. msg_parser.h > > [ ... ] > > dtrace: failed to compile script test.d: ".././parser/hf.h", line 137: > syntax error near "str"What''s around line 137? In general, problems including C header files fall into one of two categories: 1. C that uses D keywords, the most popular case being "string". 2. Header files that contain static C globals (!) or functions (!!). In the first case, you''ll need to change the header file -- there isn''t a whole lot we can do about it. And the latter is just unspeakably busted, as it generates needless data and text in whatever objects happen to include the header file. Seeing the header file in question will allow us to figure which (if either) of these cases you''re falling into... - Bryan -------------------------------------------------------------------------- Bryan Cantrill, Solaris Kernel Development. http://blogs.sun.com/bmc
Matty
2006-Jun-04 13:54 UTC
[dtrace-discuss] Errors generating header file for inclusion in script
On Fri, 2 Jun 2006, Bryan Cantrill wrote:>> dtrace: failed to compile script test.d: ".././parser/hf.h", line 137: >> syntax error near "str" > > What''s around line 137? In general, problems including C header filesIt''s a reference to a struct str (see below for the definition).> fall into one of two categories: > > 1. C that uses D keywords, the most popular case being "string".I checked through the DTrace user guide type section: http://docs.sun.com/app/docs/doc/817-6223/6mlkidlfb?a=view And the types that are generating errors don''t appear to be reserved words.> 2. Header files that contain static C globals (!) or functions (!!).No global or static functions caught my eye (I didn''t write the openser software package, so I can''t speak authoritatively to this).> In the first case, you''ll need to change the header file -- there isn''t > a whole lot we can do about it. And the latter is just unspeakably busted, > as it generates needless data and text in whatever objects happen to include > the header file. Seeing the header file in question will allow us to > figure which (if either) of these cases you''re falling into...After sifting through the header file a bit more, here is a small test case to illustrate the problem: $ cat i.h struct _str{ char* s; int len; }; typedef struct _str str; struct hdr_field { str name; str body; int len; void* parsed; }; $ cat test.d #include "/export/home/matty/dev/dtrace/openser/i.h" syscall::write:entry {} $ dtrace -Hv -Xs -xcpppath=/usr/sfw/bin/cpp -C -s test.d . /export/home/matty/dev/dtrace/openser/i.h dtrace: failed to compile script test.d: "/export/home/matty/dev/dtrace/openser/i.h", line 9: syntax error near "str" When I include the header file in a C program, the program compiles and runs correctly. The issue seems to only pop up when DTrace needs to interpet the results. Does anyone happen to have any thoughts on what might be causing this? Thanks for the feedback, - Ryan -- UNIX Administrator http://daemons.net/~matty
Matty
2006-Jun-05 19:16 UTC
[dtrace-discuss] Errors generating header file for inclusion in script
I think I might have stumbled upon a DTrace bug. When I use the following header file: struct _str{ char* s; int len; }; typedef struct _str str; struct hdr_field { str name; str body; int len; void* parsed; }; DTrace spits out several errors and exits: $ dtrace -Hv -Xs -xcpppath=/usr/sfw/bin/cpp -C -s test.d . /export/home/matty/dev/ser_dtrace/i.h dtrace: failed to compile script test.d: "/export/home/matty/dev/ser_dtrace/i.h", line 7: syntax error near "str" If I use the following slightly modified header file: struct hdr_field { struct { char* s; int len; } name; struct { char* s; int len; } body; int len; void* parsed; }; Everything works as expected: $ dtrace -Hv -Xs -xcpppath=/usr/sfw/bin/cpp -C -s test.d . /export/home/matty/dev/ser_dtrace/i2.h dtrace: script ''test.d'' matched 1 probe Stability attributes for script test.d: Minimum Probe Description Attributes Identifier Names: Private Data Semantics: Private Dependency Class: ISA Minimum Statement Attributes Identifier Names: Stable Data Semantics: Stable Dependency Class: Common Is this a bug? Does anyone happen to know which source files are responsible for interpreting the results of cpp? Thanks, - Ryan -- UNIX Administrator http://daemons.net/~matty