PTLib  Version 2.18.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ssdp.h
Go to the documentation of this file.
1 /*
2  * ssdp.h
3  *
4  * Simple Service Discovery Protocol classes.
5  *
6  * Portable Tools Library
7  *
8  * Copyright (c) 2011 Vox Lucida Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Portable Windows Library.
21  *
22  * The Initial Developer of the Original Code is Vox Lucida Pty. Ltd.
23  *
24  * Contributor(s): ______________________________________.
25  */
26 
27 #ifndef PTLIB_SSDP_H
28 #define PTLIB_SSDP_H
29 
30 #ifdef P_USE_PRAGMA
31 #pragma interface
32 #endif
33 
34 #include <ptclib/http.h>
35 
36 
38 // PSSDP
39 
42 class PSSDP : public PHTTP
43 {
45 
46  public:
47  // New functions for class.
48  enum Commands {
52  };
53 
54  // Common MIME header tags
55  static const PCaselessString & MXTag();
56  static const PCaselessString & STTag();
57  static const PCaselessString & MANTag();
58  static const PCaselessString & USNTag();
59  static const PCaselessString & NickNameTag();
60 
63  PSSDP();
64 
67  bool Listen();
68 
73  bool Search(
74  const PString & urn,
75  PMIMEInfo & reply
76  );
77 
80  bool GetNotify(
81  PMIMEInfo & mime,
82  const PString & urnRegex = ".*"
83  );
84 
85  protected:
86  bool Close();
87 
89 };
90 
91 
92 #endif // PTLIB_SSDP_H
93 
94 
95 // End Of File ///////////////////////////////////////////////////////////////
This class contains the Multipurpose Internet Mail Extensions parameters and variables.
Definition: mime.h:48
Definition: ssdp.h:51
static const PCaselessString & NickNameTag()
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:2164
Definition: http.h:173
Definition: ssdp.h:49
bool m_listening
Definition: ssdp.h:88
bool Listen()
Listen for service notifications.
static const PCaselessString & USNTag()
This class is a variation of a string that ignores case.
Definition: pstring.h:2012
bool Search(const PString &urn, PMIMEInfo &reply)
Search for device with the specified URN.
Simple Service Discovery Protocol.
Definition: ssdp.h:42
The character string class.
Definition: pstring.h:108
static const PCaselessString & MANTag()
static const PCaselessString & STTag()
bool Close()
Close the channel.
Definition: ssdp.h:50
PSSDP()
Create a TCP/IP HTTP protocol channel.
bool GetNotify(PMIMEInfo &mime, const PString &urnRegex=".*")
Read a notification.
A common base class for TCP/IP socket for the HyperText Transfer Protocol version 1...
Definition: http.h:160
Commands
Definition: http.h:166
static const PCaselessString & MXTag()