1/*
2    File:       IrIASServer.h
3
4    Contains:   Methods for implementing the irda info server
5
6*/
7
8
9#ifndef __IRIASSERVER_H
10#define __IRIASSERVER_H
11
12#include "IrDATypes.h"
13#include "IrStream.h"
14
15// Forward reference
16class TIrGlue;
17class TIrLMP;
18class TIASService;
19class TIASAttribute;
20class TLSAPConn;
21class CBufferSegment;
22
23// Constants
24
25enum IASServerReceiveStates
26{
27    kIASServerReceiveStart,
28    kIASServerReceiveWaitFinal,
29    kIASServerWaitingToDie              // jdg hacking
30};
31
32#define kIASServerBufferSize        128
33#define kIASMaxClassOrAttrStrLen    60
34
35
36// Classes
37
38// --------------------------------------------------------------------------------------------------------------------
39//                      TIASServer
40// --------------------------------------------------------------------------------------------------------------------
41
42class TIASServer : public TIrStream
43{
44	    OSDeclareDefaultStructors(TIASServer);
45
46    public:
47	    static TIASServer * tIASServer(TIrGlue *irda, TIASService* nameService);
48	    void                free(void);
49
50	    void                ListenStart();              // call this once to start it up
51
52    private:
53
54	    // TIrStream override
55	    void                NextState(ULong event);
56
57	    Boolean             Init(TIrGlue *irda, TIASService* nameService);
58	    void                GetStart();
59	    void                PutStart();
60	    void                ParseInput();
61	    TIASAttribute       *ParseRequest(UByte& iasReturnCode);
62	    Boolean             GotAValidString(UChar* string);
63	    void                SendResponse(UByte iasReturnCode, TIASAttribute* attrElement);
64
65	    // Fields�
66
67	    UByte               fOpCode;
68	    UByte               fReceiveState;
69
70	    TIASService         *fNameService;          // Name registry/lookup service
71
72	    TLSAPConn           *fLSAPConn;             // My connection "handle"
73	    TIrEvent            *fRequestReply;         // Our event buffer
74
75	    CBufferSegment      *fGetPutBuffer;
76};
77
78#endif // __IRIASSERVER_H
79