2 * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
4 * Copyright (c) 2006-2008, Thomas Bernard
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * * The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
34 #include "upnpdescgen.h"
36 char uuidvalue
[] = "uuid:12345678-0000-0000-0000-00000000abcd";
37 char friendly_name
[] = "localhost: system_type";
38 char serialnumber
[] = "12345678";
39 char modelname
[] = "MiniDLNA";
40 char modelnumber
[] = "1";
41 char presentationurl
[] = "http://192.168.0.1:8080/";
42 unsigned int updateID
= 0;
44 char pnpx_hwid
[] = "VEN_01F2&DEV_0101&REV_01 VEN_0033&DEV_0001&REV_01";
47 int getifaddr(const char * ifname
, char * buf
, int len
)
49 strncpy(buf
, "1.2.3.4", len
);
53 int upnp_get_portmapping_number_of_entries()
60 xml_pretty_print(const char * s
, int len
, FILE * f
)
71 if(len
>0 && *s
== '/')
73 else if(len
>0 && *s
== '?')
82 for(i
=indent
; i
>0; i
--)
92 /*fputc('\n', f); n++; */
97 else if(elt_close
== 0)
108 const char * str1
= "Prefix123String";
109 const char * str2
= "123String";
113 printf("str1:'%s' str2:'%s'\n", str1
, str2
);
114 printf("str1:%p str2:%p str2-str1:%ld\n", str1
, str2
, (long)(str2
-str1
));
120 main(int argc
, char * * argv
)
126 rootDesc
= genRootDesc(&rootDescLen
);
127 xml_pretty_print(rootDesc
, rootDescLen
, stdout
);
129 printf("\n----------------\n");
130 printf("ContentDirectory\n");
131 printf("----------------\n");
132 s
= genContentDirectory(&l
);
133 xml_pretty_print(s
, l
, stdout
);
135 printf("\n----------------\n");
136 printf("ConnectionManager\n");
137 printf("----------------\n");
138 s
= genConnectionManager(&l
);
139 xml_pretty_print(s
, l
, stdout
);
141 printf("\n----------------\n");
142 printf("X_MS_MRR\n");
143 printf("----------------\n");
144 s
= genX_MS_MediaReceiverRegistrar(&l
);
145 xml_pretty_print(s
, l
, stdout
);
147 printf("\n-------------\n");