📄 in_pcb.h
字号:
/***************************************************************************
*
* Copyright (c) 1993 READY SYSTEMS CORPORATION.
*
* All rights reserved. READY SYSTEMS' source code is an unpublished
* work and the use of a copyright notice does not imply otherwise.
* This source code contains confidential, trade secret material of
* READY SYSTEMS. Any attempt or participation in deciphering, decoding,
* reverse engineering or in any way altering the source code is
* strictly prohibited, unless the prior written consent of
* READY SYSTEMS is obtained.
*
*
* Module Name: in_pcb.h
*
* Identification: @(#) 1.4 in_pcb.h
*
* Date: 1/6/94 16:36:04
*
****************************************************************************
*/
/*
RCS header identifier - in_pcb.h,v 1.3 1995/02/23 23:15:25 sriram Exp
*/
/*
* Copyrighted as an unpublished work.
* (c) Copyright 1987-1993 Lachman Technology, Incorporated
* All rights reserved.
*
* RESTRICTED RIGHTS
*
* These programs are supplied under a license. They may be used,
* disclosed, and/or copied only as permitted under such license
* agreement. Any copy must contain the above copyright notice and
* this restricted rights notice. Use, copying, and/or disclosure
* of the programs is strictly prohibited unless otherwise provided
* in the license agreement.
*/
/*
* Copyright (c) 1985 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* **********************************************************************
*
* CHANGE HISTORY:
*
* ----------------------------------------------------------------------
* DATE CHANGES
* ----------------------------------------------------------------------
*
* 12/29/94 Included the Version 5 TCP compatible code for SNMP_V2.
* Check for #ifdef VER5_COMPAT.
*
* ********************************************************************* */
#ifndef in_pcb_h
#define in_pcb_h
#ifdef SNX
#ifndef VER5_COMPAT
#define VER5_COMPAT
#endif
#endif
#ifdef VER5_COMPAT
#ifndef __netinet_ip_h
#ifdef SVR4
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#else
#ifdef SNX
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#else
#include <sys/netinet/in_systm.h>
#include <sys/netinet/ip.h>
#endif /* SNX */
#endif /* SVR4 */
#endif /* __netinet_ip_h */
#endif /* VER5_COMPAT */
#ifdef __cplusplus
extern "C" {
#endif
struct gi_arg {
int gi_op;
caddr_t gi_where;
unsigned gi_size;
unsigned gi_arg;
} ;
struct Argument
{
queue_t *rd_q; /* read queue for sending replies */
u_long flags; /* flags associated with route stream */
caddr_t gi_addr; /* user's copyin/out address */
struct gi_arg gi; /* structure for table retrieval */
};
/*
* Common structure pcb for internet protocol implementation. Here are stored
* pointers to local and foreign host table entries, local and foreign socket
* numbers, and pointers up (to a socket structure) and down (to a
* protocol-specific) control block.
*/
struct inpcb {
struct inpcb *inp_next, *inp_prev;
/* pointers to other pcb's */
struct inpcb *inp_head; /* pointer back to chain of inpcb's
* for this protocol */
short inp_state; /* old so_state from sockets */
short inp_tstate; /* TLI state for this endpoint */
short inp_error; /* error on this pcb */
short inp_minor; /* minor device number allocated */
queue_t *inp_q; /* queue for this minor dev */
struct in_addr inp_faddr; /* foreign host table entry */
struct in_addr inp_laddr; /* local host table entry */
u_short inp_fport; /* foreign port */
u_short inp_lport; /* local port */
#define inp_proto inp_lport /* overload port field for protocol */
caddr_t inp_ppcb; /* pointer to per-protocol pcb */
struct route inp_route; /* placeholder for routing entry */
mblk_t *inp_options; /* IP options */
mblk_t *inp_inpopts; /* recvd IP options */
ushort inp_protoopt; /* old so_options from sockets */
ushort inp_linger; /* time to linger while closing */
ushort inp_protodef; /* old pr_flags from sockets */
int inp_addrlen; /* address length client likes */
short inp_family; /* address family client likes */
u_char inp_iptos; /* TOS for IP header */
/* IILra07283 */
long inp_sbufsize; /* Window size for SNDBUF */
long inp_rbufsize; /* Window size for RCVBUF */
};
#define INPLOOKUP_WILDCARD 1
#define INPLOOKUP_SETLOCAL 2
#ifdef KERNEL
#define qtoinp(q) ((struct inpcb *) (q)->q_ptr)
#endif
#ifdef __cplusplus
}
#endif
#ifdef VER5_COMPAT
struct inpcb_t
{
struct inpcb *inp_next, *inp_prev;
/* pointers to other pcb's */
struct inpcb *inp_head; /* pointer back to chain of inpcb's
* for this protocol */
short inp_state; /* old so_state from sockets */
short inp_tstate; /* TLI state for this endpoint */
short inp_error; /* error on this pcb */
short inp_minor; /* minor device number allocated */
queue_t *inp_q; /* queue for this minor dev */
struct in_addr inp_faddr; /* foreign host table entry */
struct in_addr inp_laddr; /* local host table entry */
u_short inp_fport; /* foreign port */
u_short inp_lport; /* local port */
#define inp_proto inp_lport /* overload port field for protocol */
caddr_t inp_ppcb; /* pointer to per-protocol pcb */
struct route inp_route; /* placeholder for routing entry */
mblk_t *inp_options; /* IP options */
mblk_t *inp_inpopts; /* recvd IP options */
ushort inp_protoopt; /* old so_options from sockets */
ushort inp_linger; /* time to linger while closing */
ushort inp_protodef; /* old pr_flags from sockets */
#ifdef VER5_COMPAT
#ifdef SVR4
ushort inp_iocstate; /* state for transparent ioctl's */
#endif
#endif
int inp_addrlen; /* address length client likes */
short inp_family; /* address family client likes */
u_char inp_iptos; /* TOS for IP header */
u_char inp_ipttl; /* TTL for IP header */
int inp_flags; /* generic IP/datagram flags */
int inp_rflags; /* raw endpoint flags */
struct inpcb *inp_mgmtidx; /* current inp we're retrieving */
ushort inp_mgmtcnt; /* reference count */
struct gi_arg gi_arg; /* current copyin status */
struct ip_moptions *inp_moptions; /* multicast options */
u_long inp_rbufsize; /* size user set with SO_RCVBUF */
u_long inp_sbufsize; /* size user set with SO_SNDBUF */
#if defined(__INET_MP__)
struct shlockb inp_lock; /* shared r/w lock */
u_long inp_ctr; /* lock counter */
#endif
};
/* mgmt. ioctls and related structures */
#define __MGMT 'M'
#define SIOCGUDPSTATS ((__MGMT << 8) | 8)
#define STIOCGUDB ((__MGMT << 8) | 9) /* fetch UDP control blocks */
#define STIOCGTCB ((__MGMT << 8) | 7) /* fetch TCP control blocks */
/* Copyin/out values */
#define GIARG 0x1
#define CONTI 0x2
#define GITAB 0x4
#endif
#endif /* in_pcb_h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -