This file is indexed.

/usr/include/openh323/h460/h460_std23.h is in libh323plus-dev 1.24.0~dfsg2-1.3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
/* H460_std23.h
 *
 * Copyright (c) 2009 ISVO (Asia) Pte Ltd. All Rights Reserved.
 *
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Alternatively, the contents of this file may be used under the terms
 * of the General Public License (the  "GNU License"), in which case the
 * provisions of GNU License are applicable instead of those
 * above. If you wish to allow use of your version of this file only
 * under the terms of the GNU License and not to allow others to use
 * your version of this file under the MPL, indicate your decision by
 * deleting the provisions above and replace them with the notice and
 * other provisions required by the GNU License. If you do not delete
 * the provisions above, a recipient may use your version of this file
 * under either the MPL or the GNU License."
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 * the License for the specific language governing rights and limitations
 * under the License.
 *
 * The Original Code is derived from and used in conjunction with the 
 * H323Plus Project (www.h323plus.org/)
 *
 * The Initial Developer of the Original Code is ISVO (Asia) Pte Ltd.
 *
 *
 * Contributor(s): ______________________________________.
 *
 * $Id: h460_std23.h,v 1.11 2011/12/16 10:29:04 shorne Exp $
 *
 */

#ifndef H_H460_Featurestd23
#define H_H460_Featurestd23


#include <h460/h4601.h>
#include <ptlib/plugin.h>
#include <ptclib/pstun.h>

#if _MSC_VER
#pragma once
#endif

// WARNING - remove it when the ptlib problem is fixed! - SH
#if SVN_REVISION > 26772
	#if _WIN32
	#pragma message("H.460.23 Compile issue with PTLib object.h/cxx SVN r26772 revert both files to r26754")
	#else
	#warning("H.460.23 Compile issue with PTLib object.h/cxx SVN r26772 revert both files to r26754")
	#endif
#endif

class H323EndPoint;
class H460_FeatureStd23;
class PNatMethod_H46024  : public PSTUNClient,
                           public PThread
{
    // compile issue with PTLIB SVN object.h/cxx r26772 revert both files back to SVN r26754 - SH
    // commenting out will create a ambiguous delete in class destructor compile error.
    PCLASSINFO(PNatMethod_H46024, PNatMethod); 

    public:
        PNatMethod_H46024();

        ~PNatMethod_H46024();

        static PStringList GetNatMethodName() {  return PStringArray("H46024"); };

        virtual PString GetName() const
                { return GetNatMethodName()[0]; }

        // Start the Nat Method testing
        void Start(const PString & server,H460_FeatureStd23 * _feat);

        // Main thread testing
        void Main();

        // Whether the NAT method is Available
        virtual bool IsAvailable(
                const PIPSocket::Address & binding = PIPSocket::GetDefaultIpAny()  ///< Interface to see if NAT is available on
        );

        // Create the socket pair
        virtual PBoolean CreateSocketPair(
          PUDPSocket * & socket1,
          PUDPSocket * & socket2,
          const PIPSocket::Address & binding = PIPSocket::GetDefaultIpAny(),
          void * userData = NULL
        );

        // Whether the NAT Method is available
        void SetAvailable();

        // Whether the NAT method is activated for this call
        virtual void Activate(bool act);

        // Reportable NAT Type
        PSTUNClient::NatTypes GetNATType();

#if PTLIB_VER >= 2110
    virtual PString GetServer() const { return PString(); }
    virtual bool GetServerAddress(PIPSocketAddressAndPort & ) const { return false; }
    virtual NatTypes GetNatType(bool) { return UnknownNat; }
    virtual NatTypes GetNatType(const PTimeInterval &) { return UnknownNat; }
    virtual bool SetServer(const PString &) { return false; }
    virtual bool Open(const PIPSocket::Address &) { return false; }
    virtual bool CreateSocket(BYTE,PUDPSocket * &, const PIPSocket::Address,WORD)  { return false; }
    virtual void SetCredentials(const PString &, const PString &, const PString &) {}
#endif

protected:
        // Do a NAT test
        PSTUNClient::NatTypes NATTest();

    private:
        bool                    isActive;
        bool                    isAvailable;
        PSTUNClient::NatTypes    natType;
        H460_FeatureStd23 *        feat;
};

///////////////////////////////////////////////////////////////////////////////

class H460_FeatureStd23 : public H460_FeatureStd 
{
    PCLASSINFO(H460_FeatureStd23, H460_FeatureStd);

public:

    H460_FeatureStd23();
    virtual ~H460_FeatureStd23();

    // Universal Declarations Every H460 Feature should have the following
    virtual void AttachEndPoint(H323EndPoint * _ep);

    static PStringArray GetFeatureName() { return PStringArray("Std23"); };
    static PStringArray GetFeatureFriendlyName() { return PStringArray("P2Pnat Detect-H.460.23"); };
    static int GetPurpose()    { return FeatureRas; };
    static PStringArray GetIdentifier() { return PStringArray("23"); };

    virtual PBoolean CommonFeature() { return isEnabled; }

    // Messages
    // GK -> EP
    virtual PBoolean OnSendGatekeeperRequest(H225_FeatureDescriptor & pdu);
    virtual void OnReceiveGatekeeperConfirm(const H225_FeatureDescriptor & pdu);

    virtual PBoolean OnSendRegistrationRequest(H225_FeatureDescriptor & pdu);
    virtual void OnReceiveRegistrationConfirm(const H225_FeatureDescriptor & pdu);

    H323EndPoint * GetEndPoint() { return (H323EndPoint *)EP; }

    // Reporting the NAT Type
    void OnNATTypeDetection(PSTUNClient::NatTypes type, const PIPSocket::Address & ExtIP);

    bool IsAvailable();

    bool AlternateNATMethod();
    bool UseAlternate();

#ifdef H323_UPnP
    void InitialiseUPnP();
#endif

protected:
    bool DetectALG(const PIPSocket::Address & detectAddress);
    void StartSTUNTest(const PString & server);
    
    void DelayedReRegistration();
 
private:
    H323EndPoint *            EP;
    PSTUNClient::NatTypes    natType;
    PIPSocket::Address        externalIP;
    PBoolean                natNotify;
    PBoolean                alg;
    PBoolean                isavailable;
    PBoolean                isEnabled; 
    int                        useAlternate;

    // Delayed Reregistration
    PThread  *  RegThread;
    PDECLARE_NOTIFIER(PThread, H460_FeatureStd23, RegMethod);

};

// Need to declare for Factory Loader
#if !defined(_WIN32_WCE)
    #if PTLIB_VER > 260
       PPLUGIN_STATIC_LOAD(Std23, H460_Feature);
    #else
       PWLIB_STATIC_LOAD_PLUGIN(Std23, H460_Feature);
    #endif
#endif


////////////////////////////////////////////////////////

class H323EndPoint;
class H323Connection;
class H460_FeatureStd24 : public H460_FeatureStd 
{
    PCLASSINFO(H460_FeatureStd24, H460_FeatureStd);

public:

    H460_FeatureStd24();
    virtual ~H460_FeatureStd24();

    // Universal Declarations Every H460 Feature should have the following
    virtual void AttachEndPoint(H323EndPoint * _ep);
    virtual void AttachConnection(H323Connection * _ep);

    static PStringArray GetFeatureName() { return PStringArray("Std24"); };
    static PStringArray GetFeatureFriendlyName() { return PStringArray("P2Pnat Media-H.460.24"); };
    static int GetPurpose()    { return FeatureSignal; };
    static PStringArray GetIdentifier() { return PStringArray("24"); };

    virtual PBoolean CommonFeature() { return isEnabled; }

    enum NatInstruct {
        e_unknown,
        e_noassist,
        e_localMaster,
        e_remoteMaster,
        e_localProxy,
        e_remoteProxy,
        e_natFullProxy,
        e_natAnnexA,                // Same NAT
        e_natAnnexB,                // NAT Offload
        e_natFailure = 100
    };

    static PString GetNATStrategyString(NatInstruct method);

    enum H46024NAT {
        e_default,        // This will use the underlying NAT Method
        e_enable,        // Use H.460.24 method (STUN)
        e_AnnexA,       // Disable H.460.24 method but initiate AnnexA
        e_AnnexB,        // Disable H.460.24 method but initiate AnnexB
        e_disable        // Disable all and remote will do the NAT help        
    };

    // Messages
    virtual PBoolean OnSendAdmissionRequest(H225_FeatureDescriptor & pdu);
    virtual void OnReceiveAdmissionConfirm(const H225_FeatureDescriptor & pdu);
    virtual void OnReceiveAdmissionReject(const H225_FeatureDescriptor & pdu);

    virtual PBoolean OnSendSetup_UUIE(H225_FeatureDescriptor & pdu);
    virtual void OnReceiveSetup_UUIE(const H225_FeatureDescriptor & pdu);

protected:
    void HandleNATInstruction(NatInstruct natconfig);
    void SetNATMethods(H46024NAT state);
    void SetH46019State(bool state);
 
private:
    H323EndPoint * EP;
    H323Connection * CON;
    NatInstruct natconfig;
    PMutex h460mute;
    int nattype;
    bool isEnabled;
    bool useAlternate;


};

inline ostream & operator<<(ostream & strm, H460_FeatureStd24::NatInstruct method) { return strm << H460_FeatureStd24::GetNATStrategyString(method); }

// Need to declare for Factory Loader
#if !defined(_WIN32_WCE)
    #if PTLIB_VER > 260
       PPLUGIN_STATIC_LOAD(Std24, H460_Feature);
    #else
       PWLIB_STATIC_LOAD_PLUGIN(Std24, H460_Feature);
    #endif
#endif

#endif