|
a/libupnpp/upnpplib.cxx |
|
b/libupnpp/upnpplib.cxx |
|
... |
|
... |
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
#include "config.h"
|
17 |
#include "config.h"
|
18 |
|
18 |
|
19 |
#include <string.h>
|
19 |
#include <string.h>
|
|
|
20 |
#include <ctype.h>
|
20 |
|
21 |
|
21 |
#include <string>
|
22 |
#include <string>
|
22 |
#include <iostream>
|
23 |
#include <iostream>
|
23 |
#include <sstream>
|
24 |
#include <sstream>
|
24 |
#include <map>
|
25 |
#include <map>
|
|
... |
|
... |
33 |
extern "C" {
|
34 |
extern "C" {
|
34 |
#include "getsyshwaddr.h"
|
35 |
#include "getsyshwaddr.h"
|
35 |
}
|
36 |
}
|
36 |
#include "md5.hxx"
|
37 |
#include "md5.hxx"
|
37 |
#include "log.hxx"
|
38 |
#include "log.hxx"
|
|
|
39 |
#include "upnpputils.hxx"
|
|
|
40 |
|
|
|
41 |
namespace UPnPP {
|
38 |
|
42 |
|
39 |
static LibUPnP *theLib;
|
43 |
static LibUPnP *theLib;
|
40 |
|
44 |
|
41 |
LibUPnP *LibUPnP::getLibUPnP(bool serveronly, string* hwaddr,
|
45 |
LibUPnP *LibUPnP::getLibUPnP(bool serveronly, string* hwaddr,
|
42 |
const string ifname, const string ip,
|
46 |
const string ifname, const string ip,
|
|
... |
|
... |
419 |
return false;
|
423 |
return false;
|
420 |
}
|
424 |
}
|
421 |
return true;
|
425 |
return true;
|
422 |
}
|
426 |
}
|
423 |
|
427 |
|
424 |
#include <ctype.h>
|
|
|
425 |
|
|
|
426 |
// s1 is already uppercase
|
428 |
// s1 is already uppercase
|
427 |
int stringuppercmp(const string & s1, const string& s2)
|
429 |
int stringuppercmp(const string & s1, const string& s2)
|
428 |
{
|
430 |
{
|
429 |
string::const_iterator it1 = s1.begin();
|
431 |
string::const_iterator it1 = s1.begin();
|
430 |
string::const_iterator it2 = s2.begin();
|
432 |
string::const_iterator it2 = s2.begin();
|
|
... |
|
... |
450 |
}
|
452 |
}
|
451 |
return size1 == size2 ? 0 : -1;
|
453 |
return size1 == size2 ? 0 : -1;
|
452 |
}
|
454 |
}
|
453 |
}
|
455 |
}
|
454 |
|
456 |
|
455 |
#include "upnpputils.hxx"
|
|
|
456 |
|
|
|
457 |
namespace UPnPP {
|
|
|
458 |
|
|
|
459 |
static const long long BILLION = 1000 * 1000 * 1000;
|
457 |
static const long long BILLION = 1000 * 1000 * 1000;
|
460 |
|
458 |
|
461 |
void timespec_addnanos(struct timespec *ts, long long nanos)
|
459 |
void timespec_addnanos(struct timespec *ts, long long nanos)
|
462 |
{
|
460 |
{
|
463 |
nanos = nanos + ts->tv_nsec;
|
461 |
nanos = nanos + ts->tv_nsec;
|