OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [ecos-2.0/] [packages/] [net/] [tcpip/] [v2_0/] [include/] [netinet/] [ip_proxy.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1254 phoenix
//==========================================================================
2
//
3
//      include/netinet/ip_proxy.h
4
//
5
//      
6
//
7
//==========================================================================
8
//####BSDCOPYRIGHTBEGIN####
9
//
10
// -------------------------------------------
11
//
12
// Portions of this software may have been derived from OpenBSD or other sources,
13
// and are covered by the appropriate copyright disclaimers included herein.
14
//
15
// -------------------------------------------
16
//
17
//####BSDCOPYRIGHTEND####
18
//==========================================================================
19
//#####DESCRIPTIONBEGIN####
20
//
21
// Author(s):    gthomas
22
// Contributors: gthomas
23
// Date:         2000-01-10
24
// Purpose:      
25
// Description:  
26
//              
27
//
28
//####DESCRIPTIONEND####
29
//
30
//==========================================================================
31
 
32
 
33
/* $OpenBSD: ip_proxy.h,v 1.4 1999/12/15 05:20:23 kjell Exp $ */
34
/*
35
 * Copyright (C) 1997-1998 by Darren Reed.
36
 *
37
 * Redistribution and use in source and binary forms are permitted
38
 * provided that this notice is preserved and due credit is given
39
 * to the original author and the contributors.
40
 *
41
 */
42
 
43
#ifndef _NETINET_IP_PROXY_H__
44
#define _NETINET_IP_PROXY_H__
45
 
46
#ifndef SOLARIS
47
#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
48
#endif
49
 
50
#ifndef APR_LABELLEN
51
#define APR_LABELLEN    16
52
#endif
53
#define AP_SESS_SIZE    53
54
 
55
struct  nat;
56
struct  ipnat;
57
 
58
typedef struct  ap_tcp {
59
        u_short apt_sport;      /* source port */
60
        u_short apt_dport;      /* destination port */
61
        short   apt_sel[2];     /* {seq,ack}{off,min} set selector */
62
        short   apt_seqoff[2];  /* sequence # difference */
63
        tcp_seq apt_seqmin[2];  /* don't change seq-off until after this */
64
        short   apt_ackoff[2];  /* sequence # difference */
65
        tcp_seq apt_ackmin[2];  /* don't change seq-off until after this */
66
        u_char  apt_state[2];   /* connection state */
67
} ap_tcp_t;
68
 
69
typedef struct  ap_udp {
70
        u_short apu_sport;      /* source port */
71
        u_short apu_dport;      /* destination port */
72
} ap_udp_t;
73
 
74
typedef struct ap_session {
75
        struct  aproxy  *aps_apr;
76
        union {
77
                struct  ap_tcp  apu_tcp;
78
                struct  ap_udp  apu_udp;
79
        } aps_un;
80
        u_int   aps_flags;
81
        U_QUAD_T aps_bytes;     /* bytes sent */
82
        U_QUAD_T aps_pkts;      /* packets sent */
83
        void    *aps_nat;       /* pointer back to nat struct */
84
        void    *aps_data;      /* private data */
85
        int     aps_p;          /* protocol */
86
        int     aps_psiz;       /* size of private data */
87
        struct  ap_session      *aps_hnext;
88
        struct  ap_session      *aps_next;
89
} ap_session_t ;
90
 
91
#define aps_sport       aps_un.apu_tcp.apt_sport
92
#define aps_dport       aps_un.apu_tcp.apt_dport
93
#define aps_sel         aps_un.apu_tcp.apt_sel
94
#define aps_seqoff      aps_un.apu_tcp.apt_seqoff
95
#define aps_seqmin      aps_un.apu_tcp.apt_seqmin
96
#define aps_state       aps_un.apu_tcp.apt_state
97
#define aps_ackoff      aps_un.apu_tcp.apt_ackoff
98
#define aps_ackmin      aps_un.apu_tcp.apt_ackmin
99
 
100
 
101
typedef struct  aproxy  {
102
        char    apr_label[APR_LABELLEN];        /* Proxy label # */
103
        u_char  apr_p;          /* protocol */
104
        int     apr_ref;        /* +1 per rule referencing it */
105
        int     apr_flags;
106
        int     (* apr_init) __P((void));
107
        int     (* apr_new) __P((fr_info_t *, ip_t *,
108
                                 ap_session_t *, struct nat *));
109
        int     (* apr_inpkt) __P((fr_info_t *, ip_t *,
110
                                   ap_session_t *, struct nat *));
111
        int     (* apr_outpkt) __P((fr_info_t *, ip_t *,
112
                                    ap_session_t *, struct nat *));
113
} aproxy_t;
114
 
115
#define APR_DELETE      1
116
 
117
 
118
/*
119
 * Real audio proxy structure and #defines
120
 */
121
typedef struct  {
122
        int     rap_seenpna;
123
        int     rap_seenver;
124
        int     rap_version;
125
        int     rap_eos;        /* End Of Startup */
126
        int     rap_gotid;
127
        int     rap_gotlen;
128
        int     rap_mode;
129
        int     rap_sdone;
130
        u_short rap_plport;
131
        u_short rap_prport;
132
        u_short rap_srport;
133
        char    rap_svr[19];
134
        u_32_t  rap_sbf;        /* flag to indicate which of the 19 bytes have
135
                                 * been filled
136
                                 */
137
        tcp_seq rap_sseq;
138
} raudio_t;
139
 
140
#define RA_ID_END       0
141
#define RA_ID_UDP       1
142
#define RA_ID_ROBUST    7
143
 
144
#define RAP_M_UDP       1
145
#define RAP_M_ROBUST    2
146
#define RAP_M_TCP       4
147
#define RAP_M_UDP_ROBUST        (RAP_M_UDP|RAP_M_ROBUST)
148
 
149
 
150
extern  ap_session_t    *ap_sess_tab[AP_SESS_SIZE];
151
extern  ap_session_t    *ap_sess_list;
152
extern  aproxy_t        ap_proxies[];
153
 
154
extern  int     appr_init __P((void));
155
extern  int     appr_ok __P((ip_t *, tcphdr_t *, struct ipnat *));
156
extern  void    appr_free __P((aproxy_t *));
157
extern  void    aps_free __P((ap_session_t *));
158
extern  int     appr_check __P((ip_t *, fr_info_t *, struct nat *));
159
extern  aproxy_t        *appr_match __P((u_int, char *));
160
 
161
#endif /* _NETINET_IP_PROXY_H__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.