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