summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-11-06 15:42:44 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-11-15 10:56:14 +0100
commite0b4edbdcc3558d3f38af8398f995c2e9f019f07 (patch)
treeea91a5fcfb9b6a66a8c0b74cf68ff8d450ce17e0
parentDisable or make static kern_* functions (diff)
downloadrtems-libbsd-e0b4edbdcc3558d3f38af8398f995c2e9f019f07.tar.bz2
Update to FreeBSD head 2018-11-15
Git mirror commit a18b0830c4be01b39489a891b63d6023ada6358a. Update #3472.
-rw-r--r--Makefile.todo4
m---------freebsd-org0
-rw-r--r--freebsd/contrib/expat/lib/ascii.h32
-rw-r--r--freebsd/contrib/expat/lib/asciitab.h32
-rw-r--r--freebsd/contrib/expat/lib/expat.h57
-rw-r--r--freebsd/contrib/expat/lib/expat_external.h89
-rw-r--r--freebsd/contrib/expat/lib/iasciitab.h32
-rw-r--r--freebsd/contrib/expat/lib/internal.h31
-rw-r--r--freebsd/contrib/expat/lib/latin1tab.h32
-rw-r--r--freebsd/contrib/expat/lib/nametab.h32
-rw-r--r--freebsd/contrib/expat/lib/siphash.h391
-rw-r--r--freebsd/contrib/expat/lib/utf8tab.h33
-rw-r--r--freebsd/contrib/expat/lib/xmlparse.c3583
-rw-r--r--freebsd/contrib/expat/lib/xmlrole.c72
-rw-r--r--freebsd/contrib/expat/lib/xmlrole.h32
-rw-r--r--freebsd/contrib/expat/lib/xmltok.c123
-rw-r--r--freebsd/contrib/expat/lib/xmltok.h37
-rw-r--r--freebsd/contrib/expat/lib/xmltok_impl.c132
-rw-r--r--freebsd/contrib/expat/lib/xmltok_impl.h31
-rw-r--r--freebsd/contrib/expat/lib/xmltok_ns.c33
-rw-r--r--freebsd/contrib/tcpdump/tcpdump.c2
-rw-r--r--freebsd/crypto/openssl/include/openssl/opensslv.h2
-rw-r--r--freebsd/lib/libc/net/nsdispatch.c11
-rw-r--r--freebsd/lib/libcapsicum/capsicum_helpers.h29
-rw-r--r--freebsd/sbin/dhclient/bpf.c8
-rw-r--r--freebsd/sbin/dhclient/dhclient.c22
-rw-r--r--freebsd/sbin/ifconfig/af_nd6.c8
-rw-r--r--freebsd/sbin/pfctl/parse.y8
-rw-r--r--freebsd/sbin/pfctl/pfctl_parser.c4
-rw-r--r--freebsd/sbin/ping/ping.c103
-rw-r--r--freebsd/sbin/route/route.c10
-rw-r--r--freebsd/sys/crypto/rijndael/rijndael-api-fst.c31
-rw-r--r--freebsd/sys/dev/e1000/em_txrx.c6
-rw-r--r--freebsd/sys/dev/e1000/igb_txrx.c6
-rw-r--r--freebsd/sys/dev/evdev/cdev.c13
-rw-r--r--freebsd/sys/dev/evdev/evdev.c44
-rw-r--r--freebsd/sys/dev/evdev/evdev_private.h12
-rw-r--r--freebsd/sys/dev/usb/controller/dwc_otg.c13
-rw-r--r--freebsd/sys/dev/usb/input/uhid.c21
-rw-r--r--freebsd/sys/dev/usb/input/ukbd.c2
-rw-r--r--freebsd/sys/fs/devfs/devfs_vnops.c44
-rw-r--r--freebsd/sys/kern/init_main.c2
-rw-r--r--freebsd/sys/kern/kern_mbuf.c14
-rw-r--r--freebsd/sys/kern/kern_sysctl.c47
-rw-r--r--freebsd/sys/kern/subr_blist.c597
-rw-r--r--freebsd/sys/kern/subr_gtaskqueue.c56
-rw-r--r--freebsd/sys/kern/sys_generic.c31
-rwxr-xr-xfreebsd/sys/kern/sys_pipe.c5
-rw-r--r--freebsd/sys/kern/tty.c11
-rw-r--r--freebsd/sys/kern/uipc_syscalls.c28
-rw-r--r--freebsd/sys/net/if.c21
-rw-r--r--freebsd/sys/net/if_ethersubr.c20
-rw-r--r--freebsd/sys/net/if_ipsec.c21
-rw-r--r--freebsd/sys/net/if_lagg.c67
-rw-r--r--freebsd/sys/net/if_stf.c3
-rw-r--r--freebsd/sys/net/if_var.h2
-rw-r--r--freebsd/sys/net/pfvar.h35
-rw-r--r--freebsd/sys/netinet/icmp6.h4
-rw-r--r--freebsd/sys/netinet/in_gif.c5
-rw-r--r--freebsd/sys/netinet/in_mcast.c20
-rw-r--r--freebsd/sys/netinet/in_pcb.c59
-rw-r--r--freebsd/sys/netinet/ip_carp.c15
-rw-r--r--freebsd/sys/netinet/ip_gre.c5
-rw-r--r--freebsd/sys/netinet/ip_icmp.c6
-rw-r--r--freebsd/sys/netinet/ip_input.c7
-rw-r--r--freebsd/sys/netinet/ip_reass.c10
-rw-r--r--freebsd/sys/netinet/sctp_output.c4
-rw-r--r--freebsd/sys/netinet/sctp_sysctl.h40
-rw-r--r--freebsd/sys/netinet/tcp_syncache.c21
-rw-r--r--freebsd/sys/netinet6/in6_gif.c5
-rw-r--r--freebsd/sys/netinet6/in6_ifattach.c13
-rw-r--r--freebsd/sys/netinet6/in6_pcb.c6
-rw-r--r--freebsd/sys/netinet6/nd6.h3
-rw-r--r--freebsd/sys/netinet6/nd6_rtr.c38
-rw-r--r--freebsd/sys/netinet6/raw_ip6.c86
-rw-r--r--freebsd/sys/netpfil/pf/if_pfsync.c76
-rw-r--r--freebsd/sys/netpfil/pf/pf.c44
-rw-r--r--freebsd/sys/netpfil/pf/pf_if.c20
-rw-r--r--freebsd/sys/netpfil/pf/pf_ioctl.c22
-rw-r--r--freebsd/sys/netpfil/pf/pf_norm.c294
-rw-r--r--freebsd/sys/netpfil/pf/pf_table.c1
-rw-r--r--freebsd/sys/opencrypto/xform_auth.h2
-rw-r--r--freebsd/sys/security/audit/audit.h2
-rw-r--r--freebsd/sys/sys/_domainset.h2
-rw-r--r--freebsd/sys/sys/blist.h8
-rw-r--r--freebsd/sys/sys/capability.h3
-rw-r--r--freebsd/sys/sys/domainset.h3
-rw-r--r--freebsd/sys/sys/gtaskqueue.h5
-rw-r--r--freebsd/sys/sys/malloc.h10
-rw-r--r--freebsd/sys/sys/mount.h47
-rw-r--r--freebsd/sys/sys/mouse.h6
-rw-r--r--freebsd/sys/sys/proc.h6
-rw-r--r--freebsd/sys/sys/random.h3
-rw-r--r--freebsd/sys/sys/socketvar.h3
-rw-r--r--freebsd/sys/sys/sysctl.h39
-rw-r--r--freebsd/sys/sys/sysproto.h206
-rw-r--r--freebsd/sys/sys/systm.h3
-rw-r--r--freebsd/sys/sys/tty.h8
-rw-r--r--freebsd/sys/sys/vnode.h2
-rw-r--r--freebsd/sys/vm/uma_core.c271
-rw-r--r--freebsd/sys/vm/uma_int.h12
-rw-r--r--freebsd/sys/vm/vm_extern.h14
-rw-r--r--libbsd.py3
-rw-r--r--rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h17
-rw-r--r--rtemsbsd/include/vm/vm_domainset.h0
-rw-r--r--rtemsbsd/rtems/rtems-bsd-regdomain.c1152
106 files changed, 5543 insertions, 3255 deletions
diff --git a/Makefile.todo b/Makefile.todo
index 6239ef40..59e630e1 100644
--- a/Makefile.todo
+++ b/Makefile.todo
@@ -267,10 +267,10 @@ freebsd/usr.bin/netstat/nl_defs.h: $(FREEBSD_SRC)/usr.bin/netstat/nlist_symbols
!/^\#/ { printf("\#define\tN%s\t%s\n", toupper($$2), i++); }' \
< $< > $@ || rm -f $@
-rtemsbsd/include/machine/rtems-bsd-regdomain.h: $(FREEBSD_SRC)/etc/regdomain.xml
+rtemsbsd/include/machine/rtems-bsd-regdomain.h: $(FREEBSD_SRC)/lib/lib80211/regdomain.xml
rtems-bin2c -H $< $@
-rtemsbsd/rtems/rtems-bsd-regdomain.c: $(FREEBSD_SRC)/etc/regdomain.xml
+rtemsbsd/rtems/rtems-bsd-regdomain.c: $(FREEBSD_SRC)/lib/lib80211/regdomain.xml
rtems-bin2c -C $< $@
freebsd/contrib/libpcap/pcap_version.h: freebsd-org/contrib/libpcap/VERSION
diff --git a/freebsd-org b/freebsd-org
-Subproject 59f44d20be3f99d181ca742e636d45fc39ec982
+Subproject ece78450d2aed2b8677345976269d5f2259c925
diff --git a/freebsd/contrib/expat/lib/ascii.h b/freebsd/contrib/expat/lib/ascii.h
index d10530b0..c3587e57 100644
--- a/freebsd/contrib/expat/lib/ascii.h
+++ b/freebsd/contrib/expat/lib/ascii.h
@@ -1,5 +1,33 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define ASCII_A 0x41
diff --git a/freebsd/contrib/expat/lib/asciitab.h b/freebsd/contrib/expat/lib/asciitab.h
index 79a15c28..2f59fd92 100644
--- a/freebsd/contrib/expat/lib/asciitab.h
+++ b/freebsd/contrib/expat/lib/asciitab.h
@@ -1,5 +1,33 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
diff --git a/freebsd/contrib/expat/lib/expat.h b/freebsd/contrib/expat/lib/expat.h
index 086e24b3..174c3faf 100644
--- a/freebsd/contrib/expat/lib/expat.h
+++ b/freebsd/contrib/expat/lib/expat.h
@@ -1,5 +1,33 @@
-/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef Expat_INCLUDED
@@ -24,7 +52,6 @@ extern "C" {
struct XML_ParserStruct;
typedef struct XML_ParserStruct *XML_Parser;
-/* Should this be defined using stdbool.h when C99 is available? */
typedef unsigned char XML_Bool;
#define XML_TRUE ((XML_Bool) 1)
#define XML_FALSE ((XML_Bool) 0)
@@ -95,7 +122,9 @@ enum XML_Error {
/* Added in 2.0. */
XML_ERROR_RESERVED_PREFIX_XML,
XML_ERROR_RESERVED_PREFIX_XMLNS,
- XML_ERROR_RESERVED_NAMESPACE_URI
+ XML_ERROR_RESERVED_NAMESPACE_URI,
+ /* Added in 2.2.1. */
+ XML_ERROR_INVALID_ARGUMENT
};
enum XML_Content_Type {
@@ -235,7 +264,7 @@ XML_ParserCreate_MM(const XML_Char *encoding,
const XML_Char *namespaceSeparator);
/* Prepare a parser object to be re-used. This is particularly
- valuable when memory allocation overhead is disproportionatly high,
+ valuable when memory allocation overhead is disproportionately high,
such as when a large number of small documnents need to be parsed.
All handlers are cleared from the parser, except for the
unknownEncodingHandler. The parser's external state is re-initialized
@@ -706,6 +735,7 @@ XML_UseParserAsHandlerArg(XML_Parser parser);
be called, despite an external subset being parsed.
Note: If XML_DTD is not defined when Expat is compiled, returns
XML_ERROR_FEATURE_REQUIRES_XML_DTD.
+ Note: If parser == NULL, returns XML_ERROR_INVALID_ARGUMENT.
*/
XMLPARSEAPI(enum XML_Error)
XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
@@ -729,15 +759,16 @@ XML_GetBase(XML_Parser parser);
to the XML_StartElementHandler that were specified in the start-tag
rather than defaulted. Each attribute/value pair counts as 2; thus
this correspondds to an index into the atts array passed to the
- XML_StartElementHandler.
+ XML_StartElementHandler. Returns -1 if parser == NULL.
*/
XMLPARSEAPI(int)
XML_GetSpecifiedAttributeCount(XML_Parser parser);
/* Returns the index of the ID attribute passed in the last call to
- XML_StartElementHandler, or -1 if there is no ID attribute. Each
- attribute/value pair counts as 2; thus this correspondds to an
- index into the atts array passed to the XML_StartElementHandler.
+ XML_StartElementHandler, or -1 if there is no ID attribute or
+ parser == NULL. Each attribute/value pair counts as 2; thus this
+ correspondds to an index into the atts array passed to the
+ XML_StartElementHandler.
*/
XMLPARSEAPI(int)
XML_GetIdAttributeIndex(XML_Parser parser);
@@ -901,6 +932,7 @@ enum XML_ParamEntityParsing {
entities is requested; otherwise it will return non-zero.
Note: If XML_SetParamEntityParsing is called after XML_Parse or
XML_ParseBuffer, then it has no effect and will always return 0.
+ Note: If parser == NULL, the function will do nothing and return 0.
*/
XMLPARSEAPI(int)
XML_SetParamEntityParsing(XML_Parser parser,
@@ -910,6 +942,7 @@ XML_SetParamEntityParsing(XML_Parser parser,
Helps in preventing DoS attacks based on predicting hash
function behavior. This must be called before parsing is started.
Returns 1 if successful, 0 when called after parsing has started.
+ Note: If parser == NULL, the function will do nothing and return 0.
*/
XMLPARSEAPI(int)
XML_SetHashSalt(XML_Parser parser,
@@ -936,6 +969,10 @@ XML_GetErrorCode(XML_Parser parser);
the location is the location of the character at which the error
was detected; otherwise the location is the location of the last
parse event, as described above.
+
+ Note: XML_GetCurrentLineNumber and XML_GetCurrentColumnNumber
+ return 0 to indicate an error.
+ Note: XML_GetCurrentByteIndex returns -1 to indicate an error.
*/
XMLPARSEAPI(XML_Size) XML_GetCurrentLineNumber(XML_Parser parser);
XMLPARSEAPI(XML_Size) XML_GetCurrentColumnNumber(XML_Parser parser);
@@ -1039,7 +1076,7 @@ XML_GetFeatureList(void);
*/
#define XML_MAJOR_VERSION 2
#define XML_MINOR_VERSION 2
-#define XML_MICRO_VERSION 0
+#define XML_MICRO_VERSION 6
#ifdef __cplusplus
}
diff --git a/freebsd/contrib/expat/lib/expat_external.h b/freebsd/contrib/expat/lib/expat_external.h
index aa08a2f8..629483a9 100644
--- a/freebsd/contrib/expat/lib/expat_external.h
+++ b/freebsd/contrib/expat/lib/expat_external.h
@@ -1,5 +1,33 @@
-/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef Expat_External_INCLUDED
@@ -8,7 +36,7 @@
/* External API definitions */
#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
-#define XML_USE_MSC_EXTENSIONS 1
+# define XML_USE_MSC_EXTENSIONS 1
#endif
/* Expat tries very hard to make the API boundary very specifically
@@ -34,11 +62,11 @@
system headers may assume the cdecl convention.
*/
#ifndef XMLCALL
-#if defined(_MSC_VER)
-#define XMLCALL __cdecl
-#elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
-#define XMLCALL __attribute__((cdecl))
-#else
+# if defined(_MSC_VER)
+# define XMLCALL __cdecl
+# elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
+# define XMLCALL __attribute__((cdecl))
+# else
/* For any platform which uses this definition and supports more than
one calling convention, we need to extend this definition to
declare the convention used on that platform, if it's possible to
@@ -49,41 +77,41 @@
pre-processor and how to specify the same calling convention as the
platform's malloc() implementation.
*/
-#define XMLCALL
-#endif
+# define XMLCALL
+# endif
#endif /* not defined XMLCALL */
#if !defined(XML_STATIC) && !defined(XMLIMPORT)
-#ifndef XML_BUILDING_EXPAT
+# ifndef XML_BUILDING_EXPAT
/* using Expat from an application */
-#ifdef XML_USE_MSC_EXTENSIONS
-#define XMLIMPORT __declspec(dllimport)
-#endif
+# ifdef XML_USE_MSC_EXTENSIONS
+# define XMLIMPORT __declspec(dllimport)
+# endif
-#endif
+# endif
#endif /* not defined XML_STATIC */
#if !defined(XMLIMPORT) && defined(__GNUC__) && (__GNUC__ >= 4)
-#define XMLIMPORT __attribute__ ((visibility ("default")))
+# define XMLIMPORT __attribute__ ((visibility ("default")))
#endif
/* If we didn't define it above, define it away: */
#ifndef XMLIMPORT
-#define XMLIMPORT
+# define XMLIMPORT
#endif
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
-#define XML_ATTR_MALLOC __attribute__((__malloc__))
+# define XML_ATTR_MALLOC __attribute__((__malloc__))
#else
-#define XML_ATTR_MALLOC
+# define XML_ATTR_MALLOC
#endif
#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
-#define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
+# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
#else
-#define XML_ATTR_ALLOC_SIZE(x)
+# define XML_ATTR_ALLOC_SIZE(x)
#endif
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
@@ -93,30 +121,35 @@ extern "C" {
#endif
#ifdef XML_UNICODE_WCHAR_T
-#define XML_UNICODE
+# ifndef XML_UNICODE
+# define XML_UNICODE
+# endif
+# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
+# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
+# endif
#endif
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
-#ifdef XML_UNICODE_WCHAR_T
+# ifdef XML_UNICODE_WCHAR_T
typedef wchar_t XML_Char;
typedef wchar_t XML_LChar;
-#else
+# else
typedef unsigned short XML_Char;
typedef char XML_LChar;
-#endif /* XML_UNICODE_WCHAR_T */
+# endif /* XML_UNICODE_WCHAR_T */
#else /* Information is UTF-8 encoded. */
typedef char XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE */
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
-#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
+# if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
typedef __int64 XML_Index;
typedef unsigned __int64 XML_Size;
-#else
+# else
typedef long long XML_Index;
typedef unsigned long long XML_Size;
-#endif
+# endif
#else
typedef long XML_Index;
typedef unsigned long XML_Size;
diff --git a/freebsd/contrib/expat/lib/iasciitab.h b/freebsd/contrib/expat/lib/iasciitab.h
index 24a1d5cc..ce4a4bf7 100644
--- a/freebsd/contrib/expat/lib/iasciitab.h
+++ b/freebsd/contrib/expat/lib/iasciitab.h
@@ -1,5 +1,33 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
diff --git a/freebsd/contrib/expat/lib/internal.h b/freebsd/contrib/expat/lib/internal.h
index 94cb98e1..e33fdcb0 100644
--- a/freebsd/contrib/expat/lib/internal.h
+++ b/freebsd/contrib/expat/lib/internal.h
@@ -18,6 +18,35 @@
Note: Use of these macros is based on judgement, not hard rules,
and therefore subject to change.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__)
@@ -87,7 +116,7 @@ extern "C" {
void
-align_limit_to_full_utf8_characters(const char * from, const char ** fromLimRef);
+_INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef);
#ifdef __cplusplus
diff --git a/freebsd/contrib/expat/lib/latin1tab.h b/freebsd/contrib/expat/lib/latin1tab.h
index 53c25d76..95dfa52b 100644
--- a/freebsd/contrib/expat/lib/latin1tab.h
+++ b/freebsd/contrib/expat/lib/latin1tab.h
@@ -1,5 +1,33 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
diff --git a/freebsd/contrib/expat/lib/nametab.h b/freebsd/contrib/expat/lib/nametab.h
index b05e62c7..bfa2bd38 100644
--- a/freebsd/contrib/expat/lib/nametab.h
+++ b/freebsd/contrib/expat/lib/nametab.h
@@ -1,3 +1,35 @@
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
static const unsigned namingBitmap[] = {
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
diff --git a/freebsd/contrib/expat/lib/siphash.h b/freebsd/contrib/expat/lib/siphash.h
new file mode 100644
index 00000000..4d6786d7
--- /dev/null
+++ b/freebsd/contrib/expat/lib/siphash.h
@@ -0,0 +1,391 @@
+/* ==========================================================================
+ * siphash.h - SipHash-2-4 in a single header file
+ * --------------------------------------------------------------------------
+ * Derived by William Ahern from the reference implementation[1] published[2]
+ * by Jean-Philippe Aumasson and Daniel J. Berstein.
+ * Minimal changes by Sebastian Pipping and Victor Stinner on top, see below.
+ * Licensed under the CC0 Public Domain Dedication license.
+ *
+ * 1. https://www.131002.net/siphash/siphash24.c
+ * 2. https://www.131002.net/siphash/
+ * --------------------------------------------------------------------------
+ * HISTORY:
+ *
+ * 2018-07-08 (Anton Maklakov)
+ * - Add "fall through" markers for GCC's -Wimplicit-fallthrough
+ *
+ * 2017-11-03 (Sebastian Pipping)
+ * - Hide sip_tobin and sip_binof unless SIPHASH_TOBIN macro is defined
+ *
+ * 2017-07-25 (Vadim Zeitlin)
+ * - Fix use of SIPHASH_MAIN macro
+ *
+ * 2017-07-05 (Sebastian Pipping)
+ * - Use _SIP_ULL macro to not require a C++11 compiler if compiled as C++
+ * - Add const qualifiers at two places
+ * - Ensure <=80 characters line length (assuming tab width 4)
+ *
+ * 2017-06-23 (Victor Stinner)
+ * - Address Win64 compile warnings
+ *
+ * 2017-06-18 (Sebastian Pipping)
+ * - Clarify license note in the header
+ * - Address C89 issues:
+ * - Stop using inline keyword (and let compiler decide)
+ * - Replace _Bool by int
+ * - Turn macro siphash24 into a function
+ * - Address invalid conversion (void pointer) by explicit cast
+ * - Address lack of stdint.h for Visual Studio 2003 to 2008
+ * - Always expose sip24_valid (for self-tests)
+ *
+ * 2012-11-04 - Born. (William Ahern)
+ * --------------------------------------------------------------------------
+ * USAGE:
+ *
+ * SipHash-2-4 takes as input two 64-bit words as the key, some number of
+ * message bytes, and outputs a 64-bit word as the message digest. This
+ * implementation employs two data structures: a struct sipkey for
+ * representing the key, and a struct siphash for representing the hash
+ * state.
+ *
+ * For converting a 16-byte unsigned char array to a key, use either the
+ * macro sip_keyof or the routine sip_tokey. The former instantiates a
+ * compound literal key, while the latter requires a key object as a
+ * parameter.
+ *
+ * unsigned char secret[16];
+ * arc4random_buf(secret, sizeof secret);
+ * struct sipkey *key = sip_keyof(secret);
+ *
+ * For hashing a message, use either the convenience macro siphash24 or the
+ * routines sip24_init, sip24_update, and sip24_final.
+ *
+ * struct siphash state;
+ * void *msg;
+ * size_t len;
+ * uint64_t hash;
+ *
+ * sip24_init(&state, key);
+ * sip24_update(&state, msg, len);
+ * hash = sip24_final(&state);
+ *
+ * or
+ *
+ * hash = siphash24(msg, len, key);
+ *
+ * To convert the 64-bit hash value to a canonical 8-byte little-endian
+ * binary representation, use either the macro sip_binof or the routine
+ * sip_tobin. The former instantiates and returns a compound literal array,
+ * while the latter requires an array object as a parameter.
+ * --------------------------------------------------------------------------
+ * NOTES:
+ *
+ * o Neither sip_keyof, sip_binof, nor siphash24 will work with compilers
+ * lacking compound literal support. Instead, you must use the lower-level
+ * interfaces which take as parameters the temporary state objects.
+ *
+ * o Uppercase macros may evaluate parameters more than once. Lowercase
+ * macros should not exhibit any such side effects.
+ * ==========================================================================
+ */
+#ifndef SIPHASH_H
+#define SIPHASH_H
+
+#include <stddef.h> /* size_t */
+
+#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600)
+ /* For vs2003/7.1 up to vs2008/9.0; _MSC_VER 1600 is vs2010/10.0 */
+ typedef unsigned __int8 uint8_t;
+ typedef unsigned __int32 uint32_t;
+ typedef unsigned __int64 uint64_t;
+#else
+ #include <stdint.h> /* uint64_t uint32_t uint8_t */
+#endif
+
+
+/*
+ * Workaround to not require a C++11 compiler for using ULL suffix
+ * if this code is included and compiled as C++; related GCC warning is:
+ * warning: use of C++11 long long integer constant [-Wlong-long]
+ */
+#define _SIP_ULL(high, low) (((uint64_t)high << 32) | low)
+
+
+#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ( (x) >> (64 - (b))))
+
+#define SIP_U32TO8_LE(p, v) \
+ (p)[0] = (uint8_t)((v) >> 0); (p)[1] = (uint8_t)((v) >> 8); \
+ (p)[2] = (uint8_t)((v) >> 16); (p)[3] = (uint8_t)((v) >> 24);
+
+#define SIP_U64TO8_LE(p, v) \
+ SIP_U32TO8_LE((p) + 0, (uint32_t)((v) >> 0)); \
+ SIP_U32TO8_LE((p) + 4, (uint32_t)((v) >> 32));
+
+#define SIP_U8TO64_LE(p) \
+ (((uint64_t)((p)[0]) << 0) | \
+ ((uint64_t)((p)[1]) << 8) | \
+ ((uint64_t)((p)[2]) << 16) | \
+ ((uint64_t)((p)[3]) << 24) | \
+ ((uint64_t)((p)[4]) << 32) | \
+ ((uint64_t)((p)[5]) << 40) | \
+ ((uint64_t)((p)[6]) << 48) | \
+ ((uint64_t)((p)[7]) << 56))
+
+
+#define SIPHASH_INITIALIZER { 0, 0, 0, 0, { 0 }, 0, 0 }
+
+struct siphash {
+ uint64_t v0, v1, v2, v3;
+
+ unsigned char buf[8], *p;
+ uint64_t c;
+}; /* struct siphash */
+
+
+#define SIP_KEYLEN 16
+
+struct sipkey {
+ uint64_t k[2];
+}; /* struct sipkey */
+
+#define sip_keyof(k) sip_tokey(&(struct sipkey){ { 0 } }, (k))
+
+static struct sipkey *sip_tokey(struct sipkey *key, const void *src) {
+ key->k[0] = SIP_U8TO64_LE((const unsigned char *)src);
+ key->k[1] = SIP_U8TO64_LE((const unsigned char *)src + 8);
+ return key;
+} /* sip_tokey() */
+
+
+#ifdef SIPHASH_TOBIN
+
+#define sip_binof(v) sip_tobin((unsigned char[8]){ 0 }, (v))
+
+static void *sip_tobin(void *dst, uint64_t u64) {
+ SIP_U64TO8_LE((unsigned char *)dst, u64);
+ return dst;
+} /* sip_tobin() */
+
+#endif /* SIPHASH_TOBIN */
+
+
+static void sip_round(struct siphash *H, const int rounds) {
+ int i;
+
+ for (i = 0; i < rounds; i++) {
+ H->v0 += H->v1;
+ H->v1 = SIP_ROTL(H->v1, 13);
+ H->v1 ^= H->v0;
+ H->v0 = SIP_ROTL(H->v0, 32);
+
+ H->v2 += H->v3;
+ H->v3 = SIP_ROTL(H->v3, 16);
+ H->v3 ^= H->v2;
+
+ H->v0 += H->v3;
+ H->v3 = SIP_ROTL(H->v3, 21);
+ H->v3 ^= H->v0;
+
+ H->v2 += H->v1;
+ H->v1 = SIP_ROTL(H->v1, 17);
+ H->v1 ^= H->v2;
+ H->v2 = SIP_ROTL(H->v2, 32);
+ }
+} /* sip_round() */
+
+
+static struct siphash *sip24_init(struct siphash *H,
+ const struct sipkey *key) {
+ H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0];
+ H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1];
+ H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0];
+ H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1];
+
+ H->p = H->buf;
+ H->c = 0;
+
+ return H;
+} /* sip24_init() */
+
+
+#define sip_endof(a) (&(a)[sizeof (a) / sizeof *(a)])
+
+static struct siphash *sip24_update(struct siphash *H, const void *src,
+ size_t len) {
+ const unsigned char *p = (const unsigned char *)src, *pe = p + len;
+ uint64_t m;
+
+ do {
+ while (p < pe && H->p < sip_endof(H->buf))
+ *H->p++ = *p++;
+
+ if (H->p < sip_endof(H->buf))
+ break;
+
+ m = SIP_U8TO64_LE(H->buf);
+ H->v3 ^= m;
+ sip_round(H, 2);
+ H->v0 ^= m;
+
+ H->p = H->buf;
+ H->c += 8;
+ } while (p < pe);
+
+ return H;
+} /* sip24_update() */
+
+
+static uint64_t sip24_final(struct siphash *H) {
+ const char left = (char)(H->p - H->buf);
+ uint64_t b = (H->c + left) << 56;
+
+ switch (left) {
+ case 7: b |= (uint64_t)H->buf[6] << 48;
+ /* fall through */
+ case 6: b |= (uint64_t)H->buf[5] << 40;
+ /* fall through */
+ case 5: b |= (uint64_t)H->buf[4] << 32;
+ /* fall through */
+ case 4: b |= (uint64_t)H->buf[3] << 24;
+ /* fall through */
+ case 3: b |= (uint64_t)H->buf[2] << 16;
+ /* fall through */
+ case 2: b |= (uint64_t)H->buf[1] << 8;
+ /* fall through */
+ case 1: b |= (uint64_t)H->buf[0] << 0;
+ /* fall through */
+ case 0: break;
+ }
+
+ H->v3 ^= b;
+ sip_round(H, 2);
+ H->v0 ^= b;
+ H->v2 ^= 0xff;
+ sip_round(H, 4);
+
+ return H->v0 ^ H->v1 ^ H->v2 ^ H->v3;
+} /* sip24_final() */
+
+
+static uint64_t siphash24(const void *src, size_t len,
+ const struct sipkey *key) {
+ struct siphash state = SIPHASH_INITIALIZER;
+ return sip24_final(sip24_update(sip24_init(&state, key), src, len));
+} /* siphash24() */
+
+
+/*
+ * SipHash-2-4 output with
+ * k = 00 01 02 ...
+ * and
+ * in = (empty string)
+ * in = 00 (1 byte)
+ * in = 00 01 (2 bytes)
+ * in = 00 01 02 (3 bytes)
+ * ...
+ * in = 00 01 02 ... 3e (63 bytes)
+ */
+static int sip24_valid(void) {
+ static const unsigned char vectors[64][8] = {
+ { 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, },
+ { 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, },
+ { 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, },
+ { 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, },
+ { 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, },
+ { 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, },
+ { 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, },
+ { 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, },
+ { 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, },
+ { 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, },
+ { 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, },
+ { 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, },
+ { 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, },
+ { 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, },
+ { 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, },
+ { 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, },
+ { 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, },
+ { 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, },
+ { 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, },
+ { 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, },
+ { 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, },
+ { 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, },
+ { 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, },
+ { 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, },
+ { 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, },
+ { 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, },
+ { 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, },
+ { 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, },
+ { 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, },
+ { 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, },
+ { 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, },
+ { 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, },
+ { 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, },
+ { 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, },
+ { 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, },
+ { 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, },
+ { 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, },
+ { 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, },
+ { 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, },
+ { 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, },
+ { 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, },
+ { 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, },
+ { 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, },
+ { 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, },
+ { 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, },
+ { 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, },
+ { 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, },
+ { 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, },
+ { 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, },
+ { 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, },
+ { 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, },
+ { 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, },
+ { 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, },
+ { 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, },
+ { 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, },
+ { 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, },
+ { 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, },
+ { 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, },
+ { 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, },
+ { 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, },
+ { 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, },
+ { 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, },
+ { 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, },
+ { 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, }
+ };
+ unsigned char in[64];
+ struct sipkey k;
+ size_t i;
+
+ sip_tokey(&k, "\000\001\002\003\004\005\006\007\010\011"
+ "\012\013\014\015\016\017");
+
+ for (i = 0; i < sizeof in; ++i) {
+ in[i] = (unsigned char)i;
+
+ if (siphash24(in, i, &k) != SIP_U8TO64_LE(vectors[i]))
+ return 0;
+ }
+
+ return 1;
+} /* sip24_valid() */
+
+
+#ifdef SIPHASH_MAIN
+
+#include <stdio.h>
+
+int main(void) {
+ const int ok = sip24_valid();
+
+ if (ok)
+ puts("OK");
+ else
+ puts("FAIL");
+
+ return !ok;
+} /* main() */
+
+#endif /* SIPHASH_MAIN */
+
+
+#endif /* SIPHASH_H */
diff --git a/freebsd/contrib/expat/lib/utf8tab.h b/freebsd/contrib/expat/lib/utf8tab.h
index 7bb3e776..fa0bed6f 100644
--- a/freebsd/contrib/expat/lib/utf8tab.h
+++ b/freebsd/contrib/expat/lib/utf8tab.h
@@ -1,7 +1,34 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
-*/
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
diff --git a/freebsd/contrib/expat/lib/xmlparse.c b/freebsd/contrib/expat/lib/xmlparse.c
index 868a7b3f..2c607e6b 100644
--- a/freebsd/contrib/expat/lib/xmlparse.c
+++ b/freebsd/contrib/expat/lib/xmlparse.c
@@ -1,38 +1,117 @@
#include <machine/rtems-bsd-user-space.h>
-/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/* 19ac4776051591216f1874e34ee99b6a43a3784c8bd7d70efeb9258dd22b906a (2.2.6+)
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#if !defined(_GNU_SOURCE)
+# define _GNU_SOURCE 1 /* syscall prototype */
+#endif
+
#include <stddef.h>
#include <string.h> /* memset(), memcpy() */
#include <assert.h>
#include <limits.h> /* UINT_MAX */
+#include <stdio.h> /* fprintf */
+#include <stdlib.h> /* getenv */
-#ifdef WIN32
+#ifdef _WIN32
#define getpid GetCurrentProcessId
#else
#include <sys/time.h> /* gettimeofday() */
#include <sys/types.h> /* getpid() */
#include <unistd.h> /* getpid() */
+#include <fcntl.h> /* O_RDONLY */
+#include <errno.h>
#endif
#define XML_BUILDING_EXPAT 1
-#ifdef WIN32
+#ifdef _WIN32
#include "winconfig.h"
-#elif defined(MACOS_CLASSIC)
-#include "macconfig.h"
-#elif defined(__amigaos__)
-#include "amigaconfig.h"
-#elif defined(__WATCOMC__)
-#include "watcomconfig.h"
#elif defined(HAVE_EXPAT_CONFIG_H)
#include <expat_config.h>
-#endif /* ndef WIN32 */
+#endif /* ndef _WIN32 */
#include "ascii.h"
#include "expat.h"
+#include "siphash.h"
+
+#if defined(HAVE_GETRANDOM) || defined(HAVE_SYSCALL_GETRANDOM)
+# if defined(HAVE_GETRANDOM)
+# include <sys/random.h> /* getrandom */
+# else
+# include <unistd.h> /* syscall */
+# include <sys/syscall.h> /* SYS_getrandom */
+# endif
+# if ! defined(GRND_NONBLOCK)
+# define GRND_NONBLOCK 0x0001
+# endif /* defined(GRND_NONBLOCK) */
+#endif /* defined(HAVE_GETRANDOM) || defined(HAVE_SYSCALL_GETRANDOM) */
+
+#if defined(HAVE_LIBBSD) \
+ && (defined(HAVE_ARC4RANDOM_BUF) || defined(HAVE_ARC4RANDOM))
+# include <bsd/stdlib.h>
+#endif
+
+#if defined(_WIN32) && !defined(LOAD_LIBRARY_SEARCH_SYSTEM32)
+# define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800
+#endif
+
+#if !defined(HAVE_GETRANDOM) && !defined(HAVE_SYSCALL_GETRANDOM) \
+ && !defined(HAVE_ARC4RANDOM_BUF) && !defined(HAVE_ARC4RANDOM) \
+ && !defined(XML_DEV_URANDOM) \
+ && !defined(_WIN32) \
+ && !defined(XML_POOR_ENTROPY)
+# error \
+ You do not have support for any sources of high quality entropy \
+ enabled. For end user security, that is probably not what you want. \
+ \
+ Your options include: \
+ * Linux + glibc >=2.25 (getrandom): HAVE_GETRANDOM, \
+ * Linux + glibc <2.25 (syscall SYS_getrandom): HAVE_SYSCALL_GETRANDOM, \
+ * BSD / macOS >=10.7 (arc4random_buf): HAVE_ARC4RANDOM_BUF, \
+ * BSD / macOS <10.7 (arc4random): HAVE_ARC4RANDOM, \
+ * libbsd (arc4random_buf): HAVE_ARC4RANDOM_BUF + HAVE_LIBBSD, \
+ * libbsd (arc4random): HAVE_ARC4RANDOM + HAVE_LIBBSD, \
+ * Linux / BSD / macOS (/dev/urandom): XML_DEV_URANDOM \
+ * Windows (RtlGenRandom): _WIN32. \
+ \
+ If insist on not using any of these, bypass this error by defining \
+ XML_POOR_ENTROPY; you have been warned. \
+ \
+ If you have reasons to patch this detection code away or need changes \
+ to the build system, please open a bug. Thank you!
+#endif
+
#ifdef XML_UNICODE
#define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX
@@ -84,6 +163,9 @@ typedef char ICHAR;
/* Round up n to be a multiple of sz, where sz is a power of 2. */
#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1))
+/* Do safe (NULL-aware) pointer arithmetic */
+#define EXPAT_SAFE_PTR_DIFF(p, q) (((p) && (q)) ? ((p) - (q)) : 0)
+
/* Handle the case where memmove() doesn't exist. */
#ifndef HAVE_MEMMOVE
#ifdef HAVE_BCOPY
@@ -111,17 +193,11 @@ typedef struct {
const XML_Memory_Handling_Suite *mem;
} HASH_TABLE;
-/* Basic character hash algorithm, taken from Python's string hash:
- h = h * 1000003 ^ character, the constant being a prime number.
+static size_t
+keylen(KEY s);
-*/
-#ifdef XML_UNICODE
-#define CHAR_HASH(h, c) \
- (((h) * 0xF4243) ^ (unsigned short)(c))
-#else
-#define CHAR_HASH(h, c) \
- (((h) * 0xF4243) ^ (unsigned char)(c))
-#endif
+static void
+copy_salt_to_sipkey(XML_Parser parser, struct sipkey * key);
/* For probing (after a collision) we need a step size relative prime
to the hash table size, which is a power of 2. We use double-hashing,
@@ -357,6 +433,8 @@ doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr,
const char *end, const char **nextPtr, XML_Bool haveMore);
#endif /* XML_DTD */
+static void
+freeBindings(XML_Parser parser, BINDING *bindings);
static enum XML_Error
storeAtts(XML_Parser parser, const ENCODING *, const char *s,
TAG_NAME *tagNamePtr, BINDING **bindingsPtr);
@@ -397,7 +475,7 @@ setContext(XML_Parser parser, const XML_Char *context);
static void FASTCALL normalizePublicId(XML_Char *s);
static DTD * dtdCreate(const XML_Memory_Handling_Suite *ms);
-/* do not call if parentParser != NULL */
+/* do not call if m_parentParser != NULL */
static void dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms);
static void
dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms);
@@ -441,6 +519,9 @@ static ELEMENT_TYPE *
getElementType(XML_Parser parser, const ENCODING *enc,
const char *ptr, const char *end);
+static XML_Char *copyString(const XML_Char *s,
+ const XML_Memory_Handling_Suite *memsuite);
+
static unsigned long generate_hash_secret_salt(XML_Parser parser);
static XML_Bool startParsing(XML_Parser parser);
@@ -466,7 +547,7 @@ parserInit(XML_Parser parser, const XML_Char *encodingName);
: ((*((pool)->ptr)++ = c), 1))
struct XML_ParserStruct {
- /* The first member must be userData so that the XML_GetUserData
+ /* The first member must be m_userData so that the XML_GetUserData
macro works. */
void *m_userData;
void *m_handlerArg;
@@ -476,7 +557,7 @@ struct XML_ParserStruct {
const char *m_bufferPtr;
/* past last character to be parsed */
char *m_bufferEnd;
- /* allocated end of buffer */
+ /* allocated end of m_buffer */
const char *m_bufferLim;
XML_Index m_parseEndByteIndex;
const char *m_parseEndPtr;
@@ -568,113 +649,10 @@ struct XML_ParserStruct {
unsigned long m_hash_secret_salt;
};
-#define MALLOC(s) (parser->m_mem.malloc_fcn((s)))
-#define REALLOC(p,s) (parser->m_mem.realloc_fcn((p),(s)))
-#define FREE(p) (parser->m_mem.free_fcn((p)))
-
-#define userData (parser->m_userData)
-#define handlerArg (parser->m_handlerArg)
-#define startElementHandler (parser->m_startElementHandler)
-#define endElementHandler (parser->m_endElementHandler)
-#define characterDataHandler (parser->m_characterDataHandler)
-#define processingInstructionHandler \
- (parser->m_processingInstructionHandler)
-#define commentHandler (parser->m_commentHandler)
-#define startCdataSectionHandler \
- (parser->m_startCdataSectionHandler)
-#define endCdataSectionHandler (parser->m_endCdataSectionHandler)
-#define defaultHandler (parser->m_defaultHandler)
-#define startDoctypeDeclHandler (parser->m_startDoctypeDeclHandler)
-#define endDoctypeDeclHandler (parser->m_endDoctypeDeclHandler)
-#define unparsedEntityDeclHandler \
- (parser->m_unparsedEntityDeclHandler)
-#define notationDeclHandler (parser->m_notationDeclHandler)
-#define startNamespaceDeclHandler \
- (parser->m_startNamespaceDeclHandler)
-#define endNamespaceDeclHandler (parser->m_endNamespaceDeclHandler)
-#define notStandaloneHandler (parser->m_notStandaloneHandler)
-#define externalEntityRefHandler \
- (parser->m_externalEntityRefHandler)
-#define externalEntityRefHandlerArg \
- (parser->m_externalEntityRefHandlerArg)
-#define internalEntityRefHandler \
- (parser->m_internalEntityRefHandler)
-#define skippedEntityHandler (parser->m_skippedEntityHandler)
-#define unknownEncodingHandler (parser->m_unknownEncodingHandler)
-#define elementDeclHandler (parser->m_elementDeclHandler)
-#define attlistDeclHandler (parser->m_attlistDeclHandler)
-#define entityDeclHandler (parser->m_entityDeclHandler)
-#define xmlDeclHandler (parser->m_xmlDeclHandler)
-#define encoding (parser->m_encoding)
-#define initEncoding (parser->m_initEncoding)
-#define internalEncoding (parser->m_internalEncoding)
-#define unknownEncodingMem (parser->m_unknownEncodingMem)
-#define unknownEncodingData (parser->m_unknownEncodingData)
-#define unknownEncodingHandlerData \
- (parser->m_unknownEncodingHandlerData)
-#define unknownEncodingRelease (parser->m_unknownEncodingRelease)
-#define protocolEncodingName (parser->m_protocolEncodingName)
-#define ns (parser->m_ns)
-#define ns_triplets (parser->m_ns_triplets)
-#define prologState (parser->m_prologState)
-#define processor (parser->m_processor)
-#define errorCode (parser->m_errorCode)
-#define eventPtr (parser->m_eventPtr)
-#define eventEndPtr (parser->m_eventEndPtr)
-#define positionPtr (parser->m_positionPtr)
-#define position (parser->m_position)
-#define openInternalEntities (parser->m_openInternalEntities)
-#define freeInternalEntities (parser->m_freeInternalEntities)
-#define defaultExpandInternalEntities \
- (parser->m_defaultExpandInternalEntities)
-#define tagLevel (parser->m_tagLevel)
-#define buffer (parser->m_buffer)
-#define bufferPtr (parser->m_bufferPtr)
-#define bufferEnd (parser->m_bufferEnd)
-#define parseEndByteIndex (parser->m_parseEndByteIndex)
-#define parseEndPtr (parser->m_parseEndPtr)
-#define bufferLim (parser->m_bufferLim)
-#define dataBuf (parser->m_dataBuf)
-#define dataBufEnd (parser->m_dataBufEnd)
-#define _dtd (parser->m_dtd)
-#define curBase (parser->m_curBase)
-#define declEntity (parser->m_declEntity)
-#define doctypeName (parser->m_doctypeName)
-#define doctypeSysid (parser->m_doctypeSysid)
-#define doctypePubid (parser->m_doctypePubid)
-#define declAttributeType (parser->m_declAttributeType)
-#define declNotationName (parser->m_declNotationName)
-#define declNotationPublicId (parser->m_declNotationPublicId)
-#define declElementType (parser->m_declElementType)
-#define declAttributeId (parser->m_declAttributeId)
-#define declAttributeIsCdata (parser->m_declAttributeIsCdata)
-#define declAttributeIsId (parser->m_declAttributeIsId)
-#define freeTagList (parser->m_freeTagList)
-#define freeBindingList (parser->m_freeBindingList)
-#define inheritedBindings (parser->m_inheritedBindings)
-#define tagStack (parser->m_tagStack)
-#define atts (parser->m_atts)
-#define attsSize (parser->m_attsSize)
-#define nSpecifiedAtts (parser->m_nSpecifiedAtts)
-#define idAttIndex (parser->m_idAttIndex)
-#define nsAtts (parser->m_nsAtts)
-#define nsAttsVersion (parser->m_nsAttsVersion)
-#define nsAttsPower (parser->m_nsAttsPower)
-#define attInfo (parser->m_attInfo)
-#define tempPool (parser->m_tempPool)
-#define temp2Pool (parser->m_temp2Pool)
-#define groupConnector (parser->m_groupConnector)
-#define groupSize (parser->m_groupSize)
-#define namespaceSeparator (parser->m_namespaceSeparator)
-#define parentParser (parser->m_parentParser)
-#define ps_parsing (parser->m_parsingStatus.parsing)
-#define ps_finalBuffer (parser->m_parsingStatus.finalBuffer)
-#ifdef XML_DTD
-#define isParamEntity (parser->m_isParamEntity)
-#define useForeignDTD (parser->m_useForeignDTD)
-#define paramEntityParsing (parser->m_paramEntityParsing)
-#endif /* XML_DTD */
-#define hash_secret_salt (parser->m_hash_secret_salt)
+#define MALLOC(parser, s) (parser->m_mem.malloc_fcn((s)))
+#define REALLOC(parser, p, s) (parser->m_mem.realloc_fcn((p),(s)))
+#define FREE(parser, p) (parser->m_mem.free_fcn((p)))
+
XML_Parser XMLCALL
XML_ParserCreate(const XML_Char *encodingName)
@@ -699,10 +677,138 @@ static const XML_Char implicitContext[] = {
ASCII_s, ASCII_p, ASCII_a, ASCII_c, ASCII_e, '\0'
};
+
+/* To avoid warnings about unused functions: */
+#if ! defined(HAVE_ARC4RANDOM_BUF) && ! defined(HAVE_ARC4RANDOM)
+
+#if defined(HAVE_GETRANDOM) || defined(HAVE_SYSCALL_GETRANDOM)
+
+/* Obtain entropy on Linux 3.17+ */
+static int
+writeRandomBytes_getrandom_nonblock(void * target, size_t count) {
+ int success = 0; /* full count bytes written? */
+ size_t bytesWrittenTotal = 0;
+ const unsigned int getrandomFlags = GRND_NONBLOCK;
+
+ do {
+ void * const currentTarget = (void*)((char*)target + bytesWrittenTotal);
+ const size_t bytesToWrite = count - bytesWrittenTotal;
+
+ const int bytesWrittenMore =
+#if defined(HAVE_GETRANDOM)
+ getrandom(currentTarget, bytesToWrite, getrandomFlags);
+#else
+ syscall(SYS_getrandom, currentTarget, bytesToWrite, getrandomFlags);
+#endif
+
+ if (bytesWrittenMore > 0) {
+ bytesWrittenTotal += bytesWrittenMore;
+ if (bytesWrittenTotal >= count)
+ success = 1;
+ }
+ } while (! success && (errno == EINTR));
+
+ return success;
+}
+
+#endif /* defined(HAVE_GETRANDOM) || defined(HAVE_SYSCALL_GETRANDOM) */
+
+
+#if ! defined(_WIN32) && defined(XML_DEV_URANDOM)
+
+/* Extract entropy from /dev/urandom */
+static int
+writeRandomBytes_dev_urandom(void * target, size_t count) {
+ int success = 0; /* full count bytes written? */
+ size_t bytesWrittenTotal = 0;
+
+ const int fd = open("/dev/urandom", O_RDONLY);
+ if (fd < 0) {
+ return 0;
+ }
+
+ do {
+ void * const currentTarget = (void*)((char*)target + bytesWrittenTotal);
+ const size_t bytesToWrite = count - bytesWrittenTotal;
+
+ const ssize_t bytesWrittenMore = read(fd, currentTarget, bytesToWrite);
+
+ if (bytesWrittenMore > 0) {
+ bytesWrittenTotal += bytesWrittenMore;
+ if (bytesWrittenTotal >= count)
+ success = 1;
+ }
+ } while (! success && (errno == EINTR));
+
+ close(fd);
+ return success;
+}
+
+#endif /* ! defined(_WIN32) && defined(XML_DEV_URANDOM) */
+
+#endif /* ! defined(HAVE_ARC4RANDOM_BUF) && ! defined(HAVE_ARC4RANDOM) */
+
+
+#if defined(HAVE_ARC4RANDOM) && ! defined(HAVE_ARC4RANDOM_BUF)
+
+static void
+writeRandomBytes_arc4random(void * target, size_t count) {
+ size_t bytesWrittenTotal = 0;
+
+ while (bytesWrittenTotal < count) {
+ const uint32_t random32 = arc4random();
+ size_t i = 0;
+
+ for (; (i < sizeof(random32)) && (bytesWrittenTotal < count);
+ i++, bytesWrittenTotal++) {
+ const uint8_t random8 = (uint8_t)(random32 >> (i * 8));
+ ((uint8_t *)target)[bytesWrittenTotal] = random8;
+ }
+ }
+}
+
+#endif /* defined(HAVE_ARC4RANDOM) && ! defined(HAVE_ARC4RANDOM_BUF) */
+
+
+#ifdef _WIN32
+
+typedef BOOLEAN (APIENTRY *RTLGENRANDOM_FUNC)(PVOID, ULONG);
+HMODULE _Expat_LoadLibrary(LPCTSTR filename); /* see loadlibrary.c */
+
+/* Obtain entropy on Windows XP / Windows Server 2003 and later.
+ * Hint on RtlGenRandom and the following article from libsodium.
+ *
+ * Michael Howard: Cryptographically Secure Random number on Windows without using CryptoAPI
+ * https://blogs.msdn.microsoft.com/michael_howard/2005/01/14/cryptographically-secure-random-number-on-windows-without-using-cryptoapi/
+ */
+static int
+writeRandomBytes_RtlGenRandom(void * target, size_t count) {
+ int success = 0; /* full count bytes written? */
+ const HMODULE advapi32 = _Expat_LoadLibrary(TEXT("ADVAPI32.DLL"));
+
+ if (advapi32) {
+ const RTLGENRANDOM_FUNC RtlGenRandom
+ = (RTLGENRANDOM_FUNC)GetProcAddress(advapi32, "SystemFunction036");
+ if (RtlGenRandom) {
+ if (RtlGenRandom((PVOID)target, (ULONG)count) == TRUE) {
+ success = 1;
+ }
+ }
+ FreeLibrary(advapi32);
+ }
+
+ return success;
+}
+
+#endif /* _WIN32 */
+
+
+#if ! defined(HAVE_ARC4RANDOM_BUF) && ! defined(HAVE_ARC4RANDOM)
+
static unsigned long
gather_time_entropy(void)
{
-#ifdef WIN32
+#ifdef _WIN32
FILETIME ft;
GetSystemTimeAsFileTime(&ft); /* never fails */
return ft.dwHighDateTime ^ ft.dwLowDateTime;
@@ -711,36 +817,91 @@ gather_time_entropy(void)
int gettimeofday_res;
gettimeofday_res = gettimeofday(&tv, NULL);
+
+#if defined(NDEBUG)
+ (void)gettimeofday_res;
+#else
assert (gettimeofday_res == 0);
+#endif /* defined(NDEBUG) */
/* Microseconds time is <20 bits entropy */
return tv.tv_usec;
#endif
}
+#endif /* ! defined(HAVE_ARC4RANDOM_BUF) && ! defined(HAVE_ARC4RANDOM) */
+
+
+static unsigned long
+ENTROPY_DEBUG(const char * label, unsigned long entropy) {
+ const char * const EXPAT_ENTROPY_DEBUG = getenv("EXPAT_ENTROPY_DEBUG");
+ if (EXPAT_ENTROPY_DEBUG && ! strcmp(EXPAT_ENTROPY_DEBUG, "1")) {
+ fprintf(stderr, "Entropy: %s --> 0x%0*lx (%lu bytes)\n",
+ label,
+ (int)sizeof(entropy) * 2, entropy,
+ (unsigned long)sizeof(entropy));
+ }
+ return entropy;
+}
+
static unsigned long
generate_hash_secret_salt(XML_Parser parser)
{
- /* Process ID is 0 bits entropy if attacker has local access
- * XML_Parser address is few bits of entropy if attacker has local access */
- const unsigned long entropy =
- gather_time_entropy() ^ getpid() ^ (unsigned long)parser;
+ unsigned long entropy;
+ (void)parser;
+
+ /* "Failproof" high quality providers: */
+#if defined(HAVE_ARC4RANDOM_BUF)
+ arc4random_buf(&entropy, sizeof(entropy));
+ return ENTROPY_DEBUG("arc4random_buf", entropy);
+#elif defined(HAVE_ARC4RANDOM)
+ writeRandomBytes_arc4random((void *)&entropy, sizeof(entropy));
+ return ENTROPY_DEBUG("arc4random", entropy);
+#else
+ /* Try high quality providers first .. */
+#ifdef _WIN32
+ if (writeRandomBytes_RtlGenRandom((void *)&entropy, sizeof(entropy))) {
+ return ENTROPY_DEBUG("RtlGenRandom", entropy);
+ }
+#elif defined(HAVE_GETRANDOM) || defined(HAVE_SYSCALL_GETRANDOM)
+ if (writeRandomBytes_getrandom_nonblock((void *)&entropy, sizeof(entropy))) {
+ return ENTROPY_DEBUG("getrandom", entropy);
+ }
+#endif
+#if ! defined(_WIN32) && defined(XML_DEV_URANDOM)
+ if (writeRandomBytes_dev_urandom((void *)&entropy, sizeof(entropy))) {
+ return ENTROPY_DEBUG("/dev/urandom", entropy);
+ }
+#endif /* ! defined(_WIN32) && defined(XML_DEV_URANDOM) */
+ /* .. and self-made low quality for backup: */
+
+ /* Process ID is 0 bits entropy if attacker has local access */
+ entropy = gather_time_entropy() ^ getpid();
/* Factors are 2^31-1 and 2^61-1 (Mersenne primes M31 and M61) */
if (sizeof(unsigned long) == 4) {
- return entropy * 2147483647;
+ return ENTROPY_DEBUG("fallback(4)", entropy * 2147483647);
} else {
- return entropy * (unsigned long)2305843009213693951;
+ return ENTROPY_DEBUG("fallback(8)",
+ entropy * (unsigned long)2305843009213693951ULL);
}
+#endif
+}
+
+static unsigned long
+get_hash_secret_salt(XML_Parser parser) {
+ if (parser->m_parentParser != NULL)
+ return get_hash_secret_salt(parser->m_parentParser);
+ return parser->m_hash_secret_salt;
}
static XML_Bool /* only valid for root parser */
startParsing(XML_Parser parser)
{
/* hash functions must be initialized before setContext() is called */
- if (hash_secret_salt == 0)
- hash_secret_salt = generate_hash_secret_salt(parser);
- if (ns) {
+ if (parser->m_hash_secret_salt == 0)
+ parser->m_hash_secret_salt = generate_hash_secret_salt(parser);
+ if (parser->m_ns) {
/* implicit context only set for root parser, since child
parsers (i.e. external entity parsers) will inherit it
*/
@@ -790,83 +951,85 @@ parserCreate(const XML_Char *encodingName,
if (!parser)
return parser;
- buffer = NULL;
- bufferLim = NULL;
+ parser->m_buffer = NULL;
+ parser->m_bufferLim = NULL;
- attsSize = INIT_ATTS_SIZE;
- atts = (ATTRIBUTE *)MALLOC(attsSize * sizeof(ATTRIBUTE));
- if (atts == NULL) {
- FREE(parser);
+ parser->m_attsSize = INIT_ATTS_SIZE;
+ parser->m_atts = (ATTRIBUTE *)MALLOC(parser, parser->m_attsSize * sizeof(ATTRIBUTE));
+ if (parser->m_atts == NULL) {
+ FREE(parser, parser);
return NULL;
}
#ifdef XML_ATTR_INFO
- attInfo = (XML_AttrInfo*)MALLOC(attsSize * sizeof(XML_AttrInfo));
- if (attInfo == NULL) {
- FREE(atts);
- FREE(parser);
+ parser->m_attInfo = (XML_AttrInfo*)MALLOC(parser, parser->m_attsSize * sizeof(XML_AttrInfo));
+ if (parser->m_attInfo == NULL) {
+ FREE(parser, parser->m_atts);
+ FREE(parser, parser);
return NULL;
}
#endif
- dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));
- if (dataBuf == NULL) {
- FREE(atts);
+ parser->m_dataBuf = (XML_Char *)MALLOC(parser, INIT_DATA_BUF_SIZE * sizeof(XML_Char));
+ if (parser->m_dataBuf == NULL) {
+ FREE(parser, parser->m_atts);
#ifdef XML_ATTR_INFO
- FREE(attInfo);
+ FREE(parser, parser->m_attInfo);
#endif
- FREE(parser);
+ FREE(parser, parser);
return NULL;
}
- dataBufEnd = dataBuf + INIT_DATA_BUF_SIZE;
+ parser->m_dataBufEnd = parser->m_dataBuf + INIT_DATA_BUF_SIZE;
if (dtd)
- _dtd = dtd;
+ parser->m_dtd = dtd;
else {
- _dtd = dtdCreate(&parser->m_mem);
- if (_dtd == NULL) {
- FREE(dataBuf);
- FREE(atts);
+ parser->m_dtd = dtdCreate(&parser->m_mem);
+ if (parser->m_dtd == NULL) {
+ FREE(parser, parser->m_dataBuf);
+ FREE(parser, parser->m_atts);
#ifdef XML_ATTR_INFO
- FREE(attInfo);
+ FREE(parser, parser->m_attInfo);
#endif
- FREE(parser);
+ FREE(parser, parser);
return NULL;
}
}
- freeBindingList = NULL;
- freeTagList = NULL;
- freeInternalEntities = NULL;
+ parser->m_freeBindingList = NULL;
+ parser->m_freeTagList = NULL;
+ parser->m_freeInternalEntities = NULL;
+
+ parser->m_groupSize = 0;
+ parser->m_groupConnector = NULL;
- groupSize = 0;
- groupConnector = NULL;
+ parser->m_unknownEncodingHandler = NULL;
+ parser->m_unknownEncodingHandlerData = NULL;
- unknownEncodingHandler = NULL;
- unknownEncodingHandlerData = NULL;
+ parser->m_namespaceSeparator = ASCII_EXCL;
+ parser->m_ns = XML_FALSE;
+ parser->m_ns_triplets = XML_FALSE;
- namespaceSeparator = ASCII_EXCL;
- ns = XML_FALSE;
- ns_triplets = XML_FALSE;
+ parser->m_nsAtts = NULL;
+ parser->m_nsAttsVersion = 0;
+ parser->m_nsAttsPower = 0;
- nsAtts = NULL;
- nsAttsVersion = 0;
- nsAttsPower = 0;
+ parser->m_protocolEncodingName = NULL;
- poolInit(&tempPool, &(parser->m_mem));
- poolInit(&temp2Pool, &(parser->m_mem));
+ poolInit(&parser->m_tempPool, &(parser->m_mem));
+ poolInit(&parser->m_temp2Pool, &(parser->m_mem));
parserInit(parser, encodingName);
- if (encodingName && !protocolEncodingName) {
+ if (encodingName && !parser->m_protocolEncodingName) {
XML_ParserFree(parser);
return NULL;
}
if (nameSep) {
- ns = XML_TRUE;
- internalEncoding = XmlGetInternalEncodingNS();
- namespaceSeparator = *nameSep;
+ parser->m_ns = XML_TRUE;
+ parser->m_internalEncoding = XmlGetInternalEncodingNS();
+ parser->m_namespaceSeparator = *nameSep;
}
else {
- internalEncoding = XmlGetInternalEncoding();
+ parser->m_internalEncoding = XmlGetInternalEncoding();
}
return parser;
@@ -875,85 +1038,85 @@ parserCreate(const XML_Char *encodingName,
static void
parserInit(XML_Parser parser, const XML_Char *encodingName)
{
- processor = prologInitProcessor;
- XmlPrologStateInit(&prologState);
- protocolEncodingName = (encodingName != NULL
- ? poolCopyString(&tempPool, encodingName)
- : NULL);
- curBase = NULL;
- XmlInitEncoding(&initEncoding, &encoding, 0);
- userData = NULL;
- handlerArg = NULL;
- startElementHandler = NULL;
- endElementHandler = NULL;
- characterDataHandler = NULL;
- processingInstructionHandler = NULL;
- commentHandler = NULL;
- startCdataSectionHandler = NULL;
- endCdataSectionHandler = NULL;
- defaultHandler = NULL;
- startDoctypeDeclHandler = NULL;
- endDoctypeDeclHandler = NULL;
- unparsedEntityDeclHandler = NULL;
- notationDeclHandler = NULL;
- startNamespaceDeclHandler = NULL;
- endNamespaceDeclHandler = NULL;
- notStandaloneHandler = NULL;
- externalEntityRefHandler = NULL;
- externalEntityRefHandlerArg = parser;
- skippedEntityHandler = NULL;
- elementDeclHandler = NULL;
- attlistDeclHandler = NULL;
- entityDeclHandler = NULL;
- xmlDeclHandler = NULL;
- bufferPtr = buffer;
- bufferEnd = buffer;
- parseEndByteIndex = 0;
- parseEndPtr = NULL;
- declElementType = NULL;
- declAttributeId = NULL;
- declEntity = NULL;
- doctypeName = NULL;
- doctypeSysid = NULL;
- doctypePubid = NULL;
- declAttributeType = NULL;
- declNotationName = NULL;
- declNotationPublicId = NULL;
- declAttributeIsCdata = XML_FALSE;
- declAttributeIsId = XML_FALSE;
- memset(&position, 0, sizeof(POSITION));
- errorCode = XML_ERROR_NONE;
- eventPtr = NULL;
- eventEndPtr = NULL;
- positionPtr = NULL;
- openInternalEntities = NULL;
- defaultExpandInternalEntities = XML_TRUE;
- tagLevel = 0;
- tagStack = NULL;
- inheritedBindings = NULL;
- nSpecifiedAtts = 0;
- unknownEncodingMem = NULL;
- unknownEncodingRelease = NULL;
- unknownEncodingData = NULL;
- parentParser = NULL;
- ps_parsing = XML_INITIALIZED;
+ parser->m_processor = prologInitProcessor;
+ XmlPrologStateInit(&parser->m_prologState);
+ if (encodingName != NULL) {
+ parser->m_protocolEncodingName = copyString(encodingName, &(parser->m_mem));
+ }
+ parser->m_curBase = NULL;
+ XmlInitEncoding(&parser->m_initEncoding, &parser->m_encoding, 0);
+ parser->m_userData = NULL;
+ parser->m_handlerArg = NULL;
+ parser->m_startElementHandler = NULL;
+ parser->m_endElementHandler = NULL;
+ parser->m_characterDataHandler = NULL;
+ parser->m_processingInstructionHandler = NULL;
+ parser->m_commentHandler = NULL;
+ parser->m_startCdataSectionHandler = NULL;
+ parser->m_endCdataSectionHandler = NULL;
+ parser->m_defaultHandler = NULL;
+ parser->m_startDoctypeDeclHandler = NULL;
+ parser->m_endDoctypeDeclHandler = NULL;
+ parser->m_unparsedEntityDeclHandler = NULL;
+ parser->m_notationDeclHandler = NULL;
+ parser->m_startNamespaceDeclHandler = NULL;
+ parser->m_endNamespaceDeclHandler = NULL;
+ parser->m_notStandaloneHandler = NULL;
+ parser->m_externalEntityRefHandler = NULL;
+ parser->m_externalEntityRefHandlerArg = parser;
+ parser->m_skippedEntityHandler = NULL;
+ parser->m_elementDeclHandler = NULL;
+ parser->m_attlistDeclHandler = NULL;
+ parser->m_entityDeclHandler = NULL;
+ parser->m_xmlDeclHandler = NULL;
+ parser->m_bufferPtr = parser->m_buffer;
+ parser->m_bufferEnd = parser->m_buffer;
+ parser->m_parseEndByteIndex = 0;
+ parser->m_parseEndPtr = NULL;
+ parser->m_declElementType = NULL;
+ parser->m_declAttributeId = NULL;
+ parser->m_declEntity = NULL;
+ parser->m_doctypeName = NULL;
+ parser->m_doctypeSysid = NULL;
+ parser->m_doctypePubid = NULL;
+ parser->m_declAttributeType = NULL;
+ parser->m_declNotationName = NULL;
+ parser->m_declNotationPublicId = NULL;
+ parser->m_declAttributeIsCdata = XML_FALSE;
+ parser->m_declAttributeIsId = XML_FALSE;
+ memset(&parser->m_position, 0, sizeof(POSITION));
+ parser->m_errorCode = XML_ERROR_NONE;
+ parser->m_eventPtr = NULL;
+ parser->m_eventEndPtr = NULL;
+ parser->m_positionPtr = NULL;
+ parser->m_openInternalEntities = NULL;
+ parser->m_defaultExpandInternalEntities = XML_TRUE;
+ parser->m_tagLevel = 0;
+ parser->m_tagStack = NULL;
+ parser->m_inheritedBindings = NULL;
+ parser->m_nSpecifiedAtts = 0;
+ parser->m_unknownEncodingMem = NULL;
+ parser->m_unknownEncodingRelease = NULL;
+ parser->m_unknownEncodingData = NULL;
+ parser->m_parentParser = NULL;
+ parser->m_parsingStatus.parsing = XML_INITIALIZED;
#ifdef XML_DTD
- isParamEntity = XML_FALSE;
- useForeignDTD = XML_FALSE;
- paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
+ parser->m_isParamEntity = XML_FALSE;
+ parser->m_useForeignDTD = XML_FALSE;
+ parser->m_paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
#endif
- hash_secret_salt = 0;
+ parser->m_hash_secret_salt = 0;
}
-/* moves list of bindings to freeBindingList */
+/* moves list of bindings to m_freeBindingList */
static void FASTCALL
moveToFreeBindingList(XML_Parser parser, BINDING *bindings)
{
while (bindings) {
BINDING *b = bindings;
bindings = bindings->nextTagBinding;
- b->nextTagBinding = freeBindingList;
- freeBindingList = b;
+ b->nextTagBinding = parser->m_freeBindingList;
+ parser->m_freeBindingList = b;
}
}
@@ -962,51 +1125,65 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encodingName)
{
TAG *tStk;
OPEN_INTERNAL_ENTITY *openEntityList;
- if (parentParser)
+
+ if (parser == NULL)
+ return XML_FALSE;
+
+ if (parser->m_parentParser)
return XML_FALSE;
- /* move tagStack to freeTagList */
- tStk = tagStack;
+ /* move m_tagStack to m_freeTagList */
+ tStk = parser->m_tagStack;
while (tStk) {
TAG *tag = tStk;
tStk = tStk->parent;
- tag->parent = freeTagList;
+ tag->parent = parser->m_freeTagList;
moveToFreeBindingList(parser, tag->bindings);
tag->bindings = NULL;
- freeTagList = tag;
+ parser->m_freeTagList = tag;
}
- /* move openInternalEntities to freeInternalEntities */
- openEntityList = openInternalEntities;
+ /* move m_openInternalEntities to m_freeInternalEntities */
+ openEntityList = parser->m_openInternalEntities;
while (openEntityList) {
OPEN_INTERNAL_ENTITY *openEntity = openEntityList;
openEntityList = openEntity->next;
- openEntity->next = freeInternalEntities;
- freeInternalEntities = openEntity;
- }
- moveToFreeBindingList(parser, inheritedBindings);
- FREE(unknownEncodingMem);
- if (unknownEncodingRelease)
- unknownEncodingRelease(unknownEncodingData);
- poolClear(&tempPool);
- poolClear(&temp2Pool);
+ openEntity->next = parser->m_freeInternalEntities;
+ parser->m_freeInternalEntities = openEntity;
+ }
+ moveToFreeBindingList(parser, parser->m_inheritedBindings);
+ FREE(parser, parser->m_unknownEncodingMem);
+ if (parser->m_unknownEncodingRelease)
+ parser->m_unknownEncodingRelease(parser->m_unknownEncodingData);
+ poolClear(&parser->m_tempPool);
+ poolClear(&parser->m_temp2Pool);
+ FREE(parser, (void *)parser->m_protocolEncodingName);
+ parser->m_protocolEncodingName = NULL;
parserInit(parser, encodingName);
- dtdReset(_dtd, &parser->m_mem);
+ dtdReset(parser->m_dtd, &parser->m_mem);
return XML_TRUE;
}
enum XML_Status XMLCALL
XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName)
{
+ if (parser == NULL)
+ return XML_STATUS_ERROR;
/* Block after XML_Parse()/XML_ParseBuffer() has been called.
XXX There's no way for the caller to determine which of the
XXX possible error cases caused the XML_STATUS_ERROR return.
*/
- if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
+ if (parser->m_parsingStatus.parsing == XML_PARSING || parser->m_parsingStatus.parsing == XML_SUSPENDED)
return XML_STATUS_ERROR;
+
+ /* Get rid of any previous encoding name */
+ FREE(parser, (void *)parser->m_protocolEncodingName);
+
if (encodingName == NULL)
- protocolEncodingName = NULL;
+ /* No new encoding name */
+ parser->m_protocolEncodingName = NULL;
else {
- protocolEncodingName = poolCopyString(&tempPool, encodingName);
- if (!protocolEncodingName)
+ /* Copy the new encoding name into allocated memory */
+ parser->m_protocolEncodingName = copyString(encodingName, &(parser->m_mem));
+ if (!parser->m_protocolEncodingName)
return XML_STATUS_ERROR;
}
return XML_STATUS_OK;
@@ -1019,52 +1196,88 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser,
{
XML_Parser parser = oldParser;
DTD *newDtd = NULL;
- DTD *oldDtd = _dtd;
- XML_StartElementHandler oldStartElementHandler = startElementHandler;
- XML_EndElementHandler oldEndElementHandler = endElementHandler;
- XML_CharacterDataHandler oldCharacterDataHandler = characterDataHandler;
- XML_ProcessingInstructionHandler oldProcessingInstructionHandler
- = processingInstructionHandler;
- XML_CommentHandler oldCommentHandler = commentHandler;
- XML_StartCdataSectionHandler oldStartCdataSectionHandler
- = startCdataSectionHandler;
- XML_EndCdataSectionHandler oldEndCdataSectionHandler
- = endCdataSectionHandler;
- XML_DefaultHandler oldDefaultHandler = defaultHandler;
- XML_UnparsedEntityDeclHandler oldUnparsedEntityDeclHandler
- = unparsedEntityDeclHandler;
- XML_NotationDeclHandler oldNotationDeclHandler = notationDeclHandler;
- XML_StartNamespaceDeclHandler oldStartNamespaceDeclHandler
- = startNamespaceDeclHandler;
- XML_EndNamespaceDeclHandler oldEndNamespaceDeclHandler
- = endNamespaceDeclHandler;
- XML_NotStandaloneHandler oldNotStandaloneHandler = notStandaloneHandler;
- XML_ExternalEntityRefHandler oldExternalEntityRefHandler
- = externalEntityRefHandler;
- XML_SkippedEntityHandler oldSkippedEntityHandler = skippedEntityHandler;
- XML_UnknownEncodingHandler oldUnknownEncodingHandler
- = unknownEncodingHandler;
- XML_ElementDeclHandler oldElementDeclHandler = elementDeclHandler;
- XML_AttlistDeclHandler oldAttlistDeclHandler = attlistDeclHandler;
- XML_EntityDeclHandler oldEntityDeclHandler = entityDeclHandler;
- XML_XmlDeclHandler oldXmlDeclHandler = xmlDeclHandler;
- ELEMENT_TYPE * oldDeclElementType = declElementType;
-
- void *oldUserData = userData;
- void *oldHandlerArg = handlerArg;
- XML_Bool oldDefaultExpandInternalEntities = defaultExpandInternalEntities;
- XML_Parser oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg;
+ DTD *oldDtd;
+ XML_StartElementHandler oldStartElementHandler;
+ XML_EndElementHandler oldEndElementHandler;
+ XML_CharacterDataHandler oldCharacterDataHandler;
+ XML_ProcessingInstructionHandler oldProcessingInstructionHandler;
+ XML_CommentHandler oldCommentHandler;
+ XML_StartCdataSectionHandler oldStartCdataSectionHandler;
+ XML_EndCdataSectionHandler oldEndCdataSectionHandler;
+ XML_DefaultHandler oldDefaultHandler;
+ XML_UnparsedEntityDeclHandler oldUnparsedEntityDeclHandler;
+ XML_NotationDeclHandler oldNotationDeclHandler;
+ XML_StartNamespaceDeclHandler oldStartNamespaceDeclHandler;
+ XML_EndNamespaceDeclHandler oldEndNamespaceDeclHandler;
+ XML_NotStandaloneHandler oldNotStandaloneHandler;
+ XML_ExternalEntityRefHandler oldExternalEntityRefHandler;
+ XML_SkippedEntityHandler oldSkippedEntityHandler;
+ XML_UnknownEncodingHandler oldUnknownEncodingHandler;
+ XML_ElementDeclHandler oldElementDeclHandler;
+ XML_AttlistDeclHandler oldAttlistDeclHandler;
+ XML_EntityDeclHandler oldEntityDeclHandler;
+ XML_XmlDeclHandler oldXmlDeclHandler;
+ ELEMENT_TYPE * oldDeclElementType;
+
+ void *oldUserData;
+ void *oldHandlerArg;
+ XML_Bool oldDefaultExpandInternalEntities;
+ XML_Parser oldExternalEntityRefHandlerArg;
+#ifdef XML_DTD
+ enum XML_ParamEntityParsing oldParamEntityParsing;
+ int oldInEntityValue;
+#endif
+ XML_Bool oldns_triplets;
+ /* Note that the new parser shares the same hash secret as the old
+ parser, so that dtdCopy and copyEntityTable can lookup values
+ from hash tables associated with either parser without us having
+ to worry which hash secrets each table has.
+ */
+ unsigned long oldhash_secret_salt;
+
+ /* Validate the oldParser parameter before we pull everything out of it */
+ if (oldParser == NULL)
+ return NULL;
+
+ /* Stash the original parser contents on the stack */
+ oldDtd = parser->m_dtd;
+ oldStartElementHandler = parser->m_startElementHandler;
+ oldEndElementHandler = parser->m_endElementHandler;
+ oldCharacterDataHandler = parser->m_characterDataHandler;
+ oldProcessingInstructionHandler = parser->m_processingInstructionHandler;
+ oldCommentHandler = parser->m_commentHandler;
+ oldStartCdataSectionHandler = parser->m_startCdataSectionHandler;
+ oldEndCdataSectionHandler = parser->m_endCdataSectionHandler;
+ oldDefaultHandler = parser->m_defaultHandler;
+ oldUnparsedEntityDeclHandler = parser->m_unparsedEntityDeclHandler;
+ oldNotationDeclHandler = parser->m_notationDeclHandler;
+ oldStartNamespaceDeclHandler = parser->m_startNamespaceDeclHandler;
+ oldEndNamespaceDeclHandler = parser->m_endNamespaceDeclHandler;
+ oldNotStandaloneHandler = parser->m_notStandaloneHandler;
+ oldExternalEntityRefHandler = parser->m_externalEntityRefHandler;
+ oldSkippedEntityHandler = parser->m_skippedEntityHandler;
+ oldUnknownEncodingHandler = parser->m_unknownEncodingHandler;
+ oldElementDeclHandler = parser->m_elementDeclHandler;
+ oldAttlistDeclHandler = parser->m_attlistDeclHandler;
+ oldEntityDeclHandler = parser->m_entityDeclHandler;
+ oldXmlDeclHandler = parser->m_xmlDeclHandler;
+ oldDeclElementType = parser->m_declElementType;
+
+ oldUserData = parser->m_userData;
+ oldHandlerArg = parser->m_handlerArg;
+ oldDefaultExpandInternalEntities = parser->m_defaultExpandInternalEntities;
+ oldExternalEntityRefHandlerArg = parser->m_externalEntityRefHandlerArg;
#ifdef XML_DTD
- enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing;
- int oldInEntityValue = prologState.inEntityValue;
+ oldParamEntityParsing = parser->m_paramEntityParsing;
+ oldInEntityValue = parser->m_prologState.inEntityValue;
#endif
- XML_Bool oldns_triplets = ns_triplets;
+ oldns_triplets = parser->m_ns_triplets;
/* Note that the new parser shares the same hash secret as the old
parser, so that dtdCopy and copyEntityTable can lookup values
from hash tables associated with either parser without us having
to worry which hash secrets each table has.
*/
- unsigned long oldhash_secret_salt = hash_secret_salt;
+ oldhash_secret_salt = parser->m_hash_secret_salt;
#ifdef XML_DTD
if (!context)
@@ -1076,9 +1289,9 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser,
here. This makes this function more painful to follow than it
would be otherwise.
*/
- if (ns) {
+ if (parser->m_ns) {
XML_Char tmp[2];
- *tmp = namespaceSeparator;
+ *tmp = parser->m_namespaceSeparator;
parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd);
}
else {
@@ -1088,62 +1301,62 @@ XML_ExternalEntityParserCreate(XML_Parser oldParser,
if (!parser)
return NULL;
- startElementHandler = oldStartElementHandler;
- endElementHandler = oldEndElementHandler;
- characterDataHandler = oldCharacterDataHandler;
- processingInstructionHandler = oldProcessingInstructionHandler;
- commentHandler = oldCommentHandler;
- startCdataSectionHandler = oldStartCdataSectionHandler;
- endCdataSectionHandler = oldEndCdataSectionHandler;
- defaultHandler = oldDefaultHandler;
- unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler;
- notationDeclHandler = oldNotationDeclHandler;
- startNamespaceDeclHandler = oldStartNamespaceDeclHandler;
- endNamespaceDeclHandler = oldEndNamespaceDeclHandler;
- notStandaloneHandler = oldNotStandaloneHandler;
- externalEntityRefHandler = oldExternalEntityRefHandler;
- skippedEntityHandler = oldSkippedEntityHandler;
- unknownEncodingHandler = oldUnknownEncodingHandler;
- elementDeclHandler = oldElementDeclHandler;
- attlistDeclHandler = oldAttlistDeclHandler;
- entityDeclHandler = oldEntityDeclHandler;
- xmlDeclHandler = oldXmlDeclHandler;
- declElementType = oldDeclElementType;
- userData = oldUserData;
+ parser->m_startElementHandler = oldStartElementHandler;
+ parser->m_endElementHandler = oldEndElementHandler;
+ parser->m_characterDataHandler = oldCharacterDataHandler;
+ parser->m_processingInstructionHandler = oldProcessingInstructionHandler;
+ parser->m_commentHandler = oldCommentHandler;
+ parser->m_startCdataSectionHandler = oldStartCdataSectionHandler;
+ parser->m_endCdataSectionHandler = oldEndCdataSectionHandler;
+ parser->m_defaultHandler = oldDefaultHandler;
+ parser->m_unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler;
+ parser->m_notationDeclHandler = oldNotationDeclHandler;
+ parser->m_startNamespaceDeclHandler = oldStartNamespaceDeclHandler;
+ parser->m_endNamespaceDeclHandler = oldEndNamespaceDeclHandler;
+ parser->m_notStandaloneHandler = oldNotStandaloneHandler;
+ parser->m_externalEntityRefHandler = oldExternalEntityRefHandler;
+ parser->m_skippedEntityHandler = oldSkippedEntityHandler;
+ parser->m_unknownEncodingHandler = oldUnknownEncodingHandler;
+ parser->m_elementDeclHandler = oldElementDeclHandler;
+ parser->m_attlistDeclHandler = oldAttlistDeclHandler;
+ parser->m_entityDeclHandler = oldEntityDeclHandler;
+ parser->m_xmlDeclHandler = oldXmlDeclHandler;
+ parser->m_declElementType = oldDeclElementType;
+ parser->m_userData = oldUserData;
if (oldUserData == oldHandlerArg)
- handlerArg = userData;
+ parser->m_handlerArg = parser->m_userData;
else
- handlerArg = parser;
+ parser->m_handlerArg = parser;
if (oldExternalEntityRefHandlerArg != oldParser)
- externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
- defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
- ns_triplets = oldns_triplets;
- hash_secret_salt = oldhash_secret_salt;
- parentParser = oldParser;
+ parser->m_externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg;
+ parser->m_defaultExpandInternalEntities = oldDefaultExpandInternalEntities;
+ parser->m_ns_triplets = oldns_triplets;
+ parser->m_hash_secret_salt = oldhash_secret_salt;
+ parser->m_parentParser = oldParser;
#ifdef XML_DTD
- paramEntityParsing = oldParamEntityParsing;
- prologState.inEntityValue = oldInEntityValue;
+ parser->m_paramEntityParsing = oldParamEntityParsing;
+ parser->m_prologState.inEntityValue = oldInEntityValue;
if (context) {
#endif /* XML_DTD */
- if (!dtdCopy(oldParser, _dtd, oldDtd, &parser->m_mem)
+ if (!dtdCopy(oldParser, parser->m_dtd, oldDtd, &parser->m_mem)
|| !setContext(parser, context)) {
XML_ParserFree(parser);
return NULL;
}
- processor = externalEntityInitProcessor;
+ parser->m_processor = externalEntityInitProcessor;
#ifdef XML_DTD
}
else {
- /* The DTD instance referenced by _dtd is shared between the document's
+ /* The DTD instance referenced by parser->m_dtd is shared between the document's
root parser and external PE parsers, therefore one does not need to
call setContext. In addition, one also *must* not call setContext,
because this would overwrite existing prefix->binding pointers in
- _dtd with ones that get destroyed with the external PE parser.
+ parser->m_dtd with ones that get destroyed with the external PE parser.
This would leave those prefixes with dangling pointers.
*/
- isParamEntity = XML_TRUE;
- XmlPrologStateInitExternalEntity(&prologState);
- processor = externalParEntInitProcessor;
+ parser->m_isParamEntity = XML_TRUE;
+ XmlPrologStateInitExternalEntity(&parser->m_prologState);
+ parser->m_processor = externalParEntInitProcessor;
}
#endif /* XML_DTD */
return parser;
@@ -1157,8 +1370,8 @@ destroyBindings(BINDING *bindings, XML_Parser parser)
if (!b)
break;
bindings = b->nextTagBinding;
- FREE(b->uri);
- FREE(b);
+ FREE(parser, b->uri);
+ FREE(parser, b);
}
}
@@ -1169,78 +1382,82 @@ XML_ParserFree(XML_Parser parser)
OPEN_INTERNAL_ENTITY *entityList;
if (parser == NULL)
return;
- /* free tagStack and freeTagList */
- tagList = tagStack;
+ /* free m_tagStack and m_freeTagList */
+ tagList = parser->m_tagStack;
for (;;) {
TAG *p;
if (tagList == NULL) {
- if (freeTagList == NULL)
+ if (parser->m_freeTagList == NULL)
break;
- tagList = freeTagList;
- freeTagList = NULL;
+ tagList = parser->m_freeTagList;
+ parser->m_freeTagList = NULL;
}
p = tagList;
tagList = tagList->parent;
- FREE(p->buf);
+ FREE(parser, p->buf);
destroyBindings(p->bindings, parser);
- FREE(p);
+ FREE(parser, p);
}
- /* free openInternalEntities and freeInternalEntities */
- entityList = openInternalEntities;
+ /* free m_openInternalEntities and m_freeInternalEntities */
+ entityList = parser->m_openInternalEntities;
for (;;) {
OPEN_INTERNAL_ENTITY *openEntity;
if (entityList == NULL) {
- if (freeInternalEntities == NULL)
+ if (parser->m_freeInternalEntities == NULL)
break;
- entityList = freeInternalEntities;
- freeInternalEntities = NULL;
+ entityList = parser->m_freeInternalEntities;
+ parser->m_freeInternalEntities = NULL;
}
openEntity = entityList;
entityList = entityList->next;
- FREE(openEntity);
+ FREE(parser, openEntity);
}
- destroyBindings(freeBindingList, parser);
- destroyBindings(inheritedBindings, parser);
- poolDestroy(&tempPool);
- poolDestroy(&temp2Pool);
+ destroyBindings(parser->m_freeBindingList, parser);
+ destroyBindings(parser->m_inheritedBindings, parser);
+ poolDestroy(&parser->m_tempPool);
+ poolDestroy(&parser->m_temp2Pool);
+ FREE(parser, (void *)parser->m_protocolEncodingName);
#ifdef XML_DTD
/* external parameter entity parsers share the DTD structure
parser->m_dtd with the root parser, so we must not destroy it
*/
- if (!isParamEntity && _dtd)
+ if (!parser->m_isParamEntity && parser->m_dtd)
#else
- if (_dtd)
+ if (parser->m_dtd)
#endif /* XML_DTD */
- dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem);
- FREE((void *)atts);
+ dtdDestroy(parser->m_dtd, (XML_Bool)!parser->m_parentParser, &parser->m_mem);
+ FREE(parser, (void *)parser->m_atts);
#ifdef XML_ATTR_INFO
- FREE((void *)attInfo);
+ FREE(parser, (void *)parser->m_attInfo);
#endif
- FREE(groupConnector);
- FREE(buffer);
- FREE(dataBuf);
- FREE(nsAtts);
- FREE(unknownEncodingMem);
- if (unknownEncodingRelease)
- unknownEncodingRelease(unknownEncodingData);
- FREE(parser);
+ FREE(parser, parser->m_groupConnector);
+ FREE(parser, parser->m_buffer);
+ FREE(parser, parser->m_dataBuf);
+ FREE(parser, parser->m_nsAtts);
+ FREE(parser, parser->m_unknownEncodingMem);
+ if (parser->m_unknownEncodingRelease)
+ parser->m_unknownEncodingRelease(parser->m_unknownEncodingData);
+ FREE(parser, parser);
}
void XMLCALL
XML_UseParserAsHandlerArg(XML_Parser parser)
{
- handlerArg = parser;
+ if (parser != NULL)
+ parser->m_handlerArg = parser;
}
enum XML_Error XMLCALL
XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD)
{
+ if (parser == NULL)
+ return XML_ERROR_INVALID_ARGUMENT;
#ifdef XML_DTD
/* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
+ if (parser->m_parsingStatus.parsing == XML_PARSING || parser->m_parsingStatus.parsing == XML_SUSPENDED)
return XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING;
- useForeignDTD = useDTD;
+ parser->m_useForeignDTD = useDTD;
return XML_ERROR_NONE;
#else
return XML_ERROR_FEATURE_REQUIRES_XML_DTD;
@@ -1250,58 +1467,72 @@ XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD)
void XMLCALL
XML_SetReturnNSTriplet(XML_Parser parser, int do_nst)
{
+ if (parser == NULL)
+ return;
/* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
+ if (parser->m_parsingStatus.parsing == XML_PARSING || parser->m_parsingStatus.parsing == XML_SUSPENDED)
return;
- ns_triplets = do_nst ? XML_TRUE : XML_FALSE;
+ parser->m_ns_triplets = do_nst ? XML_TRUE : XML_FALSE;
}
void XMLCALL
XML_SetUserData(XML_Parser parser, void *p)
{
- if (handlerArg == userData)
- handlerArg = userData = p;
+ if (parser == NULL)
+ return;
+ if (parser->m_handlerArg == parser->m_userData)
+ parser->m_handlerArg = parser->m_userData = p;
else
- userData = p;
+ parser->m_userData = p;
}
enum XML_Status XMLCALL
XML_SetBase(XML_Parser parser, const XML_Char *p)
{
+ if (parser == NULL)
+ return XML_STATUS_ERROR;
if (p) {
- p = poolCopyString(&_dtd->pool, p);
+ p = poolCopyString(&parser->m_dtd->pool, p);
if (!p)
return XML_STATUS_ERROR;
- curBase = p;
+ parser->m_curBase = p;
}
else
- curBase = NULL;
+ parser->m_curBase = NULL;
return XML_STATUS_OK;
}
const XML_Char * XMLCALL
XML_GetBase(XML_Parser parser)
{
- return curBase;
+ if (parser == NULL)
+ return NULL;
+ return parser->m_curBase;
}
int XMLCALL
XML_GetSpecifiedAttributeCount(XML_Parser parser)
{
- return nSpecifiedAtts;
+ if (parser == NULL)
+ return -1;
+ return parser->m_nSpecifiedAtts;
}
int XMLCALL
XML_GetIdAttributeIndex(XML_Parser parser)
{
- return idAttIndex;
+ if (parser == NULL)
+ return -1;
+ return parser->m_idAttIndex;
}
#ifdef XML_ATTR_INFO
const XML_AttrInfo * XMLCALL
XML_GetAttributeInfo(XML_Parser parser)
{
- return attInfo;
+ if (parser == NULL)
+ return NULL;
+ return parser->m_attInfo;
}
#endif
@@ -1310,41 +1541,48 @@ XML_SetElementHandler(XML_Parser parser,
XML_StartElementHandler start,
XML_EndElementHandler end)
{
- startElementHandler = start;
- endElementHandler = end;
+ if (parser == NULL)
+ return;
+ parser->m_startElementHandler = start;
+ parser->m_endElementHandler = end;
}
void XMLCALL
XML_SetStartElementHandler(XML_Parser parser,
XML_StartElementHandler start) {
- startElementHandler = start;
+ if (parser != NULL)
+ parser->m_startElementHandler = start;
}
void XMLCALL
XML_SetEndElementHandler(XML_Parser parser,
XML_EndElementHandler end) {
- endElementHandler = end;
+ if (parser != NULL)
+ parser->m_endElementHandler = end;
}
void XMLCALL
XML_SetCharacterDataHandler(XML_Parser parser,
XML_CharacterDataHandler handler)
{
- characterDataHandler = handler;
+ if (parser != NULL)
+ parser->m_characterDataHandler = handler;
}
void XMLCALL
XML_SetProcessingInstructionHandler(XML_Parser parser,
XML_ProcessingInstructionHandler handler)
{
- processingInstructionHandler = handler;
+ if (parser != NULL)
+ parser->m_processingInstructionHandler = handler;
}
void XMLCALL
XML_SetCommentHandler(XML_Parser parser,
XML_CommentHandler handler)
{
- commentHandler = handler;
+ if (parser != NULL)
+ parser->m_commentHandler = handler;
}
void XMLCALL
@@ -1352,36 +1590,44 @@ XML_SetCdataSectionHandler(XML_Parser parser,
XML_StartCdataSectionHandler start,
XML_EndCdataSectionHandler end)
{
- startCdataSectionHandler = start;
- endCdataSectionHandler = end;
+ if (parser == NULL)
+ return;
+ parser->m_startCdataSectionHandler = start;
+ parser->m_endCdataSectionHandler = end;
}
void XMLCALL
XML_SetStartCdataSectionHandler(XML_Parser parser,
XML_StartCdataSectionHandler start) {
- startCdataSectionHandler = start;
+ if (parser != NULL)
+ parser->m_startCdataSectionHandler = start;
}
void XMLCALL
XML_SetEndCdataSectionHandler(XML_Parser parser,
XML_EndCdataSectionHandler end) {
- endCdataSectionHandler = end;
+ if (parser != NULL)
+ parser->m_endCdataSectionHandler = end;
}
void XMLCALL
XML_SetDefaultHandler(XML_Parser parser,
XML_DefaultHandler handler)
{
- defaultHandler = handler;
- defaultExpandInternalEntities = XML_FALSE;
+ if (parser == NULL)
+ return;
+ parser->m_defaultHandler = handler;
+ parser->m_defaultExpandInternalEntities = XML_FALSE;
}
void XMLCALL
XML_SetDefaultHandlerExpand(XML_Parser parser,
XML_DefaultHandler handler)
{
- defaultHandler = handler;
- defaultExpandInternalEntities = XML_TRUE;
+ if (parser == NULL)
+ return;
+ parser->m_defaultHandler = handler;
+ parser->m_defaultExpandInternalEntities = XML_TRUE;
}
void XMLCALL
@@ -1389,34 +1635,40 @@ XML_SetDoctypeDeclHandler(XML_Parser parser,
XML_StartDoctypeDeclHandler start,
XML_EndDoctypeDeclHandler end)
{
- startDoctypeDeclHandler = start;
- endDoctypeDeclHandler = end;
+ if (parser == NULL)
+ return;
+ parser->m_startDoctypeDeclHandler = start;
+ parser->m_endDoctypeDeclHandler = end;
}
void XMLCALL
XML_SetStartDoctypeDeclHandler(XML_Parser parser,
XML_StartDoctypeDeclHandler start) {
- startDoctypeDeclHandler = start;
+ if (parser != NULL)
+ parser->m_startDoctypeDeclHandler = start;
}
void XMLCALL
XML_SetEndDoctypeDeclHandler(XML_Parser parser,
XML_EndDoctypeDeclHandler end) {
- endDoctypeDeclHandler = end;
+ if (parser != NULL)
+ parser->m_endDoctypeDeclHandler = end;
}
void XMLCALL
XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
XML_UnparsedEntityDeclHandler handler)
{
- unparsedEntityDeclHandler = handler;
+ if (parser != NULL)
+ parser->m_unparsedEntityDeclHandler = handler;
}
void XMLCALL
XML_SetNotationDeclHandler(XML_Parser parser,
XML_NotationDeclHandler handler)
{
- notationDeclHandler = handler;
+ if (parser != NULL)
+ parser->m_notationDeclHandler = handler;
}
void XMLCALL
@@ -1424,50 +1676,59 @@ XML_SetNamespaceDeclHandler(XML_Parser parser,
XML_StartNamespaceDeclHandler start,
XML_EndNamespaceDeclHandler end)
{
- startNamespaceDeclHandler = start;
- endNamespaceDeclHandler = end;
+ if (parser == NULL)
+ return;
+ parser->m_startNamespaceDeclHandler = start;
+ parser->m_endNamespaceDeclHandler = end;
}
void XMLCALL
XML_SetStartNamespaceDeclHandler(XML_Parser parser,
XML_StartNamespaceDeclHandler start) {
- startNamespaceDeclHandler = start;
+ if (parser != NULL)
+ parser->m_startNamespaceDeclHandler = start;
}
void XMLCALL
XML_SetEndNamespaceDeclHandler(XML_Parser parser,
XML_EndNamespaceDeclHandler end) {
- endNamespaceDeclHandler = end;
+ if (parser != NULL)
+ parser->m_endNamespaceDeclHandler = end;
}
void XMLCALL
XML_SetNotStandaloneHandler(XML_Parser parser,
XML_NotStandaloneHandler handler)
{
- notStandaloneHandler = handler;
+ if (parser != NULL)
+ parser->m_notStandaloneHandler = handler;
}
void XMLCALL
XML_SetExternalEntityRefHandler(XML_Parser parser,
XML_ExternalEntityRefHandler handler)
{
- externalEntityRefHandler = handler;
+ if (parser != NULL)
+ parser->m_externalEntityRefHandler = handler;
}
void XMLCALL
XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg)
{
+ if (parser == NULL)
+ return;
if (arg)
- externalEntityRefHandlerArg = (XML_Parser)arg;
+ parser->m_externalEntityRefHandlerArg = (XML_Parser)arg;
else
- externalEntityRefHandlerArg = parser;
+ parser->m_externalEntityRefHandlerArg = parser;
}
void XMLCALL
XML_SetSkippedEntityHandler(XML_Parser parser,
XML_SkippedEntityHandler handler)
{
- skippedEntityHandler = handler;
+ if (parser != NULL)
+ parser->m_skippedEntityHandler = handler;
}
void XMLCALL
@@ -1475,46 +1736,54 @@ XML_SetUnknownEncodingHandler(XML_Parser parser,
XML_UnknownEncodingHandler handler,
void *data)
{
- unknownEncodingHandler = handler;
- unknownEncodingHandlerData = data;
+ if (parser == NULL)
+ return;
+ parser->m_unknownEncodingHandler = handler;
+ parser->m_unknownEncodingHandlerData = data;
}
void XMLCALL
XML_SetElementDeclHandler(XML_Parser parser,
XML_ElementDeclHandler eldecl)
{
- elementDeclHandler = eldecl;
+ if (parser != NULL)
+ parser->m_elementDeclHandler = eldecl;
}
void XMLCALL
XML_SetAttlistDeclHandler(XML_Parser parser,
XML_AttlistDeclHandler attdecl)
{
- attlistDeclHandler = attdecl;
+ if (parser != NULL)
+ parser->m_attlistDeclHandler = attdecl;
}
void XMLCALL
XML_SetEntityDeclHandler(XML_Parser parser,
XML_EntityDeclHandler handler)
{
- entityDeclHandler = handler;
+ if (parser != NULL)
+ parser->m_entityDeclHandler = handler;
}
void XMLCALL
XML_SetXmlDeclHandler(XML_Parser parser,
XML_XmlDeclHandler handler) {
- xmlDeclHandler = handler;
+ if (parser != NULL)
+ parser->m_xmlDeclHandler = handler;
}
int XMLCALL
XML_SetParamEntityParsing(XML_Parser parser,
enum XML_ParamEntityParsing peParsing)
{
+ if (parser == NULL)
+ return 0;
/* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
+ if (parser->m_parsingStatus.parsing == XML_PARSING || parser->m_parsingStatus.parsing == XML_SUSPENDED)
return 0;
#ifdef XML_DTD
- paramEntityParsing = peParsing;
+ parser->m_paramEntityParsing = peParsing;
return 1;
#else
return peParsing == XML_PARAM_ENTITY_PARSING_NEVER;
@@ -1525,88 +1794,118 @@ int XMLCALL
XML_SetHashSalt(XML_Parser parser,
unsigned long hash_salt)
{
+ if (parser == NULL)
+ return 0;
+ if (parser->m_parentParser)
+ return XML_SetHashSalt(parser->m_parentParser, hash_salt);
/* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
+ if (parser->m_parsingStatus.parsing == XML_PARSING || parser->m_parsingStatus.parsing == XML_SUSPENDED)
return 0;
- hash_secret_salt = hash_salt;
+ parser->m_hash_secret_salt = hash_salt;
return 1;
}
enum XML_Status XMLCALL
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
{
- switch (ps_parsing) {
+ if ((parser == NULL) || (len < 0) || ((s == NULL) && (len != 0))) {
+ if (parser != NULL)
+ parser->m_errorCode = XML_ERROR_INVALID_ARGUMENT;
+ return XML_STATUS_ERROR;
+ }
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
- errorCode = XML_ERROR_SUSPENDED;
+ parser->m_errorCode = XML_ERROR_SUSPENDED;
return XML_STATUS_ERROR;
case XML_FINISHED:
- errorCode = XML_ERROR_FINISHED;
+ parser->m_errorCode = XML_ERROR_FINISHED;
return XML_STATUS_ERROR;
case XML_INITIALIZED:
- if (parentParser == NULL && !startParsing(parser)) {
- errorCode = XML_ERROR_NO_MEMORY;
+ if (parser->m_parentParser == NULL && !startParsing(parser)) {
+ parser->m_errorCode = XML_ERROR_NO_MEMORY;
return XML_STATUS_ERROR;
}
+ /* fall through */
default:
- ps_parsing = XML_PARSING;
+ parser->m_parsingStatus.parsing = XML_PARSING;
}
if (len == 0) {
- ps_finalBuffer = (XML_Bool)isFinal;
+ parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal;
if (!isFinal)
return XML_STATUS_OK;
- positionPtr = bufferPtr;
- parseEndPtr = bufferEnd;
+ parser->m_positionPtr = parser->m_bufferPtr;
+ parser->m_parseEndPtr = parser->m_bufferEnd;
/* If data are left over from last buffer, and we now know that these
data are the final chunk of input, then we have to check them again
to detect errors based on that fact.
*/
- errorCode = processor(parser, bufferPtr, parseEndPtr, &bufferPtr);
+ parser->m_errorCode = parser->m_processor(parser, parser->m_bufferPtr, parser->m_parseEndPtr, &parser->m_bufferPtr);
- if (errorCode == XML_ERROR_NONE) {
- switch (ps_parsing) {
+ if (parser->m_errorCode == XML_ERROR_NONE) {
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
- XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
- positionPtr = bufferPtr;
+ /* It is hard to be certain, but it seems that this case
+ * cannot occur. This code is cleaning up a previous parse
+ * with no new data (since len == 0). Changing the parsing
+ * state requires getting to execute a handler function, and
+ * there doesn't seem to be an opportunity for that while in
+ * this circumstance.
+ *
+ * Given the uncertainty, we retain the code but exclude it
+ * from coverage tests.
+ *
+ * LCOV_EXCL_START
+ */
+ XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, parser->m_bufferPtr, &parser->m_position);
+ parser->m_positionPtr = parser->m_bufferPtr;
return XML_STATUS_SUSPENDED;
+ /* LCOV_EXCL_STOP */
case XML_INITIALIZED:
case XML_PARSING:
- ps_parsing = XML_FINISHED;
+ parser->m_parsingStatus.parsing = XML_FINISHED;
/* fall through */
default:
return XML_STATUS_OK;
}
}
- eventEndPtr = eventPtr;
- processor = errorProcessor;
+ parser->m_eventEndPtr = parser->m_eventPtr;
+ parser->m_processor = errorProcessor;
return XML_STATUS_ERROR;
}
#ifndef XML_CONTEXT_BYTES
- else if (bufferPtr == bufferEnd) {
+ else if (parser->m_bufferPtr == parser->m_bufferEnd) {
const char *end;
int nLeftOver;
enum XML_Status result;
- parseEndByteIndex += len;
- positionPtr = s;
- ps_finalBuffer = (XML_Bool)isFinal;
+ /* Detect overflow (a+b > MAX <==> b > MAX-a) */
+ if (len > ((XML_Size)-1) / 2 - parser->m_parseEndByteIndex) {
+ parser->m_errorCode = XML_ERROR_NO_MEMORY;
+ parser->m_eventPtr = parser->m_eventEndPtr = NULL;
+ parser->m_processor = errorProcessor;
+ return XML_STATUS_ERROR;
+ }
+ parser->m_parseEndByteIndex += len;
+ parser->m_positionPtr = s;
+ parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal;
- errorCode = processor(parser, s, parseEndPtr = s + len, &end);
+ parser->m_errorCode = parser->m_processor(parser, s, parser->m_parseEndPtr = s + len, &end);
- if (errorCode != XML_ERROR_NONE) {
- eventEndPtr = eventPtr;
- processor = errorProcessor;
+ if (parser->m_errorCode != XML_ERROR_NONE) {
+ parser->m_eventEndPtr = parser->m_eventPtr;
+ parser->m_processor = errorProcessor;
return XML_STATUS_ERROR;
}
else {
- switch (ps_parsing) {
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
result = XML_STATUS_SUSPENDED;
break;
case XML_INITIALIZED:
case XML_PARSING:
if (isFinal) {
- ps_parsing = XML_FINISHED;
+ parser->m_parsingStatus.parsing = XML_FINISHED;
return XML_STATUS_OK;
}
/* fall through */
@@ -1615,32 +1914,33 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
}
}
- XmlUpdatePosition(encoding, positionPtr, end, &position);
+ XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, end, &parser->m_position);
nLeftOver = s + len - end;
if (nLeftOver) {
- if (buffer == NULL || nLeftOver > bufferLim - buffer) {
- /* FIXME avoid integer overflow */
- char *temp;
- temp = (buffer == NULL
- ? (char *)MALLOC(len * 2)
- : (char *)REALLOC(buffer, len * 2));
+ if (parser->m_buffer == NULL || nLeftOver > parser->m_bufferLim - parser->m_buffer) {
+ /* avoid _signed_ integer overflow */
+ char *temp = NULL;
+ const int bytesToAllocate = (int)((unsigned)len * 2U);
+ if (bytesToAllocate > 0) {
+ temp = (char *)REALLOC(parser, parser->m_buffer, bytesToAllocate);
+ }
if (temp == NULL) {
- errorCode = XML_ERROR_NO_MEMORY;
- eventPtr = eventEndPtr = NULL;
- processor = errorProcessor;
+ parser->m_errorCode = XML_ERROR_NO_MEMORY;
+ parser->m_eventPtr = parser->m_eventEndPtr = NULL;
+ parser->m_processor = errorProcessor;
return XML_STATUS_ERROR;
}
- buffer = temp;
- bufferLim = buffer + len * 2;
+ parser->m_buffer = temp;
+ parser->m_bufferLim = parser->m_buffer + bytesToAllocate;
}
- memcpy(buffer, end, nLeftOver);
+ memcpy(parser->m_buffer, end, nLeftOver);
}
- bufferPtr = buffer;
- bufferEnd = buffer + nLeftOver;
- positionPtr = bufferPtr;
- parseEndPtr = bufferEnd;
- eventPtr = bufferPtr;
- eventEndPtr = bufferPtr;
+ parser->m_bufferPtr = parser->m_buffer;
+ parser->m_bufferEnd = parser->m_buffer + nLeftOver;
+ parser->m_positionPtr = parser->m_bufferPtr;
+ parser->m_parseEndPtr = parser->m_bufferEnd;
+ parser->m_eventPtr = parser->m_bufferPtr;
+ parser->m_eventEndPtr = parser->m_bufferPtr;
return result;
}
#endif /* not defined XML_CONTEXT_BYTES */
@@ -1661,106 +1961,118 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
const char *start;
enum XML_Status result = XML_STATUS_OK;
- switch (ps_parsing) {
+ if (parser == NULL)
+ return XML_STATUS_ERROR;
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
- errorCode = XML_ERROR_SUSPENDED;
+ parser->m_errorCode = XML_ERROR_SUSPENDED;
return XML_STATUS_ERROR;
case XML_FINISHED:
- errorCode = XML_ERROR_FINISHED;
+ parser->m_errorCode = XML_ERROR_FINISHED;
return XML_STATUS_ERROR;
case XML_INITIALIZED:
- if (parentParser == NULL && !startParsing(parser)) {
- errorCode = XML_ERROR_NO_MEMORY;
+ if (parser->m_parentParser == NULL && !startParsing(parser)) {
+ parser->m_errorCode = XML_ERROR_NO_MEMORY;
return XML_STATUS_ERROR;
}
+ /* fall through */
default:
- ps_parsing = XML_PARSING;
+ parser->m_parsingStatus.parsing = XML_PARSING;
}
- start = bufferPtr;
- positionPtr = start;
- bufferEnd += len;
- parseEndPtr = bufferEnd;
- parseEndByteIndex += len;
- ps_finalBuffer = (XML_Bool)isFinal;
+ start = parser->m_bufferPtr;
+ parser->m_positionPtr = start;
+ parser->m_bufferEnd += len;
+ parser->m_parseEndPtr = parser->m_bufferEnd;
+ parser->m_parseEndByteIndex += len;
+ parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal;
- errorCode = processor(parser, start, parseEndPtr, &bufferPtr);
+ parser->m_errorCode = parser->m_processor(parser, start, parser->m_parseEndPtr, &parser->m_bufferPtr);
- if (errorCode != XML_ERROR_NONE) {
- eventEndPtr = eventPtr;
- processor = errorProcessor;
+ if (parser->m_errorCode != XML_ERROR_NONE) {
+ parser->m_eventEndPtr = parser->m_eventPtr;
+ parser->m_processor = errorProcessor;
return XML_STATUS_ERROR;
}
else {
- switch (ps_parsing) {
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
result = XML_STATUS_SUSPENDED;
break;
case XML_INITIALIZED:
case XML_PARSING:
if (isFinal) {
- ps_parsing = XML_FINISHED;
+ parser->m_parsingStatus.parsing = XML_FINISHED;
return result;
}
default: ; /* should not happen */
}
}
- XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
- positionPtr = bufferPtr;
+ XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, parser->m_bufferPtr, &parser->m_position);
+ parser->m_positionPtr = parser->m_bufferPtr;
return result;
}
void * XMLCALL
XML_GetBuffer(XML_Parser parser, int len)
{
+ if (parser == NULL)
+ return NULL;
if (len < 0) {
- errorCode = XML_ERROR_NO_MEMORY;
+ parser->m_errorCode = XML_ERROR_NO_MEMORY;
return NULL;
}
- switch (ps_parsing) {
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
- errorCode = XML_ERROR_SUSPENDED;
+ parser->m_errorCode = XML_ERROR_SUSPENDED;
return NULL;
case XML_FINISHED:
- errorCode = XML_ERROR_FINISHED;
+ parser->m_errorCode = XML_ERROR_FINISHED;
return NULL;
default: ;
}
- if (len > bufferLim - bufferEnd) {
+ if (len > EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferEnd)) {
#ifdef XML_CONTEXT_BYTES
int keep;
#endif /* defined XML_CONTEXT_BYTES */
/* Do not invoke signed arithmetic overflow: */
- int neededSize = (int) ((unsigned)len + (unsigned)(bufferEnd - bufferPtr));
+ int neededSize = (int) ((unsigned)len +
+ (unsigned)EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd,
+ parser->m_bufferPtr));
if (neededSize < 0) {
- errorCode = XML_ERROR_NO_MEMORY;
+ parser->m_errorCode = XML_ERROR_NO_MEMORY;
return NULL;
}
#ifdef XML_CONTEXT_BYTES
- keep = (int)(bufferPtr - buffer);
+ keep = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer);
if (keep > XML_CONTEXT_BYTES)
keep = XML_CONTEXT_BYTES;
neededSize += keep;
#endif /* defined XML_CONTEXT_BYTES */
- if (neededSize <= bufferLim - buffer) {
+ if (neededSize <= EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_buffer)) {
#ifdef XML_CONTEXT_BYTES
- if (keep < bufferPtr - buffer) {
- int offset = (int)(bufferPtr - buffer) - keep;
- memmove(buffer, &buffer[offset], bufferEnd - bufferPtr + keep);
- bufferEnd -= offset;
- bufferPtr -= offset;
+ if (keep < EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer)) {
+ int offset = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer) - keep;
+ /* The buffer pointers cannot be NULL here; we have at least some bytes in the buffer */
+ memmove(parser->m_buffer, &parser->m_buffer[offset], parser->m_bufferEnd - parser->m_bufferPtr + keep);
+ parser->m_bufferEnd -= offset;
+ parser->m_bufferPtr -= offset;
}
#else
- memmove(buffer, bufferPtr, bufferEnd - bufferPtr);
- bufferEnd = buffer + (bufferEnd - bufferPtr);
- bufferPtr = buffer;
+ if (parser->m_buffer && parser->m_bufferPtr) {
+ memmove(parser->m_buffer, parser->m_bufferPtr,
+ EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr));
+ parser->m_bufferEnd = parser->m_buffer +
+ EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr);
+ parser->m_bufferPtr = parser->m_buffer;
+ }
#endif /* not defined XML_CONTEXT_BYTES */
}
else {
char *newBuf;
- int bufferSize = (int)(bufferLim - bufferPtr);
+ int bufferSize = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferPtr);
if (bufferSize == 0)
bufferSize = INIT_BUFFER_SIZE;
do {
@@ -1768,71 +2080,82 @@ XML_GetBuffer(XML_Parser parser, int len)
bufferSize = (int) (2U * (unsigned) bufferSize);
} while (bufferSize < neededSize && bufferSize > 0);
if (bufferSize <= 0) {
- errorCode = XML_ERROR_NO_MEMORY;
+ parser->m_errorCode = XML_ERROR_NO_MEMORY;
return NULL;
}
- newBuf = (char *)MALLOC(bufferSize);
+ newBuf = (char *)MALLOC(parser, bufferSize);
if (newBuf == 0) {
- errorCode = XML_ERROR_NO_MEMORY;
+ parser->m_errorCode = XML_ERROR_NO_MEMORY;
return NULL;
}
- bufferLim = newBuf + bufferSize;
+ parser->m_bufferLim = newBuf + bufferSize;
#ifdef XML_CONTEXT_BYTES
- if (bufferPtr) {
- int keep = (int)(bufferPtr - buffer);
+ if (parser->m_bufferPtr) {
+ int keep = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer);
if (keep > XML_CONTEXT_BYTES)
keep = XML_CONTEXT_BYTES;
- memcpy(newBuf, &bufferPtr[-keep], bufferEnd - bufferPtr + keep);
- FREE(buffer);
- buffer = newBuf;
- bufferEnd = buffer + (bufferEnd - bufferPtr) + keep;
- bufferPtr = buffer + keep;
+ memcpy(newBuf, &parser->m_bufferPtr[-keep],
+ EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr) + keep);
+ FREE(parser, parser->m_buffer);
+ parser->m_buffer = newBuf;
+ parser->m_bufferEnd = parser->m_buffer +
+ EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr) + keep;
+ parser->m_bufferPtr = parser->m_buffer + keep;
}
else {
- bufferEnd = newBuf + (bufferEnd - bufferPtr);
- bufferPtr = buffer = newBuf;
+ /* This must be a brand new buffer with no data in it yet */
+ parser->m_bufferEnd = newBuf;
+ parser->m_bufferPtr = parser->m_buffer = newBuf;
}
#else
- if (bufferPtr) {
- memcpy(newBuf, bufferPtr, bufferEnd - bufferPtr);
- FREE(buffer);
+ if (parser->m_bufferPtr) {
+ memcpy(newBuf, parser->m_bufferPtr,
+ EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr));
+ FREE(parser, parser->m_buffer);
+ parser->m_bufferEnd = newBuf +
+ EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr);
}
- bufferEnd = newBuf + (bufferEnd - bufferPtr);
- bufferPtr = buffer = newBuf;
+ else {
+ /* This must be a brand new buffer with no data in it yet */
+ parser->m_bufferEnd = newBuf;
+ }
+ parser->m_bufferPtr = parser->m_buffer = newBuf;
#endif /* not defined XML_CONTEXT_BYTES */
}
- eventPtr = eventEndPtr = NULL;
- positionPtr = NULL;
+ parser->m_eventPtr = parser->m_eventEndPtr = NULL;
+ parser->m_positionPtr = NULL;
}
- return bufferEnd;
+ return parser->m_bufferEnd;
}
enum XML_Status XMLCALL
XML_StopParser(XML_Parser parser, XML_Bool resumable)
{
- switch (ps_parsing) {
+ if (parser == NULL)
+ return XML_STATUS_ERROR;
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
if (resumable) {
- errorCode = XML_ERROR_SUSPENDED;
+ parser->m_errorCode = XML_ERROR_SUSPENDED;
return XML_STATUS_ERROR;
}
- ps_parsing = XML_FINISHED;
+ parser->m_parsingStatus.parsing = XML_FINISHED;
break;
case XML_FINISHED:
- errorCode = XML_ERROR_FINISHED;
+ parser->m_errorCode = XML_ERROR_FINISHED;
return XML_STATUS_ERROR;
default:
if (resumable) {
#ifdef XML_DTD
- if (isParamEntity) {
- errorCode = XML_ERROR_SUSPEND_PE;
+ if (parser->m_isParamEntity) {
+ parser->m_errorCode = XML_ERROR_SUSPEND_PE;
return XML_STATUS_ERROR;
}
#endif
- ps_parsing = XML_SUSPENDED;
+ parser->m_parsingStatus.parsing = XML_SUSPENDED;
}
else
- ps_parsing = XML_FINISHED;
+ parser->m_parsingStatus.parsing = XML_FINISHED;
}
return XML_STATUS_OK;
}
@@ -1842,42 +2165,46 @@ XML_ResumeParser(XML_Parser parser)
{
enum XML_Status result = XML_STATUS_OK;
- if (ps_parsing != XML_SUSPENDED) {
- errorCode = XML_ERROR_NOT_SUSPENDED;
+ if (parser == NULL)
+ return XML_STATUS_ERROR;
+ if (parser->m_parsingStatus.parsing != XML_SUSPENDED) {
+ parser->m_errorCode = XML_ERROR_NOT_SUSPENDED;
return XML_STATUS_ERROR;
}
- ps_parsing = XML_PARSING;
+ parser->m_parsingStatus.parsing = XML_PARSING;
- errorCode = processor(parser, bufferPtr, parseEndPtr, &bufferPtr);
+ parser->m_errorCode = parser->m_processor(parser, parser->m_bufferPtr, parser->m_parseEndPtr, &parser->m_bufferPtr);
- if (errorCode != XML_ERROR_NONE) {
- eventEndPtr = eventPtr;
- processor = errorProcessor;
+ if (parser->m_errorCode != XML_ERROR_NONE) {
+ parser->m_eventEndPtr = parser->m_eventPtr;
+ parser->m_processor = errorProcessor;
return XML_STATUS_ERROR;
}
else {
- switch (ps_parsing) {
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
result = XML_STATUS_SUSPENDED;
break;
case XML_INITIALIZED:
case XML_PARSING:
- if (ps_finalBuffer) {
- ps_parsing = XML_FINISHED;
+ if (parser->m_parsingStatus.finalBuffer) {
+ parser->m_parsingStatus.parsing = XML_FINISHED;
return result;
}
default: ;
}
}
- XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
- positionPtr = bufferPtr;
+ XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, parser->m_bufferPtr, &parser->m_position);
+ parser->m_positionPtr = parser->m_bufferPtr;
return result;
}
void XMLCALL
XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status)
{
+ if (parser == NULL)
+ return;
assert(status != NULL);
*status = parser->m_parsingStatus;
}
@@ -1885,22 +2212,28 @@ XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status)
enum XML_Error XMLCALL
XML_GetErrorCode(XML_Parser parser)
{
- return errorCode;
+ if (parser == NULL)
+ return XML_ERROR_INVALID_ARGUMENT;
+ return parser->m_errorCode;
}
XML_Index XMLCALL
XML_GetCurrentByteIndex(XML_Parser parser)
{
- if (eventPtr)
- return (XML_Index)(parseEndByteIndex - (parseEndPtr - eventPtr));
+ if (parser == NULL)
+ return -1;
+ if (parser->m_eventPtr)
+ return (XML_Index)(parser->m_parseEndByteIndex - (parser->m_parseEndPtr - parser->m_eventPtr));
return -1;
}
int XMLCALL
XML_GetCurrentByteCount(XML_Parser parser)
{
- if (eventEndPtr && eventPtr)
- return (int)(eventEndPtr - eventPtr);
+ if (parser == NULL)
+ return 0;
+ if (parser->m_eventEndPtr && parser->m_eventPtr)
+ return (int)(parser->m_eventEndPtr - parser->m_eventPtr);
return 0;
}
@@ -1908,11 +2241,19 @@ const char * XMLCALL
XML_GetInputContext(XML_Parser parser, int *offset, int *size)
{
#ifdef XML_CONTEXT_BYTES
- if (eventPtr && buffer) {
- *offset = (int)(eventPtr - buffer);
- *size = (int)(bufferEnd - buffer);
- return buffer;
+ if (parser == NULL)
+ return NULL;
+ if (parser->m_eventPtr && parser->m_buffer) {
+ if (offset != NULL)
+ *offset = (int)(parser->m_eventPtr - parser->m_buffer);
+ if (size != NULL)
+ *size = (int)(parser->m_bufferEnd - parser->m_buffer);
+ return parser->m_buffer;
}
+#else
+ (void)parser;
+ (void)offset;
+ (void)size;
#endif /* defined XML_CONTEXT_BYTES */
return (char *) 0;
}
@@ -1920,109 +2261,166 @@ XML_GetInputContext(XML_Parser parser, int *offset, int *size)
XML_Size XMLCALL
XML_GetCurrentLineNumber(XML_Parser parser)
{
- if (eventPtr && eventPtr >= positionPtr) {
- XmlUpdatePosition(encoding, positionPtr, eventPtr, &position);
- positionPtr = eventPtr;
+ if (parser == NULL)
+ return 0;
+ if (parser->m_eventPtr && parser->m_eventPtr >= parser->m_positionPtr) {
+ XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, parser->m_eventPtr, &parser->m_position);
+ parser->m_positionPtr = parser->m_eventPtr;
}
- return position.lineNumber + 1;
+ return parser->m_position.lineNumber + 1;
}
XML_Size XMLCALL
XML_GetCurrentColumnNumber(XML_Parser parser)
{
- if (eventPtr && eventPtr >= positionPtr) {
- XmlUpdatePosition(encoding, positionPtr, eventPtr, &position);
- positionPtr = eventPtr;
+ if (parser == NULL)
+ return 0;
+ if (parser->m_eventPtr && parser->m_eventPtr >= parser->m_positionPtr) {
+ XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, parser->m_eventPtr, &parser->m_position);
+ parser->m_positionPtr = parser->m_eventPtr;
}
- return position.columnNumber;
+ return parser->m_position.columnNumber;
}
void XMLCALL
XML_FreeContentModel(XML_Parser parser, XML_Content *model)
{
- FREE(model);
+ if (parser != NULL)
+ FREE(parser, model);
}
void * XMLCALL
XML_MemMalloc(XML_Parser parser, size_t size)
{
- return MALLOC(size);
+ if (parser == NULL)
+ return NULL;
+ return MALLOC(parser, size);
}
void * XMLCALL
XML_MemRealloc(XML_Parser parser, void *ptr, size_t size)
{
- return REALLOC(ptr, size);
+ if (parser == NULL)
+ return NULL;
+ return REALLOC(parser, ptr, size);
}
void XMLCALL
XML_MemFree(XML_Parser parser, void *ptr)
{
- FREE(ptr);
+ if (parser != NULL)
+ FREE(parser, ptr);
}
void XMLCALL
XML_DefaultCurrent(XML_Parser parser)
{
- if (defaultHandler) {
- if (openInternalEntities)
+ if (parser == NULL)
+ return;
+ if (parser->m_defaultHandler) {
+ if (parser->m_openInternalEntities)
reportDefault(parser,
- internalEncoding,
- openInternalEntities->internalEventPtr,
- openInternalEntities->internalEventEndPtr);
+ parser->m_internalEncoding,
+ parser->m_openInternalEntities->internalEventPtr,
+ parser->m_openInternalEntities->internalEventEndPtr);
else
- reportDefault(parser, encoding, eventPtr, eventEndPtr);
+ reportDefault(parser, parser->m_encoding, parser->m_eventPtr, parser->m_eventEndPtr);
}
}
const XML_LChar * XMLCALL
XML_ErrorString(enum XML_Error code)
{
- static const XML_LChar* const message[] = {
- 0,
- XML_L("out of memory"),
- XML_L("syntax error"),
- XML_L("no element found"),
- XML_L("not well-formed (invalid token)"),
- XML_L("unclosed token"),
- XML_L("partial character"),
- XML_L("mismatched tag"),
- XML_L("duplicate attribute"),
- XML_L("junk after document element"),
- XML_L("illegal parameter entity reference"),
- XML_L("undefined entity"),
- XML_L("recursive entity reference"),
- XML_L("asynchronous entity"),
- XML_L("reference to invalid character number"),
- XML_L("reference to binary entity"),
- XML_L("reference to external entity in attribute"),
- XML_L("XML or text declaration not at start of entity"),
- XML_L("unknown encoding"),
- XML_L("encoding specified in XML declaration is incorrect"),
- XML_L("unclosed CDATA section"),
- XML_L("error in processing external entity reference"),
- XML_L("document is not standalone"),
- XML_L("unexpected parser state - please send a bug report"),
- XML_L("entity declared in parameter entity"),
- XML_L("requested feature requires XML_DTD support in Expat"),
- XML_L("cannot change setting once parsing has begun"),
- XML_L("unbound prefix"),
- XML_L("must not undeclare prefix"),
- XML_L("incomplete markup in parameter entity"),
- XML_L("XML declaration not well-formed"),
- XML_L("text declaration not well-formed"),
- XML_L("illegal character(s) in public id"),
- XML_L("parser suspended"),
- XML_L("parser not suspended"),
- XML_L("parsing aborted"),
- XML_L("parsing finished"),
- XML_L("cannot suspend in external parameter entity"),
- XML_L("reserved prefix (xml) must not be undeclared or bound to another namespace name"),
- XML_L("reserved prefix (xmlns) must not be declared or undeclared"),
- XML_L("prefix must not be bound to one of the reserved namespace names")
- };
- if (code > 0 && code < sizeof(message)/sizeof(message[0]))
- return message[code];
+ switch (code) {
+ case XML_ERROR_NONE:
+ return NULL;
+ case XML_ERROR_NO_MEMORY:
+ return XML_L("out of memory");
+ case XML_ERROR_SYNTAX:
+ return XML_L("syntax error");
+ case XML_ERROR_NO_ELEMENTS:
+ return XML_L("no element found");
+ case XML_ERROR_INVALID_TOKEN:
+ return XML_L("not well-formed (invalid token)");
+ case XML_ERROR_UNCLOSED_TOKEN:
+ return XML_L("unclosed token");
+ case XML_ERROR_PARTIAL_CHAR:
+ return XML_L("partial character");
+ case XML_ERROR_TAG_MISMATCH:
+ return XML_L("mismatched tag");
+ case XML_ERROR_DUPLICATE_ATTRIBUTE:
+ return XML_L("duplicate attribute");
+ case XML_ERROR_JUNK_AFTER_DOC_ELEMENT:
+ return XML_L("junk after document element");
+ case XML_ERROR_PARAM_ENTITY_REF:
+ return XML_L("illegal parameter entity reference");
+ case XML_ERROR_UNDEFINED_ENTITY:
+ return XML_L("undefined entity");
+ case XML_ERROR_RECURSIVE_ENTITY_REF:
+ return XML_L("recursive entity reference");
+ case XML_ERROR_ASYNC_ENTITY:
+ return XML_L("asynchronous entity");
+ case XML_ERROR_BAD_CHAR_REF:
+ return XML_L("reference to invalid character number");
+ case XML_ERROR_BINARY_ENTITY_REF:
+ return XML_L("reference to binary entity");
+ case XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF:
+ return XML_L("reference to external entity in attribute");
+ case XML_ERROR_MISPLACED_XML_PI:
+ return XML_L("XML or text declaration not at start of entity");
+ case XML_ERROR_UNKNOWN_ENCODING:
+ return XML_L("unknown encoding");
+ case XML_ERROR_INCORRECT_ENCODING:
+ return XML_L("encoding specified in XML declaration is incorrect");
+ case XML_ERROR_UNCLOSED_CDATA_SECTION:
+ return XML_L("unclosed CDATA section");
+ case XML_ERROR_EXTERNAL_ENTITY_HANDLING:
+ return XML_L("error in processing external entity reference");
+ case XML_ERROR_NOT_STANDALONE:
+ return XML_L("document is not standalone");
+ case XML_ERROR_UNEXPECTED_STATE:
+ return XML_L("unexpected parser state - please send a bug report");
+ case XML_ERROR_ENTITY_DECLARED_IN_PE:
+ return XML_L("entity declared in parameter entity");
+ case XML_ERROR_FEATURE_REQUIRES_XML_DTD:
+ return XML_L("requested feature requires XML_DTD support in Expat");
+ case XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING:
+ return XML_L("cannot change setting once parsing has begun");
+ /* Added in 1.95.7. */
+ case XML_ERROR_UNBOUND_PREFIX:
+ return XML_L("unbound prefix");
+ /* Added in 1.95.8. */
+ case XML_ERROR_UNDECLARING_PREFIX:
+ return XML_L("must not undeclare prefix");
+ case XML_ERROR_INCOMPLETE_PE:
+ return XML_L("incomplete markup in parameter entity");
+ case XML_ERROR_XML_DECL:
+ return XML_L("XML declaration not well-formed");
+ case XML_ERROR_TEXT_DECL:
+ return XML_L("text declaration not well-formed");
+ case XML_ERROR_PUBLICID:
+ return XML_L("illegal character(s) in public id");
+ case XML_ERROR_SUSPENDED:
+ return XML_L("parser suspended");
+ case XML_ERROR_NOT_SUSPENDED:
+ return XML_L("parser not suspended");
+ case XML_ERROR_ABORTED:
+ return XML_L("parsing aborted");
+ case XML_ERROR_FINISHED:
+ return XML_L("parsing finished");
+ case XML_ERROR_SUSPEND_PE:
+ return XML_L("cannot suspend in external parameter entity");
+ /* Added in 2.0.0. */
+ case XML_ERROR_RESERVED_PREFIX_XML:
+ return XML_L("reserved prefix (xml) must not be undeclared or bound to another namespace name");
+ case XML_ERROR_RESERVED_PREFIX_XMLNS:
+ return XML_L("reserved prefix (xmlns) must not be declared or undeclared");
+ case XML_ERROR_RESERVED_NAMESPACE_URI:
+ return XML_L("prefix must not be bound to one of the reserved namespace names");
+ /* Added in 2.2.5. */
+ case XML_ERROR_INVALID_ARGUMENT: /* Constant added in 2.2.1, already */
+ return XML_L("invalid argument");
+ }
return NULL;
}
@@ -2105,12 +2503,12 @@ XML_GetFeatureList(void)
static XML_Bool
storeRawNames(XML_Parser parser)
{
- TAG *tag = tagStack;
+ TAG *tag = parser->m_tagStack;
while (tag) {
int bufSize;
int nameLen = sizeof(XML_Char) * (tag->name.strLen + 1);
char *rawNameBuf = tag->buf + nameLen;
- /* Stop if already stored. Since tagStack is a stack, we can stop
+ /* Stop if already stored. Since m_tagStack is a stack, we can stop
at the first entry that has already been copied; everything
below it in the stack is already been accounted for in a
previous call to this function.
@@ -2122,7 +2520,7 @@ storeRawNames(XML_Parser parser)
*/
bufSize = nameLen + ROUND_UP(tag->rawNameLength, sizeof(XML_Char));
if (bufSize > tag->bufEnd - tag->buf) {
- char *temp = (char *)REALLOC(tag->buf, bufSize);
+ char *temp = (char *)REALLOC(parser, tag->buf, bufSize);
if (temp == NULL)
return XML_FALSE;
/* if tag->name.str points to tag->buf (only when namespace
@@ -2153,8 +2551,8 @@ contentProcessor(XML_Parser parser,
const char *end,
const char **endPtr)
{
- enum XML_Error result = doContent(parser, 0, encoding, start, end,
- endPtr, (XML_Bool)!ps_finalBuffer);
+ enum XML_Error result = doContent(parser, 0, parser->m_encoding, start, end,
+ endPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer);
if (result == XML_ERROR_NONE) {
if (!storeRawNames(parser))
return XML_ERROR_NO_MEMORY;
@@ -2171,7 +2569,7 @@ externalEntityInitProcessor(XML_Parser parser,
enum XML_Error result = initializeEncoding(parser);
if (result != XML_ERROR_NONE)
return result;
- processor = externalEntityInitProcessor2;
+ parser->m_processor = externalEntityInitProcessor2;
return externalEntityInitProcessor2(parser, start, end, endPtr);
}
@@ -2182,7 +2580,7 @@ externalEntityInitProcessor2(XML_Parser parser,
const char **endPtr)
{
const char *next = start; /* XmlContentTok doesn't always set the last arg */
- int tok = XmlContentTok(encoding, start, end, &next);
+ int tok = XmlContentTok(parser->m_encoding, start, end, &next);
switch (tok) {
case XML_TOK_BOM:
/* If we are at the end of the buffer, this would cause the next stage,
@@ -2190,28 +2588,28 @@ externalEntityInitProcessor2(XML_Parser parser,
doContent (by detecting XML_TOK_NONE) without processing any xml text
declaration - causing the error XML_ERROR_MISPLACED_XML_PI in doContent.
*/
- if (next == end && !ps_finalBuffer) {
+ if (next == end && !parser->m_parsingStatus.finalBuffer) {
*endPtr = next;
return XML_ERROR_NONE;
}
start = next;
break;
case XML_TOK_PARTIAL:
- if (!ps_finalBuffer) {
+ if (!parser->m_parsingStatus.finalBuffer) {
*endPtr = start;
return XML_ERROR_NONE;
}
- eventPtr = start;
+ parser->m_eventPtr = start;
return XML_ERROR_UNCLOSED_TOKEN;
case XML_TOK_PARTIAL_CHAR:
- if (!ps_finalBuffer) {
+ if (!parser->m_parsingStatus.finalBuffer) {
*endPtr = start;
return XML_ERROR_NONE;
}
- eventPtr = start;
+ parser->m_eventPtr = start;
return XML_ERROR_PARTIAL_CHAR;
}
- processor = externalEntityInitProcessor3;
+ parser->m_processor = externalEntityInitProcessor3;
return externalEntityInitProcessor3(parser, start, end, endPtr);
}
@@ -2223,9 +2621,9 @@ externalEntityInitProcessor3(XML_Parser parser,
{
int tok;
const char *next = start; /* XmlContentTok doesn't always set the last arg */
- eventPtr = start;
- tok = XmlContentTok(encoding, start, end, &next);
- eventEndPtr = next;
+ parser->m_eventPtr = start;
+ tok = XmlContentTok(parser->m_encoding, start, end, &next);
+ parser->m_eventEndPtr = next;
switch (tok) {
case XML_TOK_XML_DECL:
@@ -2234,7 +2632,7 @@ externalEntityInitProcessor3(XML_Parser parser,
result = processXmlDecl(parser, 1, start, next);
if (result != XML_ERROR_NONE)
return result;
- switch (ps_parsing) {
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
*endPtr = next;
return XML_ERROR_NONE;
@@ -2246,20 +2644,20 @@ externalEntityInitProcessor3(XML_Parser parser,
}
break;
case XML_TOK_PARTIAL:
- if (!ps_finalBuffer) {
+ if (!parser->m_parsingStatus.finalBuffer) {
*endPtr = start;
return XML_ERROR_NONE;
}
return XML_ERROR_UNCLOSED_TOKEN;
case XML_TOK_PARTIAL_CHAR:
- if (!ps_finalBuffer) {
+ if (!parser->m_parsingStatus.finalBuffer) {
*endPtr = start;
return XML_ERROR_NONE;
}
return XML_ERROR_PARTIAL_CHAR;
}
- processor = externalEntityContentProcessor;
- tagLevel = 1;
+ parser->m_processor = externalEntityContentProcessor;
+ parser->m_tagLevel = 1;
return externalEntityContentProcessor(parser, start, end, endPtr);
}
@@ -2269,8 +2667,8 @@ externalEntityContentProcessor(XML_Parser parser,
const char *end,
const char **endPtr)
{
- enum XML_Error result = doContent(parser, 1, encoding, start, end,
- endPtr, (XML_Bool)!ps_finalBuffer);
+ enum XML_Error result = doContent(parser, 1, parser->m_encoding, start, end,
+ endPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer);
if (result == XML_ERROR_NONE) {
if (!storeRawNames(parser))
return XML_ERROR_NO_MEMORY;
@@ -2288,17 +2686,17 @@ doContent(XML_Parser parser,
XML_Bool haveMore)
{
/* save one level of indirection */
- DTD * const dtd = _dtd;
+ DTD * const dtd = parser->m_dtd;
const char **eventPP;
const char **eventEndPP;
- if (enc == encoding) {
- eventPP = &eventPtr;
- eventEndPP = &eventEndPtr;
+ if (enc == parser->m_encoding) {
+ eventPP = &parser->m_eventPtr;
+ eventEndPP = &parser->m_eventEndPtr;
}
else {
- eventPP = &(openInternalEntities->internalEventPtr);
- eventEndPP = &(openInternalEntities->internalEventEndPtr);
+ eventPP = &(parser->m_openInternalEntities->internalEventPtr);
+ eventEndPP = &(parser->m_openInternalEntities->internalEventEndPtr);
}
*eventPP = s;
@@ -2313,18 +2711,18 @@ doContent(XML_Parser parser,
return XML_ERROR_NONE;
}
*eventEndPP = end;
- if (characterDataHandler) {
+ if (parser->m_characterDataHandler) {
XML_Char c = 0xA;
- characterDataHandler(handlerArg, &c, 1);
+ parser->m_characterDataHandler(parser->m_handlerArg, &c, 1);
}
- else if (defaultHandler)
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, end);
/* We are at the end of the final buffer, should we check for
XML_SUSPENDED, XML_FINISHED?
*/
if (startTagLevel == 0)
return XML_ERROR_NO_ELEMENTS;
- if (tagLevel != startTagLevel)
+ if (parser->m_tagLevel != startTagLevel)
return XML_ERROR_ASYNC_ENTITY;
*nextPtr = end;
return XML_ERROR_NONE;
@@ -2334,7 +2732,7 @@ doContent(XML_Parser parser,
return XML_ERROR_NONE;
}
if (startTagLevel > 0) {
- if (tagLevel != startTagLevel)
+ if (parser->m_tagLevel != startTagLevel)
return XML_ERROR_ASYNC_ENTITY;
*nextPtr = s;
return XML_ERROR_NONE;
@@ -2363,9 +2761,9 @@ doContent(XML_Parser parser,
s + enc->minBytesPerChar,
next - enc->minBytesPerChar);
if (ch) {
- if (characterDataHandler)
- characterDataHandler(handlerArg, &ch, 1);
- else if (defaultHandler)
+ if (parser->m_characterDataHandler)
+ parser->m_characterDataHandler(parser->m_handlerArg, &ch, 1);
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
break;
}
@@ -2387,9 +2785,9 @@ doContent(XML_Parser parser,
return XML_ERROR_ENTITY_DECLARED_IN_PE;
}
else if (!entity) {
- if (skippedEntityHandler)
- skippedEntityHandler(handlerArg, name, 0);
- else if (defaultHandler)
+ if (parser->m_skippedEntityHandler)
+ parser->m_skippedEntityHandler(parser->m_handlerArg, name, 0);
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
break;
}
@@ -2399,10 +2797,10 @@ doContent(XML_Parser parser,
return XML_ERROR_BINARY_ENTITY_REF;
if (entity->textPtr) {
enum XML_Error result;
- if (!defaultExpandInternalEntities) {
- if (skippedEntityHandler)
- skippedEntityHandler(handlerArg, entity->name, 0);
- else if (defaultHandler)
+ if (!parser->m_defaultExpandInternalEntities) {
+ if (parser->m_skippedEntityHandler)
+ parser->m_skippedEntityHandler(parser->m_handlerArg, entity->name, 0);
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
break;
}
@@ -2410,22 +2808,22 @@ doContent(XML_Parser parser,
if (result != XML_ERROR_NONE)
return result;
}
- else if (externalEntityRefHandler) {
+ else if (parser->m_externalEntityRefHandler) {
const XML_Char *context;
entity->open = XML_TRUE;
context = getContext(parser);
entity->open = XML_FALSE;
if (!context)
return XML_ERROR_NO_MEMORY;
- if (!externalEntityRefHandler(externalEntityRefHandlerArg,
+ if (!parser->m_externalEntityRefHandler(parser->m_externalEntityRefHandlerArg,
context,
entity->base,
entity->systemId,
entity->publicId))
return XML_ERROR_EXTERNAL_ENTITY_HANDLING;
- poolDiscard(&tempPool);
+ poolDiscard(&parser->m_tempPool);
}
- else if (defaultHandler)
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
break;
}
@@ -2436,29 +2834,29 @@ doContent(XML_Parser parser,
TAG *tag;
enum XML_Error result;
XML_Char *toPtr;
- if (freeTagList) {
- tag = freeTagList;
- freeTagList = freeTagList->parent;
+ if (parser->m_freeTagList) {
+ tag = parser->m_freeTagList;
+ parser->m_freeTagList = parser->m_freeTagList->parent;
}
else {
- tag = (TAG *)MALLOC(sizeof(TAG));
+ tag = (TAG *)MALLOC(parser, sizeof(TAG));
if (!tag)
return XML_ERROR_NO_MEMORY;
- tag->buf = (char *)MALLOC(INIT_TAG_BUF_SIZE);
+ tag->buf = (char *)MALLOC(parser, INIT_TAG_BUF_SIZE);
if (!tag->buf) {
- FREE(tag);
+ FREE(parser, tag);
return XML_ERROR_NO_MEMORY;
}
tag->bufEnd = tag->buf + INIT_TAG_BUF_SIZE;
}
tag->bindings = NULL;
- tag->parent = tagStack;
- tagStack = tag;
+ tag->parent = parser->m_tagStack;
+ parser->m_tagStack = tag;
tag->name.localPart = NULL;
tag->name.prefix = NULL;
tag->rawName = s + enc->minBytesPerChar;
tag->rawNameLength = XmlNameLength(enc, tag->rawName);
- ++tagLevel;
+ ++parser->m_tagLevel;
{
const char *rawNameEnd = tag->rawName + tag->rawNameLength;
const char *fromPtr = tag->rawName;
@@ -2470,13 +2868,13 @@ doContent(XML_Parser parser,
&fromPtr, rawNameEnd,
(ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1);
convLen = (int)(toPtr - (XML_Char *)tag->buf);
- if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE)) {
+ if ((fromPtr >= rawNameEnd) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE)) {
tag->name.strLen = convLen;
break;
}
bufSize = (int)(tag->bufEnd - tag->buf) << 1;
{
- char *temp = (char *)REALLOC(tag->buf, bufSize);
+ char *temp = (char *)REALLOC(parser, tag->buf, bufSize);
if (temp == NULL)
return XML_ERROR_NO_MEMORY;
tag->buf = temp;
@@ -2490,12 +2888,12 @@ doContent(XML_Parser parser,
result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings));
if (result)
return result;
- if (startElementHandler)
- startElementHandler(handlerArg, tag->name.str,
- (const XML_Char **)atts);
- else if (defaultHandler)
+ if (parser->m_startElementHandler)
+ parser->m_startElementHandler(parser->m_handlerArg, tag->name.str,
+ (const XML_Char **)parser->m_atts);
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
- poolClear(&tempPool);
+ poolClear(&parser->m_tempPool);
break;
}
case XML_TOK_EMPTY_ELEMENT_NO_ATTS:
@@ -2507,51 +2905,49 @@ doContent(XML_Parser parser,
BINDING *bindings = NULL;
XML_Bool noElmHandlers = XML_TRUE;
TAG_NAME name;
- name.str = poolStoreString(&tempPool, enc, rawName,
+ name.str = poolStoreString(&parser->m_tempPool, enc, rawName,
rawName + XmlNameLength(enc, rawName));
if (!name.str)
return XML_ERROR_NO_MEMORY;
- poolFinish(&tempPool);
+ poolFinish(&parser->m_tempPool);
result = storeAtts(parser, enc, s, &name, &bindings);
- if (result)
+ if (result != XML_ERROR_NONE) {
+ freeBindings(parser, bindings);
return result;
- poolFinish(&tempPool);
- if (startElementHandler) {
- startElementHandler(handlerArg, name.str, (const XML_Char **)atts);
+ }
+ poolFinish(&parser->m_tempPool);
+ if (parser->m_startElementHandler) {
+ parser->m_startElementHandler(parser->m_handlerArg, name.str, (const XML_Char **)parser->m_atts);
noElmHandlers = XML_FALSE;
}
- if (endElementHandler) {
- if (startElementHandler)
+ if (parser->m_endElementHandler) {
+ if (parser->m_startElementHandler)
*eventPP = *eventEndPP;
- endElementHandler(handlerArg, name.str);
+ parser->m_endElementHandler(parser->m_handlerArg, name.str);
noElmHandlers = XML_FALSE;
}
- if (noElmHandlers && defaultHandler)
+ if (noElmHandlers && parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
- poolClear(&tempPool);
- while (bindings) {
- BINDING *b = bindings;
- if (endNamespaceDeclHandler)
- endNamespaceDeclHandler(handlerArg, b->prefix->name);
- bindings = bindings->nextTagBinding;
- b->nextTagBinding = freeBindingList;
- freeBindingList = b;
- b->prefix->binding = b->prevPrefixBinding;
- }
+ poolClear(&parser->m_tempPool);
+ freeBindings(parser, bindings);
+ }
+ if ((parser->m_tagLevel == 0) && (parser->m_parsingStatus.parsing != XML_FINISHED)) {
+ if (parser->m_parsingStatus.parsing == XML_SUSPENDED)
+ parser->m_processor = epilogProcessor;
+ else
+ return epilogProcessor(parser, next, end, nextPtr);
}
- if (tagLevel == 0)
- return epilogProcessor(parser, next, end, nextPtr);
break;
case XML_TOK_END_TAG:
- if (tagLevel == startTagLevel)
+ if (parser->m_tagLevel == startTagLevel)
return XML_ERROR_ASYNC_ENTITY;
else {
int len;
const char *rawName;
- TAG *tag = tagStack;
- tagStack = tag->parent;
- tag->parent = freeTagList;
- freeTagList = tag;
+ TAG *tag = parser->m_tagStack;
+ parser->m_tagStack = tag->parent;
+ tag->parent = parser->m_freeTagList;
+ parser->m_freeTagList = tag;
rawName = s + enc->minBytesPerChar*2;
len = XmlNameLength(enc, rawName);
if (len != tag->rawNameLength
@@ -2559,13 +2955,13 @@ doContent(XML_Parser parser,
*eventPP = rawName;
return XML_ERROR_TAG_MISMATCH;
}
- --tagLevel;
- if (endElementHandler) {
+ --parser->m_tagLevel;
+ if (parser->m_endElementHandler) {
const XML_Char *localPart;
const XML_Char *prefix;
XML_Char *uri;
localPart = tag->name.localPart;
- if (ns && localPart) {
+ if (parser->m_ns && localPart) {
/* localPart and prefix may have been overwritten in
tag->name.str, since this points to the binding->uri
buffer which gets re-used; so we have to add them again
@@ -2574,26 +2970,26 @@ doContent(XML_Parser parser,
/* don't need to check for space - already done in storeAtts() */
while (*localPart) *uri++ = *localPart++;
prefix = (XML_Char *)tag->name.prefix;
- if (ns_triplets && prefix) {
- *uri++ = namespaceSeparator;
+ if (parser->m_ns_triplets && prefix) {
+ *uri++ = parser->m_namespaceSeparator;
while (*prefix) *uri++ = *prefix++;
}
*uri = XML_T('\0');
}
- endElementHandler(handlerArg, tag->name.str);
+ parser->m_endElementHandler(parser->m_handlerArg, tag->name.str);
}
- else if (defaultHandler)
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
while (tag->bindings) {
BINDING *b = tag->bindings;
- if (endNamespaceDeclHandler)
- endNamespaceDeclHandler(handlerArg, b->prefix->name);
+ if (parser->m_endNamespaceDeclHandler)
+ parser->m_endNamespaceDeclHandler(parser->m_handlerArg, b->prefix->name);
tag->bindings = tag->bindings->nextTagBinding;
- b->nextTagBinding = freeBindingList;
- freeBindingList = b;
+ b->nextTagBinding = parser->m_freeBindingList;
+ parser->m_freeBindingList = b;
b->prefix->binding = b->prevPrefixBinding;
}
- if (tagLevel == 0)
+ if (parser->m_tagLevel == 0)
return epilogProcessor(parser, next, end, nextPtr);
}
break;
@@ -2602,29 +2998,29 @@ doContent(XML_Parser parser,
int n = XmlCharRefNumber(enc, s);
if (n < 0)
return XML_ERROR_BAD_CHAR_REF;
- if (characterDataHandler) {
+ if (parser->m_characterDataHandler) {
XML_Char buf[XML_ENCODE_MAX];
- characterDataHandler(handlerArg, buf, XmlEncode(n, (ICHAR *)buf));
+ parser->m_characterDataHandler(parser->m_handlerArg, buf, XmlEncode(n, (ICHAR *)buf));
}
- else if (defaultHandler)
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
}
break;
case XML_TOK_XML_DECL:
return XML_ERROR_MISPLACED_XML_PI;
case XML_TOK_DATA_NEWLINE:
- if (characterDataHandler) {
+ if (parser->m_characterDataHandler) {
XML_Char c = 0xA;
- characterDataHandler(handlerArg, &c, 1);
+ parser->m_characterDataHandler(parser->m_handlerArg, &c, 1);
}
- else if (defaultHandler)
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
break;
case XML_TOK_CDATA_SECT_OPEN:
{
enum XML_Error result;
- if (startCdataSectionHandler)
- startCdataSectionHandler(handlerArg);
+ if (parser->m_startCdataSectionHandler)
+ parser->m_startCdataSectionHandler(parser->m_handlerArg);
#if 0
/* Suppose you doing a transformation on a document that involves
changing only the character data. You set up a defaultHandler
@@ -2638,16 +3034,16 @@ doContent(XML_Parser parser,
However, now we have a start/endCdataSectionHandler, so it seems
easier to let the user deal with this.
*/
- else if (characterDataHandler)
- characterDataHandler(handlerArg, dataBuf, 0);
+ else if (parser->m_characterDataHandler)
+ parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf, 0);
#endif
- else if (defaultHandler)
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
result = doCdataSection(parser, enc, &next, end, nextPtr, haveMore);
if (result != XML_ERROR_NONE)
return result;
else if (!next) {
- processor = cdataSectionProcessor;
+ parser->m_processor = cdataSectionProcessor;
return result;
}
}
@@ -2657,19 +3053,19 @@ doContent(XML_Parser parser,
*nextPtr = s;
return XML_ERROR_NONE;
}
- if (characterDataHandler) {
+ if (parser->m_characterDataHandler) {
if (MUST_CONVERT(enc, s)) {
- ICHAR *dataPtr = (ICHAR *)dataBuf;
- XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd);
- characterDataHandler(handlerArg, dataBuf,
- (int)(dataPtr - (ICHAR *)dataBuf));
+ ICHAR *dataPtr = (ICHAR *)parser->m_dataBuf;
+ XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)parser->m_dataBufEnd);
+ parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf,
+ (int)(dataPtr - (ICHAR *)parser->m_dataBuf));
}
else
- characterDataHandler(handlerArg,
+ parser->m_characterDataHandler(parser->m_handlerArg,
(XML_Char *)s,
(int)((XML_Char *)end - (XML_Char *)s));
}
- else if (defaultHandler)
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, end);
/* We are at the end of the final buffer, should we check for
XML_SUSPENDED, XML_FINISHED?
@@ -2678,7 +3074,7 @@ doContent(XML_Parser parser,
*eventPP = end;
return XML_ERROR_NO_ELEMENTS;
}
- if (tagLevel != startTagLevel) {
+ if (parser->m_tagLevel != startTagLevel) {
*eventPP = end;
return XML_ERROR_ASYNC_ENTITY;
}
@@ -2686,26 +3082,26 @@ doContent(XML_Parser parser,
return XML_ERROR_NONE;
case XML_TOK_DATA_CHARS:
{
- XML_CharacterDataHandler charDataHandler = characterDataHandler;
+ XML_CharacterDataHandler charDataHandler = parser->m_characterDataHandler;
if (charDataHandler) {
if (MUST_CONVERT(enc, s)) {
for (;;) {
- ICHAR *dataPtr = (ICHAR *)dataBuf;
- const enum XML_Convert_Result convert_res = XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
+ ICHAR *dataPtr = (ICHAR *)parser->m_dataBuf;
+ const enum XML_Convert_Result convert_res = XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)parser->m_dataBufEnd);
*eventEndPP = s;
- charDataHandler(handlerArg, dataBuf,
- (int)(dataPtr - (ICHAR *)dataBuf));
+ charDataHandler(parser->m_handlerArg, parser->m_dataBuf,
+ (int)(dataPtr - (ICHAR *)parser->m_dataBuf));
if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE))
break;
*eventPP = s;
}
}
else
- charDataHandler(handlerArg,
+ charDataHandler(parser->m_handlerArg,
(XML_Char *)s,
(int)((XML_Char *)next - (XML_Char *)s));
}
- else if (defaultHandler)
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
}
break;
@@ -2718,12 +3114,20 @@ doContent(XML_Parser parser,
return XML_ERROR_NO_MEMORY;
break;
default:
- if (defaultHandler)
+ /* All of the tokens produced by XmlContentTok() have their own
+ * explicit cases, so this default is not strictly necessary.
+ * However it is a useful safety net, so we retain the code and
+ * simply exclude it from the coverage tests.
+ *
+ * LCOV_EXCL_START
+ */
+ if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
break;
+ /* LCOV_EXCL_STOP */
}
*eventPP = s = next;
- switch (ps_parsing) {
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
*nextPtr = next;
return XML_ERROR_NONE;
@@ -2735,6 +3139,29 @@ doContent(XML_Parser parser,
/* not reached */
}
+/* This function does not call free() on the allocated memory, merely
+ * moving it to the parser's m_freeBindingList where it can be freed or
+ * reused as appropriate.
+ */
+static void
+freeBindings(XML_Parser parser, BINDING *bindings)
+{
+ while (bindings) {
+ BINDING *b = bindings;
+
+ /* m_startNamespaceDeclHandler will have been called for this
+ * binding in addBindings(), so call the end handler now.
+ */
+ if (parser->m_endNamespaceDeclHandler)
+ parser->m_endNamespaceDeclHandler(parser->m_handlerArg, b->prefix->name);
+
+ bindings = bindings->nextTagBinding;
+ b->nextTagBinding = parser->m_freeBindingList;
+ parser->m_freeBindingList = b;
+ b->prefix->binding = b->prevPrefixBinding;
+ }
+}
+
/* Precondition: all arguments must be non-NULL;
Purpose:
- normalize attributes
@@ -2750,7 +3177,7 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
const char *attStr, TAG_NAME *tagNamePtr,
BINDING **bindingsPtr)
{
- DTD * const dtd = _dtd; /* save one level of indirection */
+ DTD * const dtd = parser->m_dtd; /* save one level of indirection */
ELEMENT_TYPE *elementType;
int nDefaultAtts;
const XML_Char **appAtts; /* the attribute list for the application */
@@ -2773,39 +3200,43 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
sizeof(ELEMENT_TYPE));
if (!elementType)
return XML_ERROR_NO_MEMORY;
- if (ns && !setElementTypePrefix(parser, elementType))
+ if (parser->m_ns && !setElementTypePrefix(parser, elementType))
return XML_ERROR_NO_MEMORY;
}
nDefaultAtts = elementType->nDefaultAtts;
/* get the attributes from the tokenizer */
- n = XmlGetAttributes(enc, attStr, attsSize, atts);
- if (n + nDefaultAtts > attsSize) {
- int oldAttsSize = attsSize;
+ n = XmlGetAttributes(enc, attStr, parser->m_attsSize, parser->m_atts);
+ if (n + nDefaultAtts > parser->m_attsSize) {
+ int oldAttsSize = parser->m_attsSize;
ATTRIBUTE *temp;
#ifdef XML_ATTR_INFO
XML_AttrInfo *temp2;
#endif
- attsSize = n + nDefaultAtts + INIT_ATTS_SIZE;
- temp = (ATTRIBUTE *)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE));
- if (temp == NULL)
+ parser->m_attsSize = n + nDefaultAtts + INIT_ATTS_SIZE;
+ temp = (ATTRIBUTE *)REALLOC(parser, (void *)parser->m_atts, parser->m_attsSize * sizeof(ATTRIBUTE));
+ if (temp == NULL) {
+ parser->m_attsSize = oldAttsSize;
return XML_ERROR_NO_MEMORY;
- atts = temp;
+ }
+ parser->m_atts = temp;
#ifdef XML_ATTR_INFO
- temp2 = (XML_AttrInfo *)REALLOC((void *)attInfo, attsSize * sizeof(XML_AttrInfo));
- if (temp2 == NULL)
+ temp2 = (XML_AttrInfo *)REALLOC(parser, (void *)parser->m_attInfo, parser->m_attsSize * sizeof(XML_AttrInfo));
+ if (temp2 == NULL) {
+ parser->m_attsSize = oldAttsSize;
return XML_ERROR_NO_MEMORY;
- attInfo = temp2;
+ }
+ parser->m_attInfo = temp2;
#endif
if (n > oldAttsSize)
- XmlGetAttributes(enc, attStr, n, atts);
+ XmlGetAttributes(enc, attStr, n, parser->m_atts);
}
- appAtts = (const XML_Char **)atts;
+ appAtts = (const XML_Char **)parser->m_atts;
for (i = 0; i < n; i++) {
- ATTRIBUTE *currAtt = &atts[i];
+ ATTRIBUTE *currAtt = &parser->m_atts[i];
#ifdef XML_ATTR_INFO
- XML_AttrInfo *currAttInfo = &attInfo[i];
+ XML_AttrInfo *currAttInfo = &parser->m_attInfo[i];
#endif
/* add the name and value to the attribute list */
ATTRIBUTE_ID *attId = getAttributeId(parser, enc, currAtt->name,
@@ -2814,25 +3245,25 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
if (!attId)
return XML_ERROR_NO_MEMORY;
#ifdef XML_ATTR_INFO
- currAttInfo->nameStart = parseEndByteIndex - (parseEndPtr - currAtt->name);
+ currAttInfo->nameStart = parser->m_parseEndByteIndex - (parser->m_parseEndPtr - currAtt->name);
currAttInfo->nameEnd = currAttInfo->nameStart +
XmlNameLength(enc, currAtt->name);
- currAttInfo->valueStart = parseEndByteIndex -
- (parseEndPtr - currAtt->valuePtr);
- currAttInfo->valueEnd = parseEndByteIndex - (parseEndPtr - currAtt->valueEnd);
+ currAttInfo->valueStart = parser->m_parseEndByteIndex -
+ (parser->m_parseEndPtr - currAtt->valuePtr);
+ currAttInfo->valueEnd = parser->m_parseEndByteIndex - (parser->m_parseEndPtr - currAtt->valueEnd);
#endif
/* Detect duplicate attributes by their QNames. This does not work when
namespace processing is turned on and different prefixes for the same
namespace are used. For this case we have a check further down.
*/
if ((attId->name)[-1]) {
- if (enc == encoding)
- eventPtr = atts[i].name;
+ if (enc == parser->m_encoding)
+ parser->m_eventPtr = parser->m_atts[i].name;
return XML_ERROR_DUPLICATE_ATTRIBUTE;
}
(attId->name)[-1] = 1;
appAtts[attIndex++] = attId->name;
- if (!atts[i].normalized) {
+ if (!parser->m_atts[i].normalized) {
enum XML_Error result;
XML_Bool isCdata = XML_TRUE;
@@ -2849,20 +3280,20 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
/* normalize the attribute value */
result = storeAttributeValue(parser, enc, isCdata,
- atts[i].valuePtr, atts[i].valueEnd,
- &tempPool);
+ parser->m_atts[i].valuePtr, parser->m_atts[i].valueEnd,
+ &parser->m_tempPool);
if (result)
return result;
- appAtts[attIndex] = poolStart(&tempPool);
- poolFinish(&tempPool);
+ appAtts[attIndex] = poolStart(&parser->m_tempPool);
+ poolFinish(&parser->m_tempPool);
}
else {
/* the value did not need normalizing */
- appAtts[attIndex] = poolStoreString(&tempPool, enc, atts[i].valuePtr,
- atts[i].valueEnd);
+ appAtts[attIndex] = poolStoreString(&parser->m_tempPool, enc, parser->m_atts[i].valuePtr,
+ parser->m_atts[i].valueEnd);
if (appAtts[attIndex] == 0)
return XML_ERROR_NO_MEMORY;
- poolFinish(&tempPool);
+ poolFinish(&parser->m_tempPool);
}
/* handle prefixed attribute names */
if (attId->prefix) {
@@ -2886,16 +3317,16 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
}
/* set-up for XML_GetSpecifiedAttributeCount and XML_GetIdAttributeIndex */
- nSpecifiedAtts = attIndex;
+ parser->m_nSpecifiedAtts = attIndex;
if (elementType->idAtt && (elementType->idAtt->name)[-1]) {
for (i = 0; i < attIndex; i += 2)
if (appAtts[i] == elementType->idAtt->name) {
- idAttIndex = i;
+ parser->m_idAttIndex = i;
break;
}
}
else
- idAttIndex = -1;
+ parser->m_idAttIndex = -1;
/* do attribute defaulting */
for (i = 0; i < nDefaultAtts; i++) {
@@ -2929,29 +3360,33 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
i = 0;
if (nPrefixes) {
int j; /* hash table index */
- unsigned long version = nsAttsVersion;
- int nsAttsSize = (int)1 << nsAttsPower;
+ unsigned long version = parser->m_nsAttsVersion;
+ int nsAttsSize = (int)1 << parser->m_nsAttsPower;
+ unsigned char oldNsAttsPower = parser->m_nsAttsPower;
/* size of hash table must be at least 2 * (# of prefixed attributes) */
- if ((nPrefixes << 1) >> nsAttsPower) { /* true for nsAttsPower = 0 */
+ if ((nPrefixes << 1) >> parser->m_nsAttsPower) { /* true for m_nsAttsPower = 0 */
NS_ATT *temp;
/* hash table size must also be a power of 2 and >= 8 */
- while (nPrefixes >> nsAttsPower++);
- if (nsAttsPower < 3)
- nsAttsPower = 3;
- nsAttsSize = (int)1 << nsAttsPower;
- temp = (NS_ATT *)REALLOC(nsAtts, nsAttsSize * sizeof(NS_ATT));
- if (!temp)
+ while (nPrefixes >> parser->m_nsAttsPower++);
+ if (parser->m_nsAttsPower < 3)
+ parser->m_nsAttsPower = 3;
+ nsAttsSize = (int)1 << parser->m_nsAttsPower;
+ temp = (NS_ATT *)REALLOC(parser, parser->m_nsAtts, nsAttsSize * sizeof(NS_ATT));
+ if (!temp) {
+ /* Restore actual size of memory in m_nsAtts */
+ parser->m_nsAttsPower = oldNsAttsPower;
return XML_ERROR_NO_MEMORY;
- nsAtts = temp;
- version = 0; /* force re-initialization of nsAtts hash table */
+ }
+ parser->m_nsAtts = temp;
+ version = 0; /* force re-initialization of m_nsAtts hash table */
}
- /* using a version flag saves us from initializing nsAtts every time */
+ /* using a version flag saves us from initializing m_nsAtts every time */
if (!version) { /* initialize version flags when version wraps around */
version = INIT_ATTS_VERSION;
for (j = nsAttsSize; j != 0; )
- nsAtts[--j].version = version;
+ parser->m_nsAtts[--j].version = version;
}
- nsAttsVersion = --version;
+ parser->m_nsAttsVersion = --version;
/* expand prefixed names and check for duplicates */
for (; i < attIndex; i += 2) {
@@ -2959,71 +3394,96 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
if (s[-1] == 2) { /* prefixed */
ATTRIBUTE_ID *id;
const BINDING *b;
- unsigned long uriHash = hash_secret_salt;
+ unsigned long uriHash;
+ struct siphash sip_state;
+ struct sipkey sip_key;
+
+ copy_salt_to_sipkey(parser, &sip_key);
+ sip24_init(&sip_state, &sip_key);
+
((XML_Char *)s)[-1] = 0; /* clear flag */
id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, s, 0);
- if (!id || !id->prefix)
- return XML_ERROR_NO_MEMORY;
+ if (!id || !id->prefix) {
+ /* This code is walking through the appAtts array, dealing
+ * with (in this case) a prefixed attribute name. To be in
+ * the array, the attribute must have already been bound, so
+ * has to have passed through the hash table lookup once
+ * already. That implies that an entry for it already
+ * exists, so the lookup above will return a pointer to
+ * already allocated memory. There is no opportunaity for
+ * the allocator to fail, so the condition above cannot be
+ * fulfilled.
+ *
+ * Since it is difficult to be certain that the above
+ * analysis is complete, we retain the test and merely
+ * remove the code from coverage tests.
+ */
+ return XML_ERROR_NO_MEMORY; /* LCOV_EXCL_LINE */
+ }
b = id->prefix->binding;
if (!b)
return XML_ERROR_UNBOUND_PREFIX;
- /* as we expand the name we also calculate its hash value */
for (j = 0; j < b->uriLen; j++) {
const XML_Char c = b->uri[j];
- if (!poolAppendChar(&tempPool, c))
+ if (!poolAppendChar(&parser->m_tempPool, c))
return XML_ERROR_NO_MEMORY;
- uriHash = CHAR_HASH(uriHash, c);
}
+
+ sip24_update(&sip_state, b->uri, b->uriLen * sizeof(XML_Char));
+
while (*s++ != XML_T(ASCII_COLON))
;
+
+ sip24_update(&sip_state, s, keylen(s) * sizeof(XML_Char));
+
do { /* copies null terminator */
- const XML_Char c = *s;
- if (!poolAppendChar(&tempPool, *s))
+ if (!poolAppendChar(&parser->m_tempPool, *s))
return XML_ERROR_NO_MEMORY;
- uriHash = CHAR_HASH(uriHash, c);
} while (*s++);
+ uriHash = (unsigned long)sip24_final(&sip_state);
+
{ /* Check hash table for duplicate of expanded name (uriName).
Derived from code in lookup(parser, HASH_TABLE *table, ...).
*/
unsigned char step = 0;
unsigned long mask = nsAttsSize - 1;
j = uriHash & mask; /* index into hash table */
- while (nsAtts[j].version == version) {
+ while (parser->m_nsAtts[j].version == version) {
/* for speed we compare stored hash values first */
- if (uriHash == nsAtts[j].hash) {
- const XML_Char *s1 = poolStart(&tempPool);
- const XML_Char *s2 = nsAtts[j].uriName;
+ if (uriHash == parser->m_nsAtts[j].hash) {
+ const XML_Char *s1 = poolStart(&parser->m_tempPool);
+ const XML_Char *s2 = parser->m_nsAtts[j].uriName;
/* s1 is null terminated, but not s2 */
for (; *s1 == *s2 && *s1 != 0; s1++, s2++);
if (*s1 == 0)
return XML_ERROR_DUPLICATE_ATTRIBUTE;
}
if (!step)
- step = PROBE_STEP(uriHash, mask, nsAttsPower);
+ step = PROBE_STEP(uriHash, mask, parser->m_nsAttsPower);
j < step ? (j += nsAttsSize - step) : (j -= step);
}
}
- if (ns_triplets) { /* append namespace separator and prefix */
- tempPool.ptr[-1] = namespaceSeparator;
+ if (parser->m_ns_triplets) { /* append namespace separator and prefix */
+ parser->m_tempPool.ptr[-1] = parser->m_namespaceSeparator;
s = b->prefix->name;
do {
- if (!poolAppendChar(&tempPool, *s))
+ if (!poolAppendChar(&parser->m_tempPool, *s))
return XML_ERROR_NO_MEMORY;
} while (*s++);
}
/* store expanded name in attribute list */
- s = poolStart(&tempPool);
- poolFinish(&tempPool);
+ s = poolStart(&parser->m_tempPool);
+ poolFinish(&parser->m_tempPool);
appAtts[i] = s;
/* fill empty slot with new version, uriName and hash value */
- nsAtts[j].version = version;
- nsAtts[j].hash = uriHash;
- nsAtts[j].uriName = s;
+ parser->m_nsAtts[j].version = version;
+ parser->m_nsAtts[j].hash = uriHash;
+ parser->m_nsAtts[j].uriName = s;
if (!--nPrefixes) {
i += 2;
@@ -3040,7 +3500,7 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
for (binding = *bindingsPtr; binding; binding = binding->nextTagBinding)
binding->attId->name[-1] = 0;
- if (!ns)
+ if (!parser->m_ns)
return XML_ERROR_NONE;
/* expand the element type name */
@@ -3059,7 +3519,7 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
else
return XML_ERROR_NONE;
prefixLen = 0;
- if (ns_triplets && binding->prefix->name) {
+ if (parser->m_ns_triplets && binding->prefix->name) {
for (; binding->prefix->name[prefixLen++];)
; /* prefixLen includes null terminator */
}
@@ -3072,24 +3532,24 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
n = i + binding->uriLen + prefixLen;
if (n > binding->uriAlloc) {
TAG *p;
- uri = (XML_Char *)MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char));
+ uri = (XML_Char *)MALLOC(parser, (n + EXPAND_SPARE) * sizeof(XML_Char));
if (!uri)
return XML_ERROR_NO_MEMORY;
binding->uriAlloc = n + EXPAND_SPARE;
memcpy(uri, binding->uri, binding->uriLen * sizeof(XML_Char));
- for (p = tagStack; p; p = p->parent)
+ for (p = parser->m_tagStack; p; p = p->parent)
if (p->name.str == binding->uri)
p->name.str = uri;
- FREE(binding->uri);
+ FREE(parser, binding->uri);
binding->uri = uri;
}
- /* if namespaceSeparator != '\0' then uri includes it already */
+ /* if m_namespaceSeparator != '\0' then uri includes it already */
uri = binding->uri + binding->uriLen;
memcpy(uri, localPart, i * sizeof(XML_Char));
/* we always have a namespace separator between localPart and prefix */
if (prefixLen) {
uri += i - 1;
- *uri = namespaceSeparator; /* replace null terminator */
+ *uri = parser->m_namespaceSeparator; /* replace null terminator */
memcpy(uri + 1, binding->prefix->name, prefixLen * sizeof(XML_Char));
}
tagNamePtr->str = binding->uri;
@@ -3167,48 +3627,48 @@ addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
if (isXMLNS)
return XML_ERROR_RESERVED_NAMESPACE_URI;
- if (namespaceSeparator)
+ if (parser->m_namespaceSeparator)
len++;
- if (freeBindingList) {
- b = freeBindingList;
+ if (parser->m_freeBindingList) {
+ b = parser->m_freeBindingList;
if (len > b->uriAlloc) {
- XML_Char *temp = (XML_Char *)REALLOC(b->uri,
+ XML_Char *temp = (XML_Char *)REALLOC(parser, b->uri,
sizeof(XML_Char) * (len + EXPAND_SPARE));
if (temp == NULL)
return XML_ERROR_NO_MEMORY;
b->uri = temp;
b->uriAlloc = len + EXPAND_SPARE;
}
- freeBindingList = b->nextTagBinding;
+ parser->m_freeBindingList = b->nextTagBinding;
}
else {
- b = (BINDING *)MALLOC(sizeof(BINDING));
+ b = (BINDING *)MALLOC(parser, sizeof(BINDING));
if (!b)
return XML_ERROR_NO_MEMORY;
- b->uri = (XML_Char *)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));
+ b->uri = (XML_Char *)MALLOC(parser, sizeof(XML_Char) * (len + EXPAND_SPARE));
if (!b->uri) {
- FREE(b);
+ FREE(parser, b);
return XML_ERROR_NO_MEMORY;
}
b->uriAlloc = len + EXPAND_SPARE;
}
b->uriLen = len;
memcpy(b->uri, uri, len * sizeof(XML_Char));
- if (namespaceSeparator)
- b->uri[len - 1] = namespaceSeparator;
+ if (parser->m_namespaceSeparator)
+ b->uri[len - 1] = parser->m_namespaceSeparator;
b->prefix = prefix;
b->attId = attId;
b->prevPrefixBinding = prefix->binding;
/* NULL binding when default namespace undeclared */
- if (*uri == XML_T('\0') && prefix == &_dtd->defaultPrefix)
+ if (*uri == XML_T('\0') && prefix == &parser->m_dtd->defaultPrefix)
prefix->binding = NULL;
else
prefix->binding = b;
b->nextTagBinding = *bindingsPtr;
*bindingsPtr = b;
/* if attId == NULL then we are not starting a namespace scope */
- if (attId && startNamespaceDeclHandler)
- startNamespaceDeclHandler(handlerArg, prefix->name,
+ if (attId && parser->m_startNamespaceDeclHandler)
+ parser->m_startNamespaceDeclHandler(parser->m_handlerArg, prefix->name,
prefix->binding ? uri : 0);
return XML_ERROR_NONE;
}
@@ -3222,17 +3682,17 @@ cdataSectionProcessor(XML_Parser parser,
const char *end,
const char **endPtr)
{
- enum XML_Error result = doCdataSection(parser, encoding, &start, end,
- endPtr, (XML_Bool)!ps_finalBuffer);
+ enum XML_Error result = doCdataSection(parser, parser->m_encoding, &start, end,
+ endPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer);
if (result != XML_ERROR_NONE)
return result;
if (start) {
- if (parentParser) { /* we are parsing an external entity */
- processor = externalEntityContentProcessor;
+ if (parser->m_parentParser) { /* we are parsing an external entity */
+ parser->m_processor = externalEntityContentProcessor;
return externalEntityContentProcessor(parser, start, end, endPtr);
}
else {
- processor = contentProcessor;
+ parser->m_processor = contentProcessor;
return contentProcessor(parser, start, end, endPtr);
}
}
@@ -3253,14 +3713,14 @@ doCdataSection(XML_Parser parser,
const char *s = *startPtr;
const char **eventPP;
const char **eventEndPP;
- if (enc == encoding) {
- eventPP = &eventPtr;
+ if (enc == parser->m_encoding) {
+ eventPP = &parser->m_eventPtr;
*eventPP = s;
- eventEndPP = &eventEndPtr;
+ eventEndPP = &parser->m_eventEndPtr;
}
else {
- eventPP = &(openInternalEntities->internalEventPtr);
- eventEndPP = &(openInternalEntities->internalEventEndPtr);
+ eventPP = &(parser->m_openInternalEntities->internalEventPtr);
+ eventEndPP = &(parser->m_openInternalEntities->internalEventEndPtr);
}
*eventPP = s;
*startPtr = NULL;
@@ -3271,51 +3731,51 @@ doCdataSection(XML_Parser parser,
*eventEndPP = next;
switch (tok) {
case XML_TOK_CDATA_SECT_CLOSE:
- if (endCdataSectionHandler)
- endCdataSectionHandler(handlerArg);
+ if (parser->m_endCdataSectionHandler)
+ parser->m_endCdataSectionHandler(parser->m_handlerArg);
#if 0
/* see comment under XML_TOK_CDATA_SECT_OPEN */
- else if (characterDataHandler)
- characterDataHandler(handlerArg, dataBuf, 0);
+ else if (parser->m_characterDataHandler)
+ parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf, 0);
#endif
- else if (defaultHandler)
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
*startPtr = next;
*nextPtr = next;
- if (ps_parsing == XML_FINISHED)
+ if (parser->m_parsingStatus.parsing == XML_FINISHED)
return XML_ERROR_ABORTED;
else
return XML_ERROR_NONE;
case XML_TOK_DATA_NEWLINE:
- if (characterDataHandler) {
+ if (parser->m_characterDataHandler) {
XML_Char c = 0xA;
- characterDataHandler(handlerArg, &c, 1);
+ parser->m_characterDataHandler(parser->m_handlerArg, &c, 1);
}
- else if (defaultHandler)
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
break;
case XML_TOK_DATA_CHARS:
{
- XML_CharacterDataHandler charDataHandler = characterDataHandler;
+ XML_CharacterDataHandler charDataHandler = parser->m_characterDataHandler;
if (charDataHandler) {
if (MUST_CONVERT(enc, s)) {
for (;;) {
- ICHAR *dataPtr = (ICHAR *)dataBuf;
- const enum XML_Convert_Result convert_res = XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd);
+ ICHAR *dataPtr = (ICHAR *)parser->m_dataBuf;
+ const enum XML_Convert_Result convert_res = XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)parser->m_dataBufEnd);
*eventEndPP = next;
- charDataHandler(handlerArg, dataBuf,
- (int)(dataPtr - (ICHAR *)dataBuf));
+ charDataHandler(parser->m_handlerArg, parser->m_dataBuf,
+ (int)(dataPtr - (ICHAR *)parser->m_dataBuf));
if ((convert_res == XML_CONVERT_COMPLETED) || (convert_res == XML_CONVERT_INPUT_INCOMPLETE))
break;
*eventPP = s;
}
}
else
- charDataHandler(handlerArg,
+ charDataHandler(parser->m_handlerArg,
(XML_Char *)s,
(int)((XML_Char *)next - (XML_Char *)s));
}
- else if (defaultHandler)
+ else if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
}
break;
@@ -3336,12 +3796,20 @@ doCdataSection(XML_Parser parser,
}
return XML_ERROR_UNCLOSED_CDATA_SECTION;
default:
+ /* Every token returned by XmlCdataSectionTok() has its own
+ * explicit case, so this default case will never be executed.
+ * We retain it as a safety net and exclude it from the coverage
+ * statistics.
+ *
+ * LCOV_EXCL_START
+ */
*eventPP = next;
return XML_ERROR_UNEXPECTED_STATE;
+ /* LCOV_EXCL_STOP */
}
*eventPP = s = next;
- switch (ps_parsing) {
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
*nextPtr = next;
return XML_ERROR_NONE;
@@ -3364,12 +3832,12 @@ ignoreSectionProcessor(XML_Parser parser,
const char *end,
const char **endPtr)
{
- enum XML_Error result = doIgnoreSection(parser, encoding, &start, end,
- endPtr, (XML_Bool)!ps_finalBuffer);
+ enum XML_Error result = doIgnoreSection(parser, parser->m_encoding, &start, end,
+ endPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer);
if (result != XML_ERROR_NONE)
return result;
if (start) {
- processor = prologProcessor;
+ parser->m_processor = prologProcessor;
return prologProcessor(parser, start, end, endPtr);
}
return result;
@@ -3391,14 +3859,26 @@ doIgnoreSection(XML_Parser parser,
const char *s = *startPtr;
const char **eventPP;
const char **eventEndPP;
- if (enc == encoding) {
- eventPP = &eventPtr;
+ if (enc == parser->m_encoding) {
+ eventPP = &parser->m_eventPtr;
*eventPP = s;
- eventEndPP = &eventEndPtr;
+ eventEndPP = &parser->m_eventEndPtr;
}
else {
- eventPP = &(openInternalEntities->internalEventPtr);
- eventEndPP = &(openInternalEntities->internalEventEndPtr);
+ /* It's not entirely clear, but it seems the following two lines
+ * of code cannot be executed. The only occasions on which 'enc'
+ * is not 'encoding' are when this function is called
+ * from the internal entity processing, and IGNORE sections are an
+ * error in internal entities.
+ *
+ * Since it really isn't clear that this is true, we keep the code
+ * and just remove it from our coverage tests.
+ *
+ * LCOV_EXCL_START
+ */
+ eventPP = &(parser->m_openInternalEntities->internalEventPtr);
+ eventEndPP = &(parser->m_openInternalEntities->internalEventEndPtr);
+ /* LCOV_EXCL_STOP */
}
*eventPP = s;
*startPtr = NULL;
@@ -3406,11 +3886,11 @@ doIgnoreSection(XML_Parser parser,
*eventEndPP = next;
switch (tok) {
case XML_TOK_IGNORE_SECT:
- if (defaultHandler)
+ if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
*startPtr = next;
*nextPtr = next;
- if (ps_parsing == XML_FINISHED)
+ if (parser->m_parsingStatus.parsing == XML_FINISHED)
return XML_ERROR_ABORTED;
else
return XML_ERROR_NONE;
@@ -3431,8 +3911,16 @@ doIgnoreSection(XML_Parser parser,
}
return XML_ERROR_SYNTAX; /* XML_ERROR_UNCLOSED_IGNORE_SECTION */
default:
+ /* All of the tokens that XmlIgnoreSectionTok() returns have
+ * explicit cases to handle them, so this default case is never
+ * executed. We keep it as a safety net anyway, and remove it
+ * from our test coverage statistics.
+ *
+ * LCOV_EXCL_START
+ */
*eventPP = next;
return XML_ERROR_UNEXPECTED_STATE;
+ /* LCOV_EXCL_STOP */
}
/* not reached */
}
@@ -3445,27 +3933,28 @@ initializeEncoding(XML_Parser parser)
const char *s;
#ifdef XML_UNICODE
char encodingBuf[128];
- if (!protocolEncodingName)
+ /* See comments abount `protoclEncodingName` in parserInit() */
+ if (!parser->m_protocolEncodingName)
s = NULL;
else {
int i;
- for (i = 0; protocolEncodingName[i]; i++) {
+ for (i = 0; parser->m_protocolEncodingName[i]; i++) {
if (i == sizeof(encodingBuf) - 1
- || (protocolEncodingName[i] & ~0x7f) != 0) {
+ || (parser->m_protocolEncodingName[i] & ~0x7f) != 0) {
encodingBuf[0] = '\0';
break;
}
- encodingBuf[i] = (char)protocolEncodingName[i];
+ encodingBuf[i] = (char)parser->m_protocolEncodingName[i];
}
encodingBuf[i] = '\0';
s = encodingBuf;
}
#else
- s = protocolEncodingName;
+ s = parser->m_protocolEncodingName;
#endif
- if ((ns ? XmlInitEncodingNS : XmlInitEncoding)(&initEncoding, &encoding, s))
+ if ((parser->m_ns ? XmlInitEncodingNS : XmlInitEncoding)(&parser->m_initEncoding, &parser->m_encoding, s))
return XML_ERROR_NONE;
- return handleUnknownEncoding(parser, protocolEncodingName);
+ return handleUnknownEncoding(parser, parser->m_protocolEncodingName);
}
static enum XML_Error
@@ -3479,13 +3968,13 @@ processXmlDecl(XML_Parser parser, int isGeneralTextEntity,
const char *versionend;
const XML_Char *storedversion = NULL;
int standalone = -1;
- if (!(ns
+ if (!(parser->m_ns
? XmlParseXmlDeclNS
: XmlParseXmlDecl)(isGeneralTextEntity,
- encoding,
+ parser->m_encoding,
s,
next,
- &eventPtr,
+ &parser->m_eventPtr,
&version,
&versionend,
&encodingName,
@@ -3497,62 +3986,69 @@ processXmlDecl(XML_Parser parser, int isGeneralTextEntity,
return XML_ERROR_XML_DECL;
}
if (!isGeneralTextEntity && standalone == 1) {
- _dtd->standalone = XML_TRUE;
+ parser->m_dtd->standalone = XML_TRUE;
#ifdef XML_DTD
- if (paramEntityParsing == XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE)
- paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
+ if (parser->m_paramEntityParsing == XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE)
+ parser->m_paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER;
#endif /* XML_DTD */
}
- if (xmlDeclHandler) {
+ if (parser->m_xmlDeclHandler) {
if (encodingName != NULL) {
- storedEncName = poolStoreString(&temp2Pool,
- encoding,
+ storedEncName = poolStoreString(&parser->m_temp2Pool,
+ parser->m_encoding,
encodingName,
encodingName
- + XmlNameLength(encoding, encodingName));
+ + XmlNameLength(parser->m_encoding, encodingName));
if (!storedEncName)
return XML_ERROR_NO_MEMORY;
- poolFinish(&temp2Pool);
+ poolFinish(&parser->m_temp2Pool);
}
if (version) {
- storedversion = poolStoreString(&temp2Pool,
- encoding,
+ storedversion = poolStoreString(&parser->m_temp2Pool,
+ parser->m_encoding,
version,
- versionend - encoding->minBytesPerChar);
+ versionend - parser->m_encoding->minBytesPerChar);
if (!storedversion)
return XML_ERROR_NO_MEMORY;
}
- xmlDeclHandler(handlerArg, storedversion, storedEncName, standalone);
+ parser->m_xmlDeclHandler(parser->m_handlerArg, storedversion, storedEncName, standalone);
}
- else if (defaultHandler)
- reportDefault(parser, encoding, s, next);
- if (protocolEncodingName == NULL) {
+ else if (parser->m_defaultHandler)
+ reportDefault(parser, parser->m_encoding, s, next);
+ if (parser->m_protocolEncodingName == NULL) {
if (newEncoding) {
- if (newEncoding->minBytesPerChar != encoding->minBytesPerChar) {
- eventPtr = encodingName;
+ /* Check that the specified encoding does not conflict with what
+ * the parser has already deduced. Do we have the same number
+ * of bytes in the smallest representation of a character? If
+ * this is UTF-16, is it the same endianness?
+ */
+ if (newEncoding->minBytesPerChar != parser->m_encoding->minBytesPerChar
+ || (newEncoding->minBytesPerChar == 2 &&
+ newEncoding != parser->m_encoding)) {
+ parser->m_eventPtr = encodingName;
return XML_ERROR_INCORRECT_ENCODING;
}
- encoding = newEncoding;
+ parser->m_encoding = newEncoding;
}
else if (encodingName) {
enum XML_Error result;
if (!storedEncName) {
storedEncName = poolStoreString(
- &temp2Pool, encoding, encodingName,
- encodingName + XmlNameLength(encoding, encodingName));
+ &parser->m_temp2Pool, parser->m_encoding, encodingName,
+ encodingName + XmlNameLength(parser->m_encoding, encodingName));
if (!storedEncName)
return XML_ERROR_NO_MEMORY;
}
result = handleUnknownEncoding(parser, storedEncName);
- poolClear(&temp2Pool);
+ poolClear(&parser->m_temp2Pool);
if (result == XML_ERROR_UNKNOWN_ENCODING)
- eventPtr = encodingName;
+ parser->m_eventPtr = encodingName;
return result;
}
}
if (storedEncName || storedversion)
- poolClear(&temp2Pool);
+ poolClear(&parser->m_temp2Pool);
return XML_ERROR_NONE;
}
@@ -3560,7 +4056,7 @@ processXmlDecl(XML_Parser parser, int isGeneralTextEntity,
static enum XML_Error
handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName)
{
- if (unknownEncodingHandler) {
+ if (parser->m_unknownEncodingHandler) {
XML_Encoding info;
int i;
for (i = 0; i < 256; i++)
@@ -3568,25 +4064,25 @@ handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName)
info.convert = NULL;
info.data = NULL;
info.release = NULL;
- if (unknownEncodingHandler(unknownEncodingHandlerData, encodingName,
+ if (parser->m_unknownEncodingHandler(parser->m_unknownEncodingHandlerData, encodingName,
&info)) {
ENCODING *enc;
- unknownEncodingMem = MALLOC(XmlSizeOfUnknownEncoding());
- if (!unknownEncodingMem) {
+ parser->m_unknownEncodingMem = MALLOC(parser, XmlSizeOfUnknownEncoding());
+ if (!parser->m_unknownEncodingMem) {
if (info.release)
info.release(info.data);
return XML_ERROR_NO_MEMORY;
}
- enc = (ns
+ enc = (parser->m_ns
? XmlInitUnknownEncodingNS
- : XmlInitUnknownEncoding)(unknownEncodingMem,
+ : XmlInitUnknownEncoding)(parser->m_unknownEncodingMem,
info.map,
info.convert,
info.data);
if (enc) {
- unknownEncodingData = info.data;
- unknownEncodingRelease = info.release;
- encoding = enc;
+ parser->m_unknownEncodingData = info.data;
+ parser->m_unknownEncodingRelease = info.release;
+ parser->m_encoding = enc;
return XML_ERROR_NONE;
}
}
@@ -3605,7 +4101,7 @@ prologInitProcessor(XML_Parser parser,
enum XML_Error result = initializeEncoding(parser);
if (result != XML_ERROR_NONE)
return result;
- processor = prologProcessor;
+ parser->m_processor = prologProcessor;
return prologProcessor(parser, s, end, nextPtr);
}
@@ -3623,14 +4119,14 @@ externalParEntInitProcessor(XML_Parser parser,
/* we know now that XML_Parse(Buffer) has been called,
so we consider the external parameter entity read */
- _dtd->paramEntityRead = XML_TRUE;
+ parser->m_dtd->paramEntityRead = XML_TRUE;
- if (prologState.inEntityValue) {
- processor = entityValueInitProcessor;
+ if (parser->m_prologState.inEntityValue) {
+ parser->m_processor = entityValueInitProcessor;
return entityValueInitProcessor(parser, s, end, nextPtr);
}
else {
- processor = externalParEntProcessor;
+ parser->m_processor = externalParEntProcessor;
return externalParEntProcessor(parser, s, end, nextPtr);
}
}
@@ -3644,13 +4140,13 @@ entityValueInitProcessor(XML_Parser parser,
int tok;
const char *start = s;
const char *next = start;
- eventPtr = start;
+ parser->m_eventPtr = start;
for (;;) {
- tok = XmlPrologTok(encoding, start, end, &next);
- eventEndPtr = next;
+ tok = XmlPrologTok(parser->m_encoding, start, end, &next);
+ parser->m_eventEndPtr = next;
if (tok <= 0) {
- if (!ps_finalBuffer && tok != XML_TOK_INVALID) {
+ if (!parser->m_parsingStatus.finalBuffer && tok != XML_TOK_INVALID) {
*nextPtr = s;
return XML_ERROR_NONE;
}
@@ -3666,24 +4162,23 @@ entityValueInitProcessor(XML_Parser parser,
break;
}
/* found end of entity value - can store it now */
- return storeEntityValue(parser, encoding, s, end);
+ return storeEntityValue(parser, parser->m_encoding, s, end);
}
else if (tok == XML_TOK_XML_DECL) {
enum XML_Error result;
result = processXmlDecl(parser, 0, start, next);
if (result != XML_ERROR_NONE)
return result;
- switch (ps_parsing) {
- case XML_SUSPENDED:
- *nextPtr = next;
- return XML_ERROR_NONE;
- case XML_FINISHED:
+ /* At this point, m_parsingStatus.parsing cannot be XML_SUSPENDED. For that
+ * to happen, a parameter entity parsing handler must have
+ * attempted to suspend the parser, which fails and raises an
+ * error. The parser can be aborted, but can't be suspended.
+ */
+ if (parser->m_parsingStatus.parsing == XML_FINISHED)
return XML_ERROR_ABORTED;
- default:
- *nextPtr = next;
- }
+ *nextPtr = next;
/* stop scanning for text declaration - we found one */
- processor = entityValueProcessor;
+ parser->m_processor = entityValueProcessor;
return entityValueProcessor(parser, next, end, nextPtr);
}
/* If we are at the end of the buffer, this would cause XmlPrologTok to
@@ -3693,12 +4188,20 @@ entityValueInitProcessor(XML_Parser parser,
then, when this routine is entered the next time, XmlPrologTok will
return XML_TOK_INVALID, since the BOM is still in the buffer
*/
- else if (tok == XML_TOK_BOM && next == end && !ps_finalBuffer) {
+ else if (tok == XML_TOK_BOM && next == end && !parser->m_parsingStatus.finalBuffer) {
*nextPtr = next;
return XML_ERROR_NONE;
}
+ /* If we get this token, we have the start of what might be a
+ normal tag, but not a declaration (i.e. it doesn't begin with
+ "<!"). In a DTD context, that isn't legal.
+ */
+ else if (tok == XML_TOK_INSTANCE_START) {
+ *nextPtr = next;
+ return XML_ERROR_SYNTAX;
+ }
start = next;
- eventPtr = start;
+ parser->m_eventPtr = start;
}
}
@@ -3711,9 +4214,9 @@ externalParEntProcessor(XML_Parser parser,
const char *next = s;
int tok;
- tok = XmlPrologTok(encoding, s, end, &next);
+ tok = XmlPrologTok(parser->m_encoding, s, end, &next);
if (tok <= 0) {
- if (!ps_finalBuffer && tok != XML_TOK_INVALID) {
+ if (!parser->m_parsingStatus.finalBuffer && tok != XML_TOK_INVALID) {
*nextPtr = s;
return XML_ERROR_NONE;
}
@@ -3735,12 +4238,12 @@ externalParEntProcessor(XML_Parser parser,
*/
else if (tok == XML_TOK_BOM) {
s = next;
- tok = XmlPrologTok(encoding, s, end, &next);
+ tok = XmlPrologTok(parser->m_encoding, s, end, &next);
}
- processor = prologProcessor;
- return doProlog(parser, encoding, s, end, tok, next,
- nextPtr, (XML_Bool)!ps_finalBuffer);
+ parser->m_processor = prologProcessor;
+ return doProlog(parser, parser->m_encoding, s, end, tok, next,
+ nextPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer);
}
static enum XML_Error PTRCALL
@@ -3751,13 +4254,13 @@ entityValueProcessor(XML_Parser parser,
{
const char *start = s;
const char *next = s;
- const ENCODING *enc = encoding;
+ const ENCODING *enc = parser->m_encoding;
int tok;
for (;;) {
tok = XmlPrologTok(enc, start, end, &next);
if (tok <= 0) {
- if (!ps_finalBuffer && tok != XML_TOK_INVALID) {
+ if (!parser->m_parsingStatus.finalBuffer && tok != XML_TOK_INVALID) {
*nextPtr = s;
return XML_ERROR_NONE;
}
@@ -3788,9 +4291,9 @@ prologProcessor(XML_Parser parser,
const char **nextPtr)
{
const char *next = s;
- int tok = XmlPrologTok(encoding, s, end, &next);
- return doProlog(parser, encoding, s, end, tok, next,
- nextPtr, (XML_Bool)!ps_finalBuffer);
+ int tok = XmlPrologTok(parser->m_encoding, s, end, &next);
+ return doProlog(parser, parser->m_encoding, s, end, tok, next,
+ nextPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer);
}
static enum XML_Error
@@ -3827,19 +4330,19 @@ doProlog(XML_Parser parser,
static const XML_Char enumValueStart[] = { ASCII_LPAREN, '\0' };
/* save one level of indirection */
- DTD * const dtd = _dtd;
+ DTD * const dtd = parser->m_dtd;
const char **eventPP;
const char **eventEndPP;
enum XML_Content_Quant quant;
- if (enc == encoding) {
- eventPP = &eventPtr;
- eventEndPP = &eventEndPtr;
+ if (enc == parser->m_encoding) {
+ eventPP = &parser->m_eventPtr;
+ eventEndPP = &parser->m_eventEndPtr;
}
else {
- eventPP = &(openInternalEntities->internalEventPtr);
- eventEndPP = &(openInternalEntities->internalEventEndPtr);
+ eventPP = &(parser->m_openInternalEntities->internalEventPtr);
+ eventEndPP = &(parser->m_openInternalEntities->internalEventEndPtr);
}
for (;;) {
@@ -3866,7 +4369,7 @@ doProlog(XML_Parser parser,
case XML_TOK_NONE:
#ifdef XML_DTD
/* for internal PE NOT referenced between declarations */
- if (enc != encoding && !openInternalEntities->betweenDecl) {
+ if (enc != parser->m_encoding && !parser->m_openInternalEntities->betweenDecl) {
*nextPtr = s;
return XML_ERROR_NONE;
}
@@ -3874,8 +4377,8 @@ doProlog(XML_Parser parser,
complete markup, not only for external PEs, but also for
internal PEs if the reference occurs between declarations.
*/
- if (isParamEntity || enc != encoding) {
- if (XmlTokenRole(&prologState, XML_TOK_NONE, end, end, enc)
+ if (parser->m_isParamEntity || enc != parser->m_encoding) {
+ if (XmlTokenRole(&parser->m_prologState, XML_TOK_NONE, end, end, enc)
== XML_ROLE_ERROR)
return XML_ERROR_INCOMPLETE_PE;
*nextPtr = s;
@@ -3889,34 +4392,34 @@ doProlog(XML_Parser parser,
break;
}
}
- role = XmlTokenRole(&prologState, tok, s, next, enc);
+ role = XmlTokenRole(&parser->m_prologState, tok, s, next, enc);
switch (role) {
case XML_ROLE_XML_DECL:
{
enum XML_Error result = processXmlDecl(parser, 0, s, next);
if (result != XML_ERROR_NONE)
return result;
- enc = encoding;
+ enc = parser->m_encoding;
handleDefault = XML_FALSE;
}
break;
case XML_ROLE_DOCTYPE_NAME:
- if (startDoctypeDeclHandler) {
- doctypeName = poolStoreString(&tempPool, enc, s, next);
- if (!doctypeName)
+ if (parser->m_startDoctypeDeclHandler) {
+ parser->m_doctypeName = poolStoreString(&parser->m_tempPool, enc, s, next);
+ if (!parser->m_doctypeName)
return XML_ERROR_NO_MEMORY;
- poolFinish(&tempPool);
- doctypePubid = NULL;
+ poolFinish(&parser->m_tempPool);
+ parser->m_doctypePubid = NULL;
handleDefault = XML_FALSE;
}
- doctypeSysid = NULL; /* always initialize to NULL */
+ parser->m_doctypeSysid = NULL; /* always initialize to NULL */
break;
case XML_ROLE_DOCTYPE_INTERNAL_SUBSET:
- if (startDoctypeDeclHandler) {
- startDoctypeDeclHandler(handlerArg, doctypeName, doctypeSysid,
- doctypePubid, 1);
- doctypeName = NULL;
- poolClear(&tempPool);
+ if (parser->m_startDoctypeDeclHandler) {
+ parser->m_startDoctypeDeclHandler(parser->m_handlerArg, parser->m_doctypeName, parser->m_doctypeSysid,
+ parser->m_doctypePubid, 1);
+ parser->m_doctypeName = NULL;
+ poolClear(&parser->m_tempPool);
handleDefault = XML_FALSE;
}
break;
@@ -3926,34 +4429,34 @@ doProlog(XML_Parser parser,
enum XML_Error result = processXmlDecl(parser, 1, s, next);
if (result != XML_ERROR_NONE)
return result;
- enc = encoding;
+ enc = parser->m_encoding;
handleDefault = XML_FALSE;
}
break;
#endif /* XML_DTD */
case XML_ROLE_DOCTYPE_PUBLIC_ID:
#ifdef XML_DTD
- useForeignDTD = XML_FALSE;
- declEntity = (ENTITY *)lookup(parser,
+ parser->m_useForeignDTD = XML_FALSE;
+ parser->m_declEntity = (ENTITY *)lookup(parser,
&dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
- if (!declEntity)
+ if (!parser->m_declEntity)
return XML_ERROR_NO_MEMORY;
#endif /* XML_DTD */
dtd->hasParamEntityRefs = XML_TRUE;
- if (startDoctypeDeclHandler) {
+ if (parser->m_startDoctypeDeclHandler) {
XML_Char *pubId;
if (!XmlIsPublicId(enc, s, next, eventPP))
return XML_ERROR_PUBLICID;
- pubId = poolStoreString(&tempPool, enc,
+ pubId = poolStoreString(&parser->m_tempPool, enc,
s + enc->minBytesPerChar,
next - enc->minBytesPerChar);
if (!pubId)
return XML_ERROR_NO_MEMORY;
normalizePublicId(pubId);
- poolFinish(&tempPool);
- doctypePubid = pubId;
+ poolFinish(&parser->m_tempPool);
+ parser->m_doctypePubid = pubId;
handleDefault = XML_FALSE;
goto alreadyChecked;
}
@@ -3962,7 +4465,7 @@ doProlog(XML_Parser parser,
if (!XmlIsPublicId(enc, s, next, eventPP))
return XML_ERROR_PUBLICID;
alreadyChecked:
- if (dtd->keepProcessing && declEntity) {
+ if (dtd->keepProcessing && parser->m_declEntity) {
XML_Char *tem = poolStoreString(&dtd->pool,
enc,
s + enc->minBytesPerChar,
@@ -3970,38 +4473,47 @@ doProlog(XML_Parser parser,
if (!tem)
return XML_ERROR_NO_MEMORY;
normalizePublicId(tem);
- declEntity->publicId = tem;
+ parser->m_declEntity->publicId = tem;
poolFinish(&dtd->pool);
- if (entityDeclHandler)
+ /* Don't suppress the default handler if we fell through from
+ * the XML_ROLE_DOCTYPE_PUBLIC_ID case.
+ */
+ if (parser->m_entityDeclHandler && role == XML_ROLE_ENTITY_PUBLIC_ID)
handleDefault = XML_FALSE;
}
break;
case XML_ROLE_DOCTYPE_CLOSE:
- if (doctypeName) {
- startDoctypeDeclHandler(handlerArg, doctypeName,
- doctypeSysid, doctypePubid, 0);
- poolClear(&tempPool);
+ if (parser->m_doctypeName) {
+ parser->m_startDoctypeDeclHandler(parser->m_handlerArg, parser->m_doctypeName,
+ parser->m_doctypeSysid, parser->m_doctypePubid, 0);
+ poolClear(&parser->m_tempPool);
handleDefault = XML_FALSE;
}
- /* doctypeSysid will be non-NULL in the case of a previous
- XML_ROLE_DOCTYPE_SYSTEM_ID, even if startDoctypeDeclHandler
+ /* parser->m_doctypeSysid will be non-NULL in the case of a previous
+ XML_ROLE_DOCTYPE_SYSTEM_ID, even if parser->m_startDoctypeDeclHandler
was not set, indicating an external subset
*/
#ifdef XML_DTD
- if (doctypeSysid || useForeignDTD) {
+ if (parser->m_doctypeSysid || parser->m_useForeignDTD) {
XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
dtd->hasParamEntityRefs = XML_TRUE;
- if (paramEntityParsing && externalEntityRefHandler) {
+ if (parser->m_paramEntityParsing && parser->m_externalEntityRefHandler) {
ENTITY *entity = (ENTITY *)lookup(parser,
&dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
- if (!entity)
- return XML_ERROR_NO_MEMORY;
- if (useForeignDTD)
- entity->base = curBase;
+ if (!entity) {
+ /* The external subset name "#" will have already been
+ * inserted into the hash table at the start of the
+ * external entity parsing, so no allocation will happen
+ * and lookup() cannot fail.
+ */
+ return XML_ERROR_NO_MEMORY; /* LCOV_EXCL_LINE */
+ }
+ if (parser->m_useForeignDTD)
+ entity->base = parser->m_curBase;
dtd->paramEntityRead = XML_FALSE;
- if (!externalEntityRefHandler(externalEntityRefHandlerArg,
+ if (!parser->m_externalEntityRefHandler(parser->m_externalEntityRefHandlerArg,
0,
entity->base,
entity->systemId,
@@ -4009,22 +4521,22 @@ doProlog(XML_Parser parser,
return XML_ERROR_EXTERNAL_ENTITY_HANDLING;
if (dtd->paramEntityRead) {
if (!dtd->standalone &&
- notStandaloneHandler &&
- !notStandaloneHandler(handlerArg))
+ parser->m_notStandaloneHandler &&
+ !parser->m_notStandaloneHandler(parser->m_handlerArg))
return XML_ERROR_NOT_STANDALONE;
}
/* if we didn't read the foreign DTD then this means that there
is no external subset and we must reset dtd->hasParamEntityRefs
*/
- else if (!doctypeSysid)
+ else if (!parser->m_doctypeSysid)
dtd->hasParamEntityRefs = hadParamEntityRefs;
/* end of DTD - no need to update dtd->keepProcessing */
}
- useForeignDTD = XML_FALSE;
+ parser->m_useForeignDTD = XML_FALSE;
}
#endif /* XML_DTD */
- if (endDoctypeDeclHandler) {
- endDoctypeDeclHandler(handlerArg);
+ if (parser->m_endDoctypeDeclHandler) {
+ parser->m_endDoctypeDeclHandler(parser->m_handlerArg);
handleDefault = XML_FALSE;
}
break;
@@ -4033,18 +4545,18 @@ doProlog(XML_Parser parser,
/* if there is no DOCTYPE declaration then now is the
last chance to read the foreign DTD
*/
- if (useForeignDTD) {
+ if (parser->m_useForeignDTD) {
XML_Bool hadParamEntityRefs = dtd->hasParamEntityRefs;
dtd->hasParamEntityRefs = XML_TRUE;
- if (paramEntityParsing && externalEntityRefHandler) {
+ if (parser->m_paramEntityParsing && parser->m_externalEntityRefHandler) {
ENTITY *entity = (ENTITY *)lookup(parser, &dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
if (!entity)
return XML_ERROR_NO_MEMORY;
- entity->base = curBase;
+ entity->base = parser->m_curBase;
dtd->paramEntityRead = XML_FALSE;
- if (!externalEntityRefHandler(externalEntityRefHandlerArg,
+ if (!parser->m_externalEntityRefHandler(parser->m_externalEntityRefHandlerArg,
0,
entity->base,
entity->systemId,
@@ -4052,8 +4564,8 @@ doProlog(XML_Parser parser,
return XML_ERROR_EXTERNAL_ENTITY_HANDLING;
if (dtd->paramEntityRead) {
if (!dtd->standalone &&
- notStandaloneHandler &&
- !notStandaloneHandler(handlerArg))
+ parser->m_notStandaloneHandler &&
+ !parser->m_notStandaloneHandler(parser->m_handlerArg))
return XML_ERROR_NOT_STANDALONE;
}
/* if we didn't read the foreign DTD then this means that there
@@ -4065,55 +4577,55 @@ doProlog(XML_Parser parser,
}
}
#endif /* XML_DTD */
- processor = contentProcessor;
+ parser->m_processor = contentProcessor;
return contentProcessor(parser, s, end, nextPtr);
case XML_ROLE_ATTLIST_ELEMENT_NAME:
- declElementType = getElementType(parser, enc, s, next);
- if (!declElementType)
+ parser->m_declElementType = getElementType(parser, enc, s, next);
+ if (!parser->m_declElementType)
return XML_ERROR_NO_MEMORY;
goto checkAttListDeclHandler;
case XML_ROLE_ATTRIBUTE_NAME:
- declAttributeId = getAttributeId(parser, enc, s, next);
- if (!declAttributeId)
+ parser->m_declAttributeId = getAttributeId(parser, enc, s, next);
+ if (!parser->m_declAttributeId)
return XML_ERROR_NO_MEMORY;
- declAttributeIsCdata = XML_FALSE;
- declAttributeType = NULL;
- declAttributeIsId = XML_FALSE;
+ parser->m_declAttributeIsCdata = XML_FALSE;
+ parser->m_declAttributeType = NULL;
+ parser->m_declAttributeIsId = XML_FALSE;
goto checkAttListDeclHandler;
case XML_ROLE_ATTRIBUTE_TYPE_CDATA:
- declAttributeIsCdata = XML_TRUE;
- declAttributeType = atypeCDATA;
+ parser->m_declAttributeIsCdata = XML_TRUE;
+ parser->m_declAttributeType = atypeCDATA;
goto checkAttListDeclHandler;
case XML_ROLE_ATTRIBUTE_TYPE_ID:
- declAttributeIsId = XML_TRUE;
- declAttributeType = atypeID;
+ parser->m_declAttributeIsId = XML_TRUE;
+ parser->m_declAttributeType = atypeID;
goto checkAttListDeclHandler;
case XML_ROLE_ATTRIBUTE_TYPE_IDREF:
- declAttributeType = atypeIDREF;
+ parser->m_declAttributeType = atypeIDREF;
goto checkAttListDeclHandler;
case XML_ROLE_ATTRIBUTE_TYPE_IDREFS:
- declAttributeType = atypeIDREFS;
+ parser->m_declAttributeType = atypeIDREFS;
goto checkAttListDeclHandler;
case XML_ROLE_ATTRIBUTE_TYPE_ENTITY:
- declAttributeType = atypeENTITY;
+ parser->m_declAttributeType = atypeENTITY;
goto checkAttListDeclHandler;
case XML_ROLE_ATTRIBUTE_TYPE_ENTITIES:
- declAttributeType = atypeENTITIES;
+ parser->m_declAttributeType = atypeENTITIES;
goto checkAttListDeclHandler;
case XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN:
- declAttributeType = atypeNMTOKEN;
+ parser->m_declAttributeType = atypeNMTOKEN;
goto checkAttListDeclHandler;
case XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS:
- declAttributeType = atypeNMTOKENS;
+ parser->m_declAttributeType = atypeNMTOKENS;
checkAttListDeclHandler:
- if (dtd->keepProcessing && attlistDeclHandler)
+ if (dtd->keepProcessing && parser->m_attlistDeclHandler)
handleDefault = XML_FALSE;
break;
case XML_ROLE_ATTRIBUTE_ENUM_VALUE:
case XML_ROLE_ATTRIBUTE_NOTATION_VALUE:
- if (dtd->keepProcessing && attlistDeclHandler) {
+ if (dtd->keepProcessing && parser->m_attlistDeclHandler) {
const XML_Char *prefix;
- if (declAttributeType) {
+ if (parser->m_declAttributeType) {
prefix = enumValueSep;
}
else {
@@ -4121,37 +4633,37 @@ doProlog(XML_Parser parser,
? notationPrefix
: enumValueStart);
}
- if (!poolAppendString(&tempPool, prefix))
+ if (!poolAppendString(&parser->m_tempPool, prefix))
return XML_ERROR_NO_MEMORY;
- if (!poolAppend(&tempPool, enc, s, next))
+ if (!poolAppend(&parser->m_tempPool, enc, s, next))
return XML_ERROR_NO_MEMORY;
- declAttributeType = tempPool.start;
+ parser->m_declAttributeType = parser->m_tempPool.start;
handleDefault = XML_FALSE;
}
break;
case XML_ROLE_IMPLIED_ATTRIBUTE_VALUE:
case XML_ROLE_REQUIRED_ATTRIBUTE_VALUE:
if (dtd->keepProcessing) {
- if (!defineAttribute(declElementType, declAttributeId,
- declAttributeIsCdata, declAttributeIsId,
+ if (!defineAttribute(parser->m_declElementType, parser->m_declAttributeId,
+ parser->m_declAttributeIsCdata, parser->m_declAttributeIsId,
0, parser))
return XML_ERROR_NO_MEMORY;
- if (attlistDeclHandler && declAttributeType) {
- if (*declAttributeType == XML_T(ASCII_LPAREN)
- || (*declAttributeType == XML_T(ASCII_N)
- && declAttributeType[1] == XML_T(ASCII_O))) {
+ if (parser->m_attlistDeclHandler && parser->m_declAttributeType) {
+ if (*parser->m_declAttributeType == XML_T(ASCII_LPAREN)
+ || (*parser->m_declAttributeType == XML_T(ASCII_N)
+ && parser->m_declAttributeType[1] == XML_T(ASCII_O))) {
/* Enumerated or Notation type */
- if (!poolAppendChar(&tempPool, XML_T(ASCII_RPAREN))
- || !poolAppendChar(&tempPool, XML_T('\0')))
+ if (!poolAppendChar(&parser->m_tempPool, XML_T(ASCII_RPAREN))
+ || !poolAppendChar(&parser->m_tempPool, XML_T('\0')))
return XML_ERROR_NO_MEMORY;
- declAttributeType = tempPool.start;
- poolFinish(&tempPool);
+ parser->m_declAttributeType = parser->m_tempPool.start;
+ poolFinish(&parser->m_tempPool);
}
*eventEndPP = s;
- attlistDeclHandler(handlerArg, declElementType->name,
- declAttributeId->name, declAttributeType,
+ parser->m_attlistDeclHandler(parser->m_handlerArg, parser->m_declElementType->name,
+ parser->m_declAttributeId->name, parser->m_declAttributeType,
0, role == XML_ROLE_REQUIRED_ATTRIBUTE_VALUE);
- poolClear(&tempPool);
+ poolClear(&parser->m_tempPool);
handleDefault = XML_FALSE;
}
}
@@ -4161,7 +4673,7 @@ doProlog(XML_Parser parser,
if (dtd->keepProcessing) {
const XML_Char *attVal;
enum XML_Error result =
- storeAttributeValue(parser, enc, declAttributeIsCdata,
+ storeAttributeValue(parser, enc, parser->m_declAttributeIsCdata,
s + enc->minBytesPerChar,
next - enc->minBytesPerChar,
&dtd->pool);
@@ -4170,26 +4682,26 @@ doProlog(XML_Parser parser,
attVal = poolStart(&dtd->pool);
poolFinish(&dtd->pool);
/* ID attributes aren't allowed to have a default */
- if (!defineAttribute(declElementType, declAttributeId,
- declAttributeIsCdata, XML_FALSE, attVal, parser))
+ if (!defineAttribute(parser->m_declElementType, parser->m_declAttributeId,
+ parser->m_declAttributeIsCdata, XML_FALSE, attVal, parser))
return XML_ERROR_NO_MEMORY;
- if (attlistDeclHandler && declAttributeType) {
- if (*declAttributeType == XML_T(ASCII_LPAREN)
- || (*declAttributeType == XML_T(ASCII_N)
- && declAttributeType[1] == XML_T(ASCII_O))) {
+ if (parser->m_attlistDeclHandler && parser->m_declAttributeType) {
+ if (*parser->m_declAttributeType == XML_T(ASCII_LPAREN)
+ || (*parser->m_declAttributeType == XML_T(ASCII_N)
+ && parser->m_declAttributeType[1] == XML_T(ASCII_O))) {
/* Enumerated or Notation type */
- if (!poolAppendChar(&tempPool, XML_T(ASCII_RPAREN))
- || !poolAppendChar(&tempPool, XML_T('\0')))
+ if (!poolAppendChar(&parser->m_tempPool, XML_T(ASCII_RPAREN))
+ || !poolAppendChar(&parser->m_tempPool, XML_T('\0')))
return XML_ERROR_NO_MEMORY;
- declAttributeType = tempPool.start;
- poolFinish(&tempPool);
+ parser->m_declAttributeType = parser->m_tempPool.start;
+ poolFinish(&parser->m_tempPool);
}
*eventEndPP = s;
- attlistDeclHandler(handlerArg, declElementType->name,
- declAttributeId->name, declAttributeType,
+ parser->m_attlistDeclHandler(parser->m_handlerArg, parser->m_declElementType->name,
+ parser->m_declAttributeId->name, parser->m_declAttributeType,
attVal,
role == XML_ROLE_FIXED_ATTRIBUTE_VALUE);
- poolClear(&tempPool);
+ poolClear(&parser->m_tempPool);
handleDefault = XML_FALSE;
}
}
@@ -4199,18 +4711,18 @@ doProlog(XML_Parser parser,
enum XML_Error result = storeEntityValue(parser, enc,
s + enc->minBytesPerChar,
next - enc->minBytesPerChar);
- if (declEntity) {
- declEntity->textPtr = poolStart(&dtd->entityValuePool);
- declEntity->textLen = (int)(poolLength(&dtd->entityValuePool));
+ if (parser->m_declEntity) {
+ parser->m_declEntity->textPtr = poolStart(&dtd->entityValuePool);
+ parser->m_declEntity->textLen = (int)(poolLength(&dtd->entityValuePool));
poolFinish(&dtd->entityValuePool);
- if (entityDeclHandler) {
+ if (parser->m_entityDeclHandler) {
*eventEndPP = s;
- entityDeclHandler(handlerArg,
- declEntity->name,
- declEntity->is_param,
- declEntity->textPtr,
- declEntity->textLen,
- curBase, 0, 0, 0);
+ parser->m_entityDeclHandler(parser->m_handlerArg,
+ parser->m_declEntity->name,
+ parser->m_declEntity->is_param,
+ parser->m_declEntity->textPtr,
+ parser->m_declEntity->textLen,
+ parser->m_curBase, 0, 0, 0);
handleDefault = XML_FALSE;
}
}
@@ -4222,97 +4734,100 @@ doProlog(XML_Parser parser,
break;
case XML_ROLE_DOCTYPE_SYSTEM_ID:
#ifdef XML_DTD
- useForeignDTD = XML_FALSE;
+ parser->m_useForeignDTD = XML_FALSE;
#endif /* XML_DTD */
dtd->hasParamEntityRefs = XML_TRUE;
- if (startDoctypeDeclHandler) {
- doctypeSysid = poolStoreString(&tempPool, enc,
+ if (parser->m_startDoctypeDeclHandler) {
+ parser->m_doctypeSysid = poolStoreString(&parser->m_tempPool, enc,
s + enc->minBytesPerChar,
next - enc->minBytesPerChar);
- if (doctypeSysid == NULL)
+ if (parser->m_doctypeSysid == NULL)
return XML_ERROR_NO_MEMORY;
- poolFinish(&tempPool);
+ poolFinish(&parser->m_tempPool);
handleDefault = XML_FALSE;
}
#ifdef XML_DTD
else
- /* use externalSubsetName to make doctypeSysid non-NULL
- for the case where no startDoctypeDeclHandler is set */
- doctypeSysid = externalSubsetName;
+ /* use externalSubsetName to make parser->m_doctypeSysid non-NULL
+ for the case where no parser->m_startDoctypeDeclHandler is set */
+ parser->m_doctypeSysid = externalSubsetName;
#endif /* XML_DTD */
if (!dtd->standalone
#ifdef XML_DTD
- && !paramEntityParsing
+ && !parser->m_paramEntityParsing
#endif /* XML_DTD */
- && notStandaloneHandler
- && !notStandaloneHandler(handlerArg))
+ && parser->m_notStandaloneHandler
+ && !parser->m_notStandaloneHandler(parser->m_handlerArg))
return XML_ERROR_NOT_STANDALONE;
#ifndef XML_DTD
break;
#else /* XML_DTD */
- if (!declEntity) {
- declEntity = (ENTITY *)lookup(parser,
+ if (!parser->m_declEntity) {
+ parser->m_declEntity = (ENTITY *)lookup(parser,
&dtd->paramEntities,
externalSubsetName,
sizeof(ENTITY));
- if (!declEntity)
+ if (!parser->m_declEntity)
return XML_ERROR_NO_MEMORY;
- declEntity->publicId = NULL;
+ parser->m_declEntity->publicId = NULL;
}
- /* fall through */
#endif /* XML_DTD */
+ /* fall through */
case XML_ROLE_ENTITY_SYSTEM_ID:
- if (dtd->keepProcessing && declEntity) {
- declEntity->systemId = poolStoreString(&dtd->pool, enc,
+ if (dtd->keepProcessing && parser->m_declEntity) {
+ parser->m_declEntity->systemId = poolStoreString(&dtd->pool, enc,
s + enc->minBytesPerChar,
next - enc->minBytesPerChar);
- if (!declEntity->systemId)
+ if (!parser->m_declEntity->systemId)
return XML_ERROR_NO_MEMORY;
- declEntity->base = curBase;
+ parser->m_declEntity->base = parser->m_curBase;
poolFinish(&dtd->pool);
- if (entityDeclHandler)
+ /* Don't suppress the default handler if we fell through from
+ * the XML_ROLE_DOCTYPE_SYSTEM_ID case.
+ */
+ if (parser->m_entityDeclHandler && role == XML_ROLE_ENTITY_SYSTEM_ID)
handleDefault = XML_FALSE;
}
break;
case XML_ROLE_ENTITY_COMPLETE:
- if (dtd->keepProcessing && declEntity && entityDeclHandler) {
+ if (dtd->keepProcessing && parser->m_declEntity && parser->m_entityDeclHandler) {
*eventEndPP = s;
- entityDeclHandler(handlerArg,
- declEntity->name,
- declEntity->is_param,
+ parser->m_entityDeclHandler(parser->m_handlerArg,
+ parser->m_declEntity->name,
+ parser->m_declEntity->is_param,
0,0,
- declEntity->base,
- declEntity->systemId,
- declEntity->publicId,
+ parser->m_declEntity->base,
+ parser->m_declEntity->systemId,
+ parser->m_declEntity->publicId,
0);
handleDefault = XML_FALSE;
}
break;
case XML_ROLE_ENTITY_NOTATION_NAME:
- if (dtd->keepProcessing && declEntity) {
- declEntity->notation = poolStoreString(&dtd->pool, enc, s, next);
- if (!declEntity->notation)
+ if (dtd->keepProcessing && parser->m_declEntity) {
+ parser->m_declEntity->notation = poolStoreString(&dtd->pool, enc, s, next);
+ if (!parser->m_declEntity->notation)
return XML_ERROR_NO_MEMORY;
poolFinish(&dtd->pool);
- if (unparsedEntityDeclHandler) {
+ if (parser->m_unparsedEntityDeclHandler) {
*eventEndPP = s;
- unparsedEntityDeclHandler(handlerArg,
- declEntity->name,
- declEntity->base,
- declEntity->systemId,
- declEntity->publicId,
- declEntity->notation);
+ parser->m_unparsedEntityDeclHandler(parser->m_handlerArg,
+ parser->m_declEntity->name,
+ parser->m_declEntity->base,
+ parser->m_declEntity->systemId,
+ parser->m_declEntity->publicId,
+ parser->m_declEntity->notation);
handleDefault = XML_FALSE;
}
- else if (entityDeclHandler) {
+ else if (parser->m_entityDeclHandler) {
*eventEndPP = s;
- entityDeclHandler(handlerArg,
- declEntity->name,
+ parser->m_entityDeclHandler(parser->m_handlerArg,
+ parser->m_declEntity->name,
0,0,0,
- declEntity->base,
- declEntity->systemId,
- declEntity->publicId,
- declEntity->notation);
+ parser->m_declEntity->base,
+ parser->m_declEntity->systemId,
+ parser->m_declEntity->publicId,
+ parser->m_declEntity->notation);
handleDefault = XML_FALSE;
}
}
@@ -4320,36 +4835,36 @@ doProlog(XML_Parser parser,
case XML_ROLE_GENERAL_ENTITY_NAME:
{
if (XmlPredefinedEntityName(enc, s, next)) {
- declEntity = NULL;
+ parser->m_declEntity = NULL;
break;
}
if (dtd->keepProcessing) {
const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
if (!name)
return XML_ERROR_NO_MEMORY;
- declEntity = (ENTITY *)lookup(parser, &dtd->generalEntities, name,
+ parser->m_declEntity = (ENTITY *)lookup(parser, &dtd->generalEntities, name,
sizeof(ENTITY));
- if (!declEntity)
+ if (!parser->m_declEntity)
return XML_ERROR_NO_MEMORY;
- if (declEntity->name != name) {
+ if (parser->m_declEntity->name != name) {
poolDiscard(&dtd->pool);
- declEntity = NULL;
+ parser->m_declEntity = NULL;
}
else {
poolFinish(&dtd->pool);
- declEntity->publicId = NULL;
- declEntity->is_param = XML_FALSE;
+ parser->m_declEntity->publicId = NULL;
+ parser->m_declEntity->is_param = XML_FALSE;
/* if we have a parent parser or are reading an internal parameter
entity, then the entity declaration is not considered "internal"
*/
- declEntity->is_internal = !(parentParser || openInternalEntities);
- if (entityDeclHandler)
+ parser->m_declEntity->is_internal = !(parser->m_parentParser || parser->m_openInternalEntities);
+ if (parser->m_entityDeclHandler)
handleDefault = XML_FALSE;
}
}
else {
poolDiscard(&dtd->pool);
- declEntity = NULL;
+ parser->m_declEntity = NULL;
}
}
break;
@@ -4359,90 +4874,90 @@ doProlog(XML_Parser parser,
const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next);
if (!name)
return XML_ERROR_NO_MEMORY;
- declEntity = (ENTITY *)lookup(parser, &dtd->paramEntities,
+ parser->m_declEntity = (ENTITY *)lookup(parser, &dtd->paramEntities,
name, sizeof(ENTITY));
- if (!declEntity)
+ if (!parser->m_declEntity)
return XML_ERROR_NO_MEMORY;
- if (declEntity->name != name) {
+ if (parser->m_declEntity->name != name) {
poolDiscard(&dtd->pool);
- declEntity = NULL;
+ parser->m_declEntity = NULL;
}
else {
poolFinish(&dtd->pool);
- declEntity->publicId = NULL;
- declEntity->is_param = XML_TRUE;
+ parser->m_declEntity->publicId = NULL;
+ parser->m_declEntity->is_param = XML_TRUE;
/* if we have a parent parser or are reading an internal parameter
entity, then the entity declaration is not considered "internal"
*/
- declEntity->is_internal = !(parentParser || openInternalEntities);
- if (entityDeclHandler)
+ parser->m_declEntity->is_internal = !(parser->m_parentParser || parser->m_openInternalEntities);
+ if (parser->m_entityDeclHandler)
handleDefault = XML_FALSE;
}
}
else {
poolDiscard(&dtd->pool);
- declEntity = NULL;
+ parser->m_declEntity = NULL;
}
#else /* not XML_DTD */
- declEntity = NULL;
+ parser->m_declEntity = NULL;
#endif /* XML_DTD */
break;
case XML_ROLE_NOTATION_NAME:
- declNotationPublicId = NULL;
- declNotationName = NULL;
- if (notationDeclHandler) {
- declNotationName = poolStoreString(&tempPool, enc, s, next);
- if (!declNotationName)
+ parser->m_declNotationPublicId = NULL;
+ parser->m_declNotationName = NULL;
+ if (parser->m_notationDeclHandler) {
+ parser->m_declNotationName = poolStoreString(&parser->m_tempPool, enc, s, next);
+ if (!parser->m_declNotationName)
return XML_ERROR_NO_MEMORY;
- poolFinish(&tempPool);
+ poolFinish(&parser->m_tempPool);
handleDefault = XML_FALSE;
}
break;
case XML_ROLE_NOTATION_PUBLIC_ID:
if (!XmlIsPublicId(enc, s, next, eventPP))
return XML_ERROR_PUBLICID;
- if (declNotationName) { /* means notationDeclHandler != NULL */
- XML_Char *tem = poolStoreString(&tempPool,
+ if (parser->m_declNotationName) { /* means m_notationDeclHandler != NULL */
+ XML_Char *tem = poolStoreString(&parser->m_tempPool,
enc,
s + enc->minBytesPerChar,
next - enc->minBytesPerChar);
if (!tem)
return XML_ERROR_NO_MEMORY;
normalizePublicId(tem);
- declNotationPublicId = tem;
- poolFinish(&tempPool);
+ parser->m_declNotationPublicId = tem;
+ poolFinish(&parser->m_tempPool);
handleDefault = XML_FALSE;
}
break;
case XML_ROLE_NOTATION_SYSTEM_ID:
- if (declNotationName && notationDeclHandler) {
+ if (parser->m_declNotationName && parser->m_notationDeclHandler) {
const XML_Char *systemId
- = poolStoreString(&tempPool, enc,
+ = poolStoreString(&parser->m_tempPool, enc,
s + enc->minBytesPerChar,
next - enc->minBytesPerChar);
if (!systemId)
return XML_ERROR_NO_MEMORY;
*eventEndPP = s;
- notationDeclHandler(handlerArg,
- declNotationName,
- curBase,
+ parser->m_notationDeclHandler(parser->m_handlerArg,
+ parser->m_declNotationName,
+ parser->m_curBase,
systemId,
- declNotationPublicId);
+ parser->m_declNotationPublicId);
handleDefault = XML_FALSE;
}
- poolClear(&tempPool);
+ poolClear(&parser->m_tempPool);
break;
case XML_ROLE_NOTATION_NO_SYSTEM_ID:
- if (declNotationPublicId && notationDeclHandler) {
+ if (parser->m_declNotationPublicId && parser->m_notationDeclHandler) {
*eventEndPP = s;
- notationDeclHandler(handlerArg,
- declNotationName,
- curBase,
+ parser->m_notationDeclHandler(parser->m_handlerArg,
+ parser->m_declNotationName,
+ parser->m_curBase,
0,
- declNotationPublicId);
+ parser->m_declNotationPublicId);
handleDefault = XML_FALSE;
}
- poolClear(&tempPool);
+ poolClear(&parser->m_tempPool);
break;
case XML_ROLE_ERROR:
switch (tok) {
@@ -4459,41 +4974,45 @@ doProlog(XML_Parser parser,
case XML_ROLE_IGNORE_SECT:
{
enum XML_Error result;
- if (defaultHandler)
+ if (parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
handleDefault = XML_FALSE;
result = doIgnoreSection(parser, enc, &next, end, nextPtr, haveMore);
if (result != XML_ERROR_NONE)
return result;
else if (!next) {
- processor = ignoreSectionProcessor;
+ parser->m_processor = ignoreSectionProcessor;
return result;
}
}
break;
#endif /* XML_DTD */
case XML_ROLE_GROUP_OPEN:
- if (prologState.level >= groupSize) {
- if (groupSize) {
- char *temp = (char *)REALLOC(groupConnector, groupSize *= 2);
- if (temp == NULL)
+ if (parser->m_prologState.level >= parser->m_groupSize) {
+ if (parser->m_groupSize) {
+ char *temp = (char *)REALLOC(parser, parser->m_groupConnector, parser->m_groupSize *= 2);
+ if (temp == NULL) {
+ parser->m_groupSize /= 2;
return XML_ERROR_NO_MEMORY;
- groupConnector = temp;
+ }
+ parser->m_groupConnector = temp;
if (dtd->scaffIndex) {
- int *temp = (int *)REALLOC(dtd->scaffIndex,
- groupSize * sizeof(int));
+ int *temp = (int *)REALLOC(parser, dtd->scaffIndex,
+ parser->m_groupSize * sizeof(int));
if (temp == NULL)
return XML_ERROR_NO_MEMORY;
dtd->scaffIndex = temp;
}
}
else {
- groupConnector = (char *)MALLOC(groupSize = 32);
- if (!groupConnector)
+ parser->m_groupConnector = (char *)MALLOC(parser, parser->m_groupSize = 32);
+ if (!parser->m_groupConnector) {
+ parser->m_groupSize = 0;
return XML_ERROR_NO_MEMORY;
+ }
}
}
- groupConnector[prologState.level] = 0;
+ parser->m_groupConnector[parser->m_prologState.level] = 0;
if (dtd->in_eldecl) {
int myindex = nextScaffoldPart(parser);
if (myindex < 0)
@@ -4501,37 +5020,37 @@ doProlog(XML_Parser parser,
dtd->scaffIndex[dtd->scaffLevel] = myindex;
dtd->scaffLevel++;
dtd->scaffold[myindex].type = XML_CTYPE_SEQ;
- if (elementDeclHandler)
+ if (parser->m_elementDeclHandler)
handleDefault = XML_FALSE;
}
break;
case XML_ROLE_GROUP_SEQUENCE:
- if (groupConnector[prologState.level] == ASCII_PIPE)
+ if (parser->m_groupConnector[parser->m_prologState.level] == ASCII_PIPE)
return XML_ERROR_SYNTAX;
- groupConnector[prologState.level] = ASCII_COMMA;
- if (dtd->in_eldecl && elementDeclHandler)
+ parser->m_groupConnector[parser->m_prologState.level] = ASCII_COMMA;
+ if (dtd->in_eldecl && parser->m_elementDeclHandler)
handleDefault = XML_FALSE;
break;
case XML_ROLE_GROUP_CHOICE:
- if (groupConnector[prologState.level] == ASCII_COMMA)
+ if (parser->m_groupConnector[parser->m_prologState.level] == ASCII_COMMA)
return XML_ERROR_SYNTAX;
if (dtd->in_eldecl
- && !groupConnector[prologState.level]
+ && !parser->m_groupConnector[parser->m_prologState.level]
&& (dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
!= XML_CTYPE_MIXED)
) {
dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
= XML_CTYPE_CHOICE;
- if (elementDeclHandler)
+ if (parser->m_elementDeclHandler)
handleDefault = XML_FALSE;
}
- groupConnector[prologState.level] = ASCII_PIPE;
+ parser->m_groupConnector[parser->m_prologState.level] = ASCII_PIPE;
break;
case XML_ROLE_PARAM_ENTITY_REF:
#ifdef XML_DTD
case XML_ROLE_INNER_PARAM_ENTITY_REF:
dtd->hasParamEntityRefs = XML_TRUE;
- if (!paramEntityParsing)
+ if (!parser->m_paramEntityParsing)
dtd->keepProcessing = dtd->standalone;
else {
const XML_Char *name;
@@ -4547,20 +5066,41 @@ doProlog(XML_Parser parser,
if yes, check that the entity exists, and that it is internal,
otherwise call the skipped entity handler
*/
- if (prologState.documentEntity &&
+ if (parser->m_prologState.documentEntity &&
(dtd->standalone
- ? !openInternalEntities
+ ? !parser->m_openInternalEntities
: !dtd->hasParamEntityRefs)) {
if (!entity)
return XML_ERROR_UNDEFINED_ENTITY;
- else if (!entity->is_internal)
- return XML_ERROR_ENTITY_DECLARED_IN_PE;
+ else if (!entity->is_internal) {
+ /* It's hard to exhaustively search the code to be sure,
+ * but there doesn't seem to be a way of executing the
+ * following line. There are two cases:
+ *
+ * If 'standalone' is false, the DTD must have no
+ * parameter entities or we wouldn't have passed the outer
+ * 'if' statement. That measn the only entity in the hash
+ * table is the external subset name "#" which cannot be
+ * given as a parameter entity name in XML syntax, so the
+ * lookup must have returned NULL and we don't even reach
+ * the test for an internal entity.
+ *
+ * If 'standalone' is true, it does not seem to be
+ * possible to create entities taking this code path that
+ * are not internal entities, so fail the test above.
+ *
+ * Because this analysis is very uncertain, the code is
+ * being left in place and merely removed from the
+ * coverage test statistics.
+ */
+ return XML_ERROR_ENTITY_DECLARED_IN_PE; /* LCOV_EXCL_LINE */
+ }
}
else if (!entity) {
dtd->keepProcessing = dtd->standalone;
/* cannot report skipped entities in declarations */
- if ((role == XML_ROLE_PARAM_ENTITY_REF) && skippedEntityHandler) {
- skippedEntityHandler(handlerArg, name, 1);
+ if ((role == XML_ROLE_PARAM_ENTITY_REF) && parser->m_skippedEntityHandler) {
+ parser->m_skippedEntityHandler(parser->m_handlerArg, name, 1);
handleDefault = XML_FALSE;
}
break;
@@ -4577,10 +5117,10 @@ doProlog(XML_Parser parser,
handleDefault = XML_FALSE;
break;
}
- if (externalEntityRefHandler) {
+ if (parser->m_externalEntityRefHandler) {
dtd->paramEntityRead = XML_FALSE;
entity->open = XML_TRUE;
- if (!externalEntityRefHandler(externalEntityRefHandlerArg,
+ if (!parser->m_externalEntityRefHandler(parser->m_externalEntityRefHandlerArg,
0,
entity->base,
entity->systemId,
@@ -4602,17 +5142,17 @@ doProlog(XML_Parser parser,
}
#endif /* XML_DTD */
if (!dtd->standalone &&
- notStandaloneHandler &&
- !notStandaloneHandler(handlerArg))
+ parser->m_notStandaloneHandler &&
+ !parser->m_notStandaloneHandler(parser->m_handlerArg))
return XML_ERROR_NOT_STANDALONE;
break;
/* Element declaration stuff */
case XML_ROLE_ELEMENT_NAME:
- if (elementDeclHandler) {
- declElementType = getElementType(parser, enc, s, next);
- if (!declElementType)
+ if (parser->m_elementDeclHandler) {
+ parser->m_declElementType = getElementType(parser, enc, s, next);
+ if (!parser->m_declElementType)
return XML_ERROR_NO_MEMORY;
dtd->scaffLevel = 0;
dtd->scaffCount = 0;
@@ -4624,8 +5164,8 @@ doProlog(XML_Parser parser,
case XML_ROLE_CONTENT_ANY:
case XML_ROLE_CONTENT_EMPTY:
if (dtd->in_eldecl) {
- if (elementDeclHandler) {
- XML_Content * content = (XML_Content *) MALLOC(sizeof(XML_Content));
+ if (parser->m_elementDeclHandler) {
+ XML_Content * content = (XML_Content *) MALLOC(parser, sizeof(XML_Content));
if (!content)
return XML_ERROR_NO_MEMORY;
content->quant = XML_CQUANT_NONE;
@@ -4636,7 +5176,7 @@ doProlog(XML_Parser parser,
XML_CTYPE_ANY :
XML_CTYPE_EMPTY);
*eventEndPP = s;
- elementDeclHandler(handlerArg, declElementType->name, content);
+ parser->m_elementDeclHandler(parser->m_handlerArg, parser->m_declElementType->name, content);
handleDefault = XML_FALSE;
}
dtd->in_eldecl = XML_FALSE;
@@ -4647,7 +5187,7 @@ doProlog(XML_Parser parser,
if (dtd->in_eldecl) {
dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type
= XML_CTYPE_MIXED;
- if (elementDeclHandler)
+ if (parser->m_elementDeclHandler)
handleDefault = XML_FALSE;
}
break;
@@ -4684,7 +5224,7 @@ doProlog(XML_Parser parser,
nameLen = 0;
for (; name[nameLen++]; );
dtd->contentStringLen += nameLen;
- if (elementDeclHandler)
+ if (parser->m_elementDeclHandler)
handleDefault = XML_FALSE;
}
break;
@@ -4702,7 +5242,7 @@ doProlog(XML_Parser parser,
quant = XML_CQUANT_PLUS;
closeGroup:
if (dtd->in_eldecl) {
- if (elementDeclHandler)
+ if (parser->m_elementDeclHandler)
handleDefault = XML_FALSE;
dtd->scaffLevel--;
dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel]].quant = quant;
@@ -4712,7 +5252,7 @@ doProlog(XML_Parser parser,
if (!model)
return XML_ERROR_NO_MEMORY;
*eventEndPP = s;
- elementDeclHandler(handlerArg, declElementType->name, model);
+ parser->m_elementDeclHandler(parser->m_handlerArg, parser->m_declElementType->name, model);
}
dtd->in_eldecl = XML_FALSE;
dtd->contentStringLen = 0;
@@ -4739,31 +5279,31 @@ doProlog(XML_Parser parser,
}
break;
case XML_ROLE_DOCTYPE_NONE:
- if (startDoctypeDeclHandler)
+ if (parser->m_startDoctypeDeclHandler)
handleDefault = XML_FALSE;
break;
case XML_ROLE_ENTITY_NONE:
- if (dtd->keepProcessing && entityDeclHandler)
+ if (dtd->keepProcessing && parser->m_entityDeclHandler)
handleDefault = XML_FALSE;
break;
case XML_ROLE_NOTATION_NONE:
- if (notationDeclHandler)
+ if (parser->m_notationDeclHandler)
handleDefault = XML_FALSE;
break;
case XML_ROLE_ATTLIST_NONE:
- if (dtd->keepProcessing && attlistDeclHandler)
+ if (dtd->keepProcessing && parser->m_attlistDeclHandler)
handleDefault = XML_FALSE;
break;
case XML_ROLE_ELEMENT_NONE:
- if (elementDeclHandler)
+ if (parser->m_elementDeclHandler)
handleDefault = XML_FALSE;
break;
} /* end of big switch */
- if (handleDefault && defaultHandler)
+ if (handleDefault && parser->m_defaultHandler)
reportDefault(parser, enc, s, next);
- switch (ps_parsing) {
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
*nextPtr = next;
return XML_ERROR_NONE;
@@ -4783,18 +5323,18 @@ epilogProcessor(XML_Parser parser,
const char *end,
const char **nextPtr)
{
- processor = epilogProcessor;
- eventPtr = s;
+ parser->m_processor = epilogProcessor;
+ parser->m_eventPtr = s;
for (;;) {
const char *next = NULL;
- int tok = XmlPrologTok(encoding, s, end, &next);
- eventEndPtr = next;
+ int tok = XmlPrologTok(parser->m_encoding, s, end, &next);
+ parser->m_eventEndPtr = next;
switch (tok) {
/* report partial linebreak - it might be the last token */
case -XML_TOK_PROLOG_S:
- if (defaultHandler) {
- reportDefault(parser, encoding, s, next);
- if (ps_parsing == XML_FINISHED)
+ if (parser->m_defaultHandler) {
+ reportDefault(parser, parser->m_encoding, s, next);
+ if (parser->m_parsingStatus.parsing == XML_FINISHED)
return XML_ERROR_ABORTED;
}
*nextPtr = next;
@@ -4803,28 +5343,28 @@ epilogProcessor(XML_Parser parser,
*nextPtr = s;
return XML_ERROR_NONE;
case XML_TOK_PROLOG_S:
- if (defaultHandler)
- reportDefault(parser, encoding, s, next);
+ if (parser->m_defaultHandler)
+ reportDefault(parser, parser->m_encoding, s, next);
break;
case XML_TOK_PI:
- if (!reportProcessingInstruction(parser, encoding, s, next))
+ if (!reportProcessingInstruction(parser, parser->m_encoding, s, next))
return XML_ERROR_NO_MEMORY;
break;
case XML_TOK_COMMENT:
- if (!reportComment(parser, encoding, s, next))
+ if (!reportComment(parser, parser->m_encoding, s, next))
return XML_ERROR_NO_MEMORY;
break;
case XML_TOK_INVALID:
- eventPtr = next;
+ parser->m_eventPtr = next;
return XML_ERROR_INVALID_TOKEN;
case XML_TOK_PARTIAL:
- if (!ps_finalBuffer) {
+ if (!parser->m_parsingStatus.finalBuffer) {
*nextPtr = s;
return XML_ERROR_NONE;
}
return XML_ERROR_UNCLOSED_TOKEN;
case XML_TOK_PARTIAL_CHAR:
- if (!ps_finalBuffer) {
+ if (!parser->m_parsingStatus.finalBuffer) {
*nextPtr = s;
return XML_ERROR_NONE;
}
@@ -4832,8 +5372,8 @@ epilogProcessor(XML_Parser parser,
default:
return XML_ERROR_JUNK_AFTER_DOC_ELEMENT;
}
- eventPtr = s = next;
- switch (ps_parsing) {
+ parser->m_eventPtr = s = next;
+ switch (parser->m_parsingStatus.parsing) {
case XML_SUSPENDED:
*nextPtr = next;
return XML_ERROR_NONE;
@@ -4853,49 +5393,51 @@ processInternalEntity(XML_Parser parser, ENTITY *entity,
enum XML_Error result;
OPEN_INTERNAL_ENTITY *openEntity;
- if (freeInternalEntities) {
- openEntity = freeInternalEntities;
- freeInternalEntities = openEntity->next;
+ if (parser->m_freeInternalEntities) {
+ openEntity = parser->m_freeInternalEntities;
+ parser->m_freeInternalEntities = openEntity->next;
}
else {
- openEntity = (OPEN_INTERNAL_ENTITY *)MALLOC(sizeof(OPEN_INTERNAL_ENTITY));
+ openEntity = (OPEN_INTERNAL_ENTITY *)MALLOC(parser, sizeof(OPEN_INTERNAL_ENTITY));
if (!openEntity)
return XML_ERROR_NO_MEMORY;
}
entity->open = XML_TRUE;
entity->processed = 0;
- openEntity->next = openInternalEntities;
- openInternalEntities = openEntity;
+ openEntity->next = parser->m_openInternalEntities;
+ parser->m_openInternalEntities = openEntity;
openEntity->entity = entity;
- openEntity->startTagLevel = tagLevel;
+ openEntity->startTagLevel = parser->m_tagLevel;
openEntity->betweenDecl = betweenDecl;
openEntity->internalEventPtr = NULL;
openEntity->internalEventEndPtr = NULL;
textStart = (char *)entity->textPtr;
textEnd = (char *)(entity->textPtr + entity->textLen);
+ /* Set a safe default value in case 'next' does not get set */
+ next = textStart;
#ifdef XML_DTD
if (entity->is_param) {
- int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next);
- result = doProlog(parser, internalEncoding, textStart, textEnd, tok,
+ int tok = XmlPrologTok(parser->m_internalEncoding, textStart, textEnd, &next);
+ result = doProlog(parser, parser->m_internalEncoding, textStart, textEnd, tok,
next, &next, XML_FALSE);
}
else
#endif /* XML_DTD */
- result = doContent(parser, tagLevel, internalEncoding, textStart,
+ result = doContent(parser, parser->m_tagLevel, parser->m_internalEncoding, textStart,
textEnd, &next, XML_FALSE);
if (result == XML_ERROR_NONE) {
- if (textEnd != next && ps_parsing == XML_SUSPENDED) {
+ if (textEnd != next && parser->m_parsingStatus.parsing == XML_SUSPENDED) {
entity->processed = (int)(next - textStart);
- processor = internalEntityProcessor;
+ parser->m_processor = internalEntityProcessor;
}
else {
entity->open = XML_FALSE;
- openInternalEntities = openEntity->next;
+ parser->m_openInternalEntities = openEntity->next;
/* put openEntity back in list of free instances */
- openEntity->next = freeInternalEntities;
- freeInternalEntities = openEntity;
+ openEntity->next = parser->m_freeInternalEntities;
+ parser->m_freeInternalEntities = openEntity;
}
}
return result;
@@ -4911,54 +5453,56 @@ internalEntityProcessor(XML_Parser parser,
const char *textStart, *textEnd;
const char *next;
enum XML_Error result;
- OPEN_INTERNAL_ENTITY *openEntity = openInternalEntities;
+ OPEN_INTERNAL_ENTITY *openEntity = parser->m_openInternalEntities;
if (!openEntity)
return XML_ERROR_UNEXPECTED_STATE;
entity = openEntity->entity;
textStart = ((char *)entity->textPtr) + entity->processed;
textEnd = (char *)(entity->textPtr + entity->textLen);
+ /* Set a safe default value in case 'next' does not get set */
+ next = textStart;
#ifdef XML_DTD
if (entity->is_param) {
- int tok = XmlPrologTok(internalEncoding, textStart, textEnd, &next);
- result = doProlog(parser, internalEncoding, textStart, textEnd, tok,
+ int tok = XmlPrologTok(parser->m_internalEncoding, textStart, textEnd, &next);
+ result = doProlog(parser, parser->m_internalEncoding, textStart, textEnd, tok,
next, &next, XML_FALSE);
}
else
#endif /* XML_DTD */
- result = doContent(parser, openEntity->startTagLevel, internalEncoding,
+ result = doContent(parser, openEntity->startTagLevel, parser->m_internalEncoding,
textStart, textEnd, &next, XML_FALSE);
if (result != XML_ERROR_NONE)
return result;
- else if (textEnd != next && ps_parsing == XML_SUSPENDED) {
+ else if (textEnd != next && parser->m_parsingStatus.parsing == XML_SUSPENDED) {
entity->processed = (int)(next - (char *)entity->textPtr);
return result;
}
else {
entity->open = XML_FALSE;
- openInternalEntities = openEntity->next;
+ parser->m_openInternalEntities = openEntity->next;
/* put openEntity back in list of free instances */
- openEntity->next = freeInternalEntities;
- freeInternalEntities = openEntity;
+ openEntity->next = parser->m_freeInternalEntities;
+ parser->m_freeInternalEntities = openEntity;
}
#ifdef XML_DTD
if (entity->is_param) {
int tok;
- processor = prologProcessor;
- tok = XmlPrologTok(encoding, s, end, &next);
- return doProlog(parser, encoding, s, end, tok, next, nextPtr,
- (XML_Bool)!ps_finalBuffer);
+ parser->m_processor = prologProcessor;
+ tok = XmlPrologTok(parser->m_encoding, s, end, &next);
+ return doProlog(parser, parser->m_encoding, s, end, tok, next, nextPtr,
+ (XML_Bool)!parser->m_parsingStatus.finalBuffer);
}
else
#endif /* XML_DTD */
{
- processor = contentProcessor;
+ parser->m_processor = contentProcessor;
/* see externalEntityContentProcessor vs contentProcessor */
- return doContent(parser, parentParser ? 1 : 0, encoding, s, end,
- nextPtr, (XML_Bool)!ps_finalBuffer);
+ return doContent(parser, parser->m_parentParser ? 1 : 0, parser->m_encoding, s, end,
+ nextPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer);
}
}
@@ -4968,7 +5512,7 @@ errorProcessor(XML_Parser parser,
const char *UNUSED_P(end),
const char **UNUSED_P(nextPtr))
{
- return errorCode;
+ return parser->m_errorCode;
}
static enum XML_Error
@@ -4992,7 +5536,7 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
const char *ptr, const char *end,
STRING_POOL *pool)
{
- DTD * const dtd = _dtd; /* save one level of indirection */
+ DTD * const dtd = parser->m_dtd; /* save one level of indirection */
for (;;) {
const char *next;
int tok = XmlAttributeValueTok(enc, ptr, end, &next);
@@ -5000,12 +5544,12 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
case XML_TOK_NONE:
return XML_ERROR_NONE;
case XML_TOK_INVALID:
- if (enc == encoding)
- eventPtr = next;
+ if (enc == parser->m_encoding)
+ parser->m_eventPtr = next;
return XML_ERROR_INVALID_TOKEN;
case XML_TOK_PARTIAL:
- if (enc == encoding)
- eventPtr = ptr;
+ if (enc == parser->m_encoding)
+ parser->m_eventPtr = ptr;
return XML_ERROR_INVALID_TOKEN;
case XML_TOK_CHAR_REF:
{
@@ -5013,8 +5557,8 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
int i;
int n = XmlCharRefNumber(enc, ptr);
if (n < 0) {
- if (enc == encoding)
- eventPtr = ptr;
+ if (enc == parser->m_encoding)
+ parser->m_eventPtr = ptr;
return XML_ERROR_BAD_CHAR_REF;
}
if (!isCdata
@@ -5022,11 +5566,15 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
&& (poolLength(pool) == 0 || poolLastChar(pool) == 0x20))
break;
n = XmlEncode(n, (ICHAR *)buf);
- if (!n) {
- if (enc == encoding)
- eventPtr = ptr;
- return XML_ERROR_BAD_CHAR_REF;
- }
+ /* The XmlEncode() functions can never return 0 here. That
+ * error return happens if the code point passed in is either
+ * negative or greater than or equal to 0x110000. The
+ * XmlCharRefNumber() functions will all return a number
+ * strictly less than 0x110000 or a negative value if an error
+ * occurred. The negative value is intercepted above, so
+ * XmlEncode() is never passed a value it might return an
+ * error for.
+ */
for (i = 0; i < n; i++) {
if (!poolAppendChar(pool, buf[i]))
return XML_ERROR_NO_MEMORY;
@@ -5060,25 +5608,25 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
return XML_ERROR_NO_MEMORY;
break;
}
- name = poolStoreString(&temp2Pool, enc,
+ name = poolStoreString(&parser->m_temp2Pool, enc,
ptr + enc->minBytesPerChar,
next - enc->minBytesPerChar);
if (!name)
return XML_ERROR_NO_MEMORY;
entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0);
- poolDiscard(&temp2Pool);
+ poolDiscard(&parser->m_temp2Pool);
/* First, determine if a check for an existing declaration is needed;
if yes, check that the entity exists, and that it is internal.
*/
if (pool == &dtd->pool) /* are we called from prolog? */
checkEntityDecl =
#ifdef XML_DTD
- prologState.documentEntity &&
+ parser->m_prologState.documentEntity &&
#endif /* XML_DTD */
(dtd->standalone
- ? !openInternalEntities
+ ? !parser->m_openInternalEntities
: !dtd->hasParamEntityRefs);
- else /* if (pool == &tempPool): we are called from content */
+ else /* if (pool == &parser->m_tempPool): we are called from content */
checkEntityDecl = !dtd->hasParamEntityRefs || dtd->standalone;
if (checkEntityDecl) {
if (!entity)
@@ -5088,37 +5636,55 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
}
else if (!entity) {
/* Cannot report skipped entity here - see comments on
- skippedEntityHandler.
- if (skippedEntityHandler)
- skippedEntityHandler(handlerArg, name, 0);
+ parser->m_skippedEntityHandler.
+ if (parser->m_skippedEntityHandler)
+ parser->m_skippedEntityHandler(parser->m_handlerArg, name, 0);
*/
/* Cannot call the default handler because this would be
out of sync with the call to the startElementHandler.
- if ((pool == &tempPool) && defaultHandler)
+ if ((pool == &parser->m_tempPool) && parser->m_defaultHandler)
reportDefault(parser, enc, ptr, next);
*/
break;
}
if (entity->open) {
- if (enc == encoding)
- eventPtr = ptr;
+ if (enc == parser->m_encoding) {
+ /* It does not appear that this line can be executed.
+ *
+ * The "if (entity->open)" check catches recursive entity
+ * definitions. In order to be called with an open
+ * entity, it must have gone through this code before and
+ * been through the recursive call to
+ * appendAttributeValue() some lines below. That call
+ * sets the local encoding ("enc") to the parser's
+ * internal encoding (internal_utf8 or internal_utf16),
+ * which can never be the same as the principle encoding.
+ * It doesn't appear there is another code path that gets
+ * here with entity->open being TRUE.
+ *
+ * Since it is not certain that this logic is watertight,
+ * we keep the line and merely exclude it from coverage
+ * tests.
+ */
+ parser->m_eventPtr = ptr; /* LCOV_EXCL_LINE */
+ }
return XML_ERROR_RECURSIVE_ENTITY_REF;
}
if (entity->notation) {
- if (enc == encoding)
- eventPtr = ptr;
+ if (enc == parser->m_encoding)
+ parser->m_eventPtr = ptr;
return XML_ERROR_BINARY_ENTITY_REF;
}
if (!entity->textPtr) {
- if (enc == encoding)
- eventPtr = ptr;
+ if (enc == parser->m_encoding)
+ parser->m_eventPtr = ptr;
return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF;
}
else {
enum XML_Error result;
const XML_Char *textEnd = entity->textPtr + entity->textLen;
entity->open = XML_TRUE;
- result = appendAttributeValue(parser, internalEncoding, isCdata,
+ result = appendAttributeValue(parser, parser->m_internalEncoding, isCdata,
(char *)entity->textPtr,
(char *)textEnd, pool);
entity->open = XML_FALSE;
@@ -5128,9 +5694,21 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
}
break;
default:
- if (enc == encoding)
- eventPtr = ptr;
+ /* The only token returned by XmlAttributeValueTok() that does
+ * not have an explicit case here is XML_TOK_PARTIAL_CHAR.
+ * Getting that would require an entity name to contain an
+ * incomplete XML character (e.g. \xE2\x82); however previous
+ * tokenisers will have already recognised and rejected such
+ * names before XmlAttributeValueTok() gets a look-in. This
+ * default case should be retained as a safety net, but the code
+ * excluded from coverage tests.
+ *
+ * LCOV_EXCL_START
+ */
+ if (enc == parser->m_encoding)
+ parser->m_eventPtr = ptr;
return XML_ERROR_UNEXPECTED_STATE;
+ /* LCOV_EXCL_STOP */
}
ptr = next;
}
@@ -5143,12 +5721,12 @@ storeEntityValue(XML_Parser parser,
const char *entityTextPtr,
const char *entityTextEnd)
{
- DTD * const dtd = _dtd; /* save one level of indirection */
+ DTD * const dtd = parser->m_dtd; /* save one level of indirection */
STRING_POOL *pool = &(dtd->entityValuePool);
enum XML_Error result = XML_ERROR_NONE;
#ifdef XML_DTD
- int oldInEntityValue = prologState.inEntityValue;
- prologState.inEntityValue = 1;
+ int oldInEntityValue = parser->m_prologState.inEntityValue;
+ parser->m_prologState.inEntityValue = 1;
#endif /* XML_DTD */
/* never return Null for the value argument in EntityDeclHandler,
since this would indicate an external entity; therefore we
@@ -5164,10 +5742,10 @@ storeEntityValue(XML_Parser parser,
switch (tok) {
case XML_TOK_PARAM_ENTITY_REF:
#ifdef XML_DTD
- if (isParamEntity || enc != encoding) {
+ if (parser->m_isParamEntity || enc != parser->m_encoding) {
const XML_Char *name;
ENTITY *entity;
- name = poolStoreString(&tempPool, enc,
+ name = poolStoreString(&parser->m_tempPool, enc,
entityTextPtr + enc->minBytesPerChar,
next - enc->minBytesPerChar);
if (!name) {
@@ -5175,28 +5753,28 @@ storeEntityValue(XML_Parser parser,
goto endEntityValue;
}
entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0);
- poolDiscard(&tempPool);
+ poolDiscard(&parser->m_tempPool);
if (!entity) {
/* not a well-formedness error - see XML 1.0: WFC Entity Declared */
/* cannot report skipped entity here - see comments on
- skippedEntityHandler
- if (skippedEntityHandler)
- skippedEntityHandler(handlerArg, name, 0);
+ parser->m_skippedEntityHandler
+ if (parser->m_skippedEntityHandler)
+ parser->m_skippedEntityHandler(parser->m_handlerArg, name, 0);
*/
dtd->keepProcessing = dtd->standalone;
goto endEntityValue;
}
if (entity->open) {
- if (enc == encoding)
- eventPtr = entityTextPtr;
+ if (enc == parser->m_encoding)
+ parser->m_eventPtr = entityTextPtr;
result = XML_ERROR_RECURSIVE_ENTITY_REF;
goto endEntityValue;
}
if (entity->systemId) {
- if (externalEntityRefHandler) {
+ if (parser->m_externalEntityRefHandler) {
dtd->paramEntityRead = XML_FALSE;
entity->open = XML_TRUE;
- if (!externalEntityRefHandler(externalEntityRefHandlerArg,
+ if (!parser->m_externalEntityRefHandler(parser->m_externalEntityRefHandlerArg,
0,
entity->base,
entity->systemId,
@@ -5215,7 +5793,7 @@ storeEntityValue(XML_Parser parser,
else {
entity->open = XML_TRUE;
result = storeEntityValue(parser,
- internalEncoding,
+ parser->m_internalEncoding,
(char *)entity->textPtr,
(char *)(entity->textPtr
+ entity->textLen));
@@ -5228,7 +5806,7 @@ storeEntityValue(XML_Parser parser,
#endif /* XML_DTD */
/* In the internal subset, PE references are not legal
within markup declarations, e.g entity values in this case. */
- eventPtr = entityTextPtr;
+ parser->m_eventPtr = entityTextPtr;
result = XML_ERROR_PARAM_ENTITY_REF;
goto endEntityValue;
case XML_TOK_NONE:
@@ -5257,18 +5835,21 @@ storeEntityValue(XML_Parser parser,
int i;
int n = XmlCharRefNumber(enc, entityTextPtr);
if (n < 0) {
- if (enc == encoding)
- eventPtr = entityTextPtr;
+ if (enc == parser->m_encoding)
+ parser->m_eventPtr = entityTextPtr;
result = XML_ERROR_BAD_CHAR_REF;
goto endEntityValue;
}
n = XmlEncode(n, (ICHAR *)buf);
- if (!n) {
- if (enc == encoding)
- eventPtr = entityTextPtr;
- result = XML_ERROR_BAD_CHAR_REF;
- goto endEntityValue;
- }
+ /* The XmlEncode() functions can never return 0 here. That
+ * error return happens if the code point passed in is either
+ * negative or greater than or equal to 0x110000. The
+ * XmlCharRefNumber() functions will all return a number
+ * strictly less than 0x110000 or a negative value if an error
+ * occurred. The negative value is intercepted above, so
+ * XmlEncode() is never passed a value it might return an
+ * error for.
+ */
for (i = 0; i < n; i++) {
if (pool->end == pool->ptr && !poolGrow(pool)) {
result = XML_ERROR_NO_MEMORY;
@@ -5279,26 +5860,34 @@ storeEntityValue(XML_Parser parser,
}
break;
case XML_TOK_PARTIAL:
- if (enc == encoding)
- eventPtr = entityTextPtr;
+ if (enc == parser->m_encoding)
+ parser->m_eventPtr = entityTextPtr;
result = XML_ERROR_INVALID_TOKEN;
goto endEntityValue;
case XML_TOK_INVALID:
- if (enc == encoding)
- eventPtr = next;
+ if (enc == parser->m_encoding)
+ parser->m_eventPtr = next;
result = XML_ERROR_INVALID_TOKEN;
goto endEntityValue;
default:
- if (enc == encoding)
- eventPtr = entityTextPtr;
+ /* This default case should be unnecessary -- all the tokens
+ * that XmlEntityValueTok() can return have their own explicit
+ * cases -- but should be retained for safety. We do however
+ * exclude it from the coverage statistics.
+ *
+ * LCOV_EXCL_START
+ */
+ if (enc == parser->m_encoding)
+ parser->m_eventPtr = entityTextPtr;
result = XML_ERROR_UNEXPECTED_STATE;
goto endEntityValue;
+ /* LCOV_EXCL_STOP */
}
entityTextPtr = next;
}
endEntityValue:
#ifdef XML_DTD
- prologState.inEntityValue = oldInEntityValue;
+ parser->m_prologState.inEntityValue = oldInEntityValue;
#endif /* XML_DTD */
return result;
}
@@ -5333,25 +5922,25 @@ reportProcessingInstruction(XML_Parser parser, const ENCODING *enc,
const XML_Char *target;
XML_Char *data;
const char *tem;
- if (!processingInstructionHandler) {
- if (defaultHandler)
+ if (!parser->m_processingInstructionHandler) {
+ if (parser->m_defaultHandler)
reportDefault(parser, enc, start, end);
return 1;
}
start += enc->minBytesPerChar * 2;
tem = start + XmlNameLength(enc, start);
- target = poolStoreString(&tempPool, enc, start, tem);
+ target = poolStoreString(&parser->m_tempPool, enc, start, tem);
if (!target)
return 0;
- poolFinish(&tempPool);
- data = poolStoreString(&tempPool, enc,
+ poolFinish(&parser->m_tempPool);
+ data = poolStoreString(&parser->m_tempPool, enc,
XmlSkipS(enc, tem),
end - enc->minBytesPerChar*2);
if (!data)
return 0;
normalizeLines(data);
- processingInstructionHandler(handlerArg, target, data);
- poolClear(&tempPool);
+ parser->m_processingInstructionHandler(parser->m_handlerArg, target, data);
+ poolClear(&parser->m_tempPool);
return 1;
}
@@ -5360,20 +5949,20 @@ reportComment(XML_Parser parser, const ENCODING *enc,
const char *start, const char *end)
{
XML_Char *data;
- if (!commentHandler) {
- if (defaultHandler)
+ if (!parser->m_commentHandler) {
+ if (parser->m_defaultHandler)
reportDefault(parser, enc, start, end);
return 1;
}
- data = poolStoreString(&tempPool,
+ data = poolStoreString(&parser->m_tempPool,
enc,
start + enc->minBytesPerChar * 4,
end - enc->minBytesPerChar * 3);
if (!data)
return 0;
normalizeLines(data);
- commentHandler(handlerArg, data);
- poolClear(&tempPool);
+ parser->m_commentHandler(parser->m_handlerArg, data);
+ poolClear(&parser->m_tempPool);
return 1;
}
@@ -5385,24 +5974,41 @@ reportDefault(XML_Parser parser, const ENCODING *enc,
enum XML_Convert_Result convert_res;
const char **eventPP;
const char **eventEndPP;
- if (enc == encoding) {
- eventPP = &eventPtr;
- eventEndPP = &eventEndPtr;
+ if (enc == parser->m_encoding) {
+ eventPP = &parser->m_eventPtr;
+ eventEndPP = &parser->m_eventEndPtr;
}
else {
- eventPP = &(openInternalEntities->internalEventPtr);
- eventEndPP = &(openInternalEntities->internalEventEndPtr);
+ /* To get here, two things must be true; the parser must be
+ * using a character encoding that is not the same as the
+ * encoding passed in, and the encoding passed in must need
+ * conversion to the internal format (UTF-8 unless XML_UNICODE
+ * is defined). The only occasions on which the encoding passed
+ * in is not the same as the parser's encoding are when it is
+ * the internal encoding (e.g. a previously defined parameter
+ * entity, already converted to internal format). This by
+ * definition doesn't need conversion, so the whole branch never
+ * gets executed.
+ *
+ * For safety's sake we don't delete these lines and merely
+ * exclude them from coverage statistics.
+ *
+ * LCOV_EXCL_START
+ */
+ eventPP = &(parser->m_openInternalEntities->internalEventPtr);
+ eventEndPP = &(parser->m_openInternalEntities->internalEventEndPtr);
+ /* LCOV_EXCL_STOP */
}
do {
- ICHAR *dataPtr = (ICHAR *)dataBuf;
- convert_res = XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd);
+ ICHAR *dataPtr = (ICHAR *)parser->m_dataBuf;
+ convert_res = XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)parser->m_dataBufEnd);
*eventEndPP = s;
- defaultHandler(handlerArg, dataBuf, (int)(dataPtr - (ICHAR *)dataBuf));
+ parser->m_defaultHandler(parser->m_handlerArg, parser->m_dataBuf, (int)(dataPtr - (ICHAR *)parser->m_dataBuf));
*eventPP = s;
} while ((convert_res != XML_CONVERT_COMPLETED) && (convert_res != XML_CONVERT_INPUT_INCOMPLETE));
}
else
- defaultHandler(handlerArg, (XML_Char *)s, (int)((XML_Char *)end - (XML_Char *)s));
+ parser->m_defaultHandler(parser->m_handlerArg, (XML_Char *)s, (int)((XML_Char *)end - (XML_Char *)s));
}
@@ -5424,16 +6030,18 @@ defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, XML_Bool isCdata,
if (type->nDefaultAtts == type->allocDefaultAtts) {
if (type->allocDefaultAtts == 0) {
type->allocDefaultAtts = 8;
- type->defaultAtts = (DEFAULT_ATTRIBUTE *)MALLOC(type->allocDefaultAtts
+ type->defaultAtts = (DEFAULT_ATTRIBUTE *)MALLOC(parser, type->allocDefaultAtts
* sizeof(DEFAULT_ATTRIBUTE));
- if (!type->defaultAtts)
+ if (!type->defaultAtts) {
+ type->allocDefaultAtts = 0;
return 0;
+ }
}
else {
DEFAULT_ATTRIBUTE *temp;
int count = type->allocDefaultAtts * 2;
temp = (DEFAULT_ATTRIBUTE *)
- REALLOC(type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE)));
+ REALLOC(parser, type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE)));
if (temp == NULL)
return 0;
type->allocDefaultAtts = count;
@@ -5453,7 +6061,7 @@ defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *attId, XML_Bool isCdata,
static int
setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType)
{
- DTD * const dtd = _dtd; /* save one level of indirection */
+ DTD * const dtd = parser->m_dtd; /* save one level of indirection */
const XML_Char *name;
for (name = elementType->name; *name; name++) {
if (*name == XML_T(ASCII_COLON)) {
@@ -5484,7 +6092,7 @@ static ATTRIBUTE_ID *
getAttributeId(XML_Parser parser, const ENCODING *enc,
const char *start, const char *end)
{
- DTD * const dtd = _dtd; /* save one level of indirection */
+ DTD * const dtd = parser->m_dtd; /* save one level of indirection */
ATTRIBUTE_ID *id;
const XML_Char *name;
if (!poolAppendChar(&dtd->pool, XML_T('\0')))
@@ -5501,7 +6109,7 @@ getAttributeId(XML_Parser parser, const ENCODING *enc,
poolDiscard(&dtd->pool);
else {
poolFinish(&dtd->pool);
- if (!ns)
+ if (!parser->m_ns)
;
else if (name[0] == XML_T(ASCII_x)
&& name[1] == XML_T(ASCII_m)
@@ -5548,21 +6156,42 @@ getAttributeId(XML_Parser parser, const ENCODING *enc,
static const XML_Char *
getContext(XML_Parser parser)
{
- DTD * const dtd = _dtd; /* save one level of indirection */
+ DTD * const dtd = parser->m_dtd; /* save one level of indirection */
HASH_TABLE_ITER iter;
XML_Bool needSep = XML_FALSE;
if (dtd->defaultPrefix.binding) {
int i;
int len;
- if (!poolAppendChar(&tempPool, XML_T(ASCII_EQUALS)))
+ if (!poolAppendChar(&parser->m_tempPool, XML_T(ASCII_EQUALS)))
return NULL;
len = dtd->defaultPrefix.binding->uriLen;
- if (namespaceSeparator)
+ if (parser->m_namespaceSeparator)
len--;
- for (i = 0; i < len; i++)
- if (!poolAppendChar(&tempPool, dtd->defaultPrefix.binding->uri[i]))
- return NULL;
+ for (i = 0; i < len; i++) {
+ if (!poolAppendChar(&parser->m_tempPool, dtd->defaultPrefix.binding->uri[i])) {
+ /* Because of memory caching, I don't believe this line can be
+ * executed.
+ *
+ * This is part of a loop copying the default prefix binding
+ * URI into the parser's temporary string pool. Previously,
+ * that URI was copied into the same string pool, with a
+ * terminating NUL character, as part of setContext(). When
+ * the pool was cleared, that leaves a block definitely big
+ * enough to hold the URI on the free block list of the pool.
+ * The URI copy in getContext() therefore cannot run out of
+ * memory.
+ *
+ * If the pool is used between the setContext() and
+ * getContext() calls, the worst it can do is leave a bigger
+ * block on the front of the free list. Given that this is
+ * all somewhat inobvious and program logic can be changed, we
+ * don't delete the line but we do exclude it from the test
+ * coverage statistics.
+ */
+ return NULL; /* LCOV_EXCL_LINE */
+ }
+ }
needSep = XML_TRUE;
}
@@ -5574,20 +6203,27 @@ getContext(XML_Parser parser)
PREFIX *prefix = (PREFIX *)hashTableIterNext(&iter);
if (!prefix)
break;
- if (!prefix->binding)
- continue;
- if (needSep && !poolAppendChar(&tempPool, CONTEXT_SEP))
+ if (!prefix->binding) {
+ /* This test appears to be (justifiable) paranoia. There does
+ * not seem to be a way of injecting a prefix without a binding
+ * that doesn't get errored long before this function is called.
+ * The test should remain for safety's sake, so we instead
+ * exclude the following line from the coverage statistics.
+ */
+ continue; /* LCOV_EXCL_LINE */
+ }
+ if (needSep && !poolAppendChar(&parser->m_tempPool, CONTEXT_SEP))
return NULL;
for (s = prefix->name; *s; s++)
- if (!poolAppendChar(&tempPool, *s))
+ if (!poolAppendChar(&parser->m_tempPool, *s))
return NULL;
- if (!poolAppendChar(&tempPool, XML_T(ASCII_EQUALS)))
+ if (!poolAppendChar(&parser->m_tempPool, XML_T(ASCII_EQUALS)))
return NULL;
len = prefix->binding->uriLen;
- if (namespaceSeparator)
+ if (parser->m_namespaceSeparator)
len--;
for (i = 0; i < len; i++)
- if (!poolAppendChar(&tempPool, prefix->binding->uri[i]))
+ if (!poolAppendChar(&parser->m_tempPool, prefix->binding->uri[i]))
return NULL;
needSep = XML_TRUE;
}
@@ -5601,73 +6237,73 @@ getContext(XML_Parser parser)
break;
if (!e->open)
continue;
- if (needSep && !poolAppendChar(&tempPool, CONTEXT_SEP))
+ if (needSep && !poolAppendChar(&parser->m_tempPool, CONTEXT_SEP))
return NULL;
for (s = e->name; *s; s++)
- if (!poolAppendChar(&tempPool, *s))
+ if (!poolAppendChar(&parser->m_tempPool, *s))
return 0;
needSep = XML_TRUE;
}
- if (!poolAppendChar(&tempPool, XML_T('\0')))
+ if (!poolAppendChar(&parser->m_tempPool, XML_T('\0')))
return NULL;
- return tempPool.start;
+ return parser->m_tempPool.start;
}
static XML_Bool
setContext(XML_Parser parser, const XML_Char *context)
{
- DTD * const dtd = _dtd; /* save one level of indirection */
+ DTD * const dtd = parser->m_dtd; /* save one level of indirection */
const XML_Char *s = context;
while (*context != XML_T('\0')) {
if (*s == CONTEXT_SEP || *s == XML_T('\0')) {
ENTITY *e;
- if (!poolAppendChar(&tempPool, XML_T('\0')))
+ if (!poolAppendChar(&parser->m_tempPool, XML_T('\0')))
return XML_FALSE;
- e = (ENTITY *)lookup(parser, &dtd->generalEntities, poolStart(&tempPool), 0);
+ e = (ENTITY *)lookup(parser, &dtd->generalEntities, poolStart(&parser->m_tempPool), 0);
if (e)
e->open = XML_TRUE;
if (*s != XML_T('\0'))
s++;
context = s;
- poolDiscard(&tempPool);
+ poolDiscard(&parser->m_tempPool);
}
else if (*s == XML_T(ASCII_EQUALS)) {
PREFIX *prefix;
- if (poolLength(&tempPool) == 0)
+ if (poolLength(&parser->m_tempPool) == 0)
prefix = &dtd->defaultPrefix;
else {
- if (!poolAppendChar(&tempPool, XML_T('\0')))
+ if (!poolAppendChar(&parser->m_tempPool, XML_T('\0')))
return XML_FALSE;
- prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&tempPool),
+ prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&parser->m_tempPool),
sizeof(PREFIX));
if (!prefix)
return XML_FALSE;
- if (prefix->name == poolStart(&tempPool)) {
+ if (prefix->name == poolStart(&parser->m_tempPool)) {
prefix->name = poolCopyString(&dtd->pool, prefix->name);
if (!prefix->name)
return XML_FALSE;
}
- poolDiscard(&tempPool);
+ poolDiscard(&parser->m_tempPool);
}
for (context = s + 1;
*context != CONTEXT_SEP && *context != XML_T('\0');
context++)
- if (!poolAppendChar(&tempPool, *context))
+ if (!poolAppendChar(&parser->m_tempPool, *context))
return XML_FALSE;
- if (!poolAppendChar(&tempPool, XML_T('\0')))
+ if (!poolAppendChar(&parser->m_tempPool, XML_T('\0')))
return XML_FALSE;
- if (addBinding(parser, prefix, NULL, poolStart(&tempPool),
- &inheritedBindings) != XML_ERROR_NONE)
+ if (addBinding(parser, prefix, NULL, poolStart(&parser->m_tempPool),
+ &parser->m_inheritedBindings) != XML_ERROR_NONE)
return XML_FALSE;
- poolDiscard(&tempPool);
+ poolDiscard(&parser->m_tempPool);
if (*context != XML_T('\0'))
++context;
s = context;
}
else {
- if (!poolAppendChar(&tempPool, *s))
+ if (!poolAppendChar(&parser->m_tempPool, *s))
return XML_FALSE;
s++;
}
@@ -5878,7 +6514,6 @@ dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, const XML_Memory_H
newE->defaultAtts = (DEFAULT_ATTRIBUTE *)
ms->malloc_fcn(oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));
if (!newE->defaultAtts) {
- ms->free_fcn(newE);
return 0;
}
}
@@ -6013,13 +6648,31 @@ keyeq(KEY s1, KEY s2)
return XML_FALSE;
}
+static size_t
+keylen(KEY s)
+{
+ size_t len = 0;
+ for (; *s; s++, len++);
+ return len;
+}
+
+static void
+copy_salt_to_sipkey(XML_Parser parser, struct sipkey * key)
+{
+ key->k[0] = 0;
+ key->k[1] = get_hash_secret_salt(parser);
+}
+
static unsigned long FASTCALL
hash(XML_Parser parser, KEY s)
{
- unsigned long h = hash_secret_salt;
- while (*s)
- h = CHAR_HASH(h, *s++);
- return h;
+ struct siphash state;
+ struct sipkey key;
+ (void)sip24_valid;
+ copy_salt_to_sipkey(parser, &key);
+ sip24_init(&state, &key);
+ sip24_update(&state, s, keylen(s) * sizeof(XML_Char));
+ return (unsigned long)sip24_final(&state);
}
static NAMED *
@@ -6228,8 +6881,20 @@ poolCopyString(STRING_POOL *pool, const XML_Char *s)
static const XML_Char *
poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n)
{
- if (!pool->ptr && !poolGrow(pool))
- return NULL;
+ if (!pool->ptr && !poolGrow(pool)) {
+ /* The following line is unreachable given the current usage of
+ * poolCopyStringN(). Currently it is called from exactly one
+ * place to copy the text of a simple general entity. By that
+ * point, the name of the entity is already stored in the pool, so
+ * pool->ptr cannot be NULL.
+ *
+ * If poolCopyStringN() is used elsewhere as it well might be,
+ * this line may well become executable again. Regardless, this
+ * sort of check shouldn't be removed lightly, so we just exclude
+ * it from the coverage statistics.
+ */
+ return NULL; /* LCOV_EXCL_LINE */
+ }
for (; n > 0; --n, s++) {
if (!poolAppendChar(pool, *s))
return NULL;
@@ -6262,6 +6927,35 @@ poolStoreString(STRING_POOL *pool, const ENCODING *enc,
return pool->start;
}
+static size_t
+poolBytesToAllocateFor(int blockSize)
+{
+ /* Unprotected math would be:
+ ** return offsetof(BLOCK, s) + blockSize * sizeof(XML_Char);
+ **
+ ** Detect overflow, avoiding _signed_ overflow undefined behavior
+ ** For a + b * c we check b * c in isolation first, so that addition of a
+ ** on top has no chance of making us accept a small non-negative number
+ */
+ const size_t stretch = sizeof(XML_Char); /* can be 4 bytes */
+
+ if (blockSize <= 0)
+ return 0;
+
+ if (blockSize > (int)(INT_MAX / stretch))
+ return 0;
+
+ {
+ const int stretchedBlockSize = blockSize * (int)stretch;
+ const int bytesToAllocate = (int)(
+ offsetof(BLOCK, s) + (unsigned)stretchedBlockSize);
+ if (bytesToAllocate < 0)
+ return 0;
+
+ return (size_t)bytesToAllocate;
+ }
+}
+
static XML_Bool FASTCALL
poolGrow(STRING_POOL *pool)
{
@@ -6291,35 +6985,69 @@ poolGrow(STRING_POOL *pool)
if (pool->blocks && pool->start == pool->blocks->s) {
BLOCK *temp;
int blockSize = (int)((unsigned)(pool->end - pool->start)*2U);
+ size_t bytesToAllocate;
+
+ /* NOTE: Needs to be calculated prior to calling `realloc`
+ to avoid dangling pointers: */
+ const ptrdiff_t offsetInsideBlock = pool->ptr - pool->start;
+
+ if (blockSize < 0) {
+ /* This condition traps a situation where either more than
+ * INT_MAX/2 bytes have already been allocated. This isn't
+ * readily testable, since it is unlikely that an average
+ * machine will have that much memory, so we exclude it from the
+ * coverage statistics.
+ */
+ return XML_FALSE; /* LCOV_EXCL_LINE */
+ }
- if (blockSize < 0)
+ bytesToAllocate = poolBytesToAllocateFor(blockSize);
+ if (bytesToAllocate == 0)
return XML_FALSE;
temp = (BLOCK *)
- pool->mem->realloc_fcn(pool->blocks,
- (offsetof(BLOCK, s)
- + blockSize * sizeof(XML_Char)));
+ pool->mem->realloc_fcn(pool->blocks, (unsigned)bytesToAllocate);
if (temp == NULL)
return XML_FALSE;
pool->blocks = temp;
pool->blocks->size = blockSize;
- pool->ptr = pool->blocks->s + (pool->ptr - pool->start);
+ pool->ptr = pool->blocks->s + offsetInsideBlock;
pool->start = pool->blocks->s;
pool->end = pool->start + blockSize;
}
else {
BLOCK *tem;
int blockSize = (int)(pool->end - pool->start);
-
- if (blockSize < 0)
- return XML_FALSE;
+ size_t bytesToAllocate;
+
+ if (blockSize < 0) {
+ /* This condition traps a situation where either more than
+ * INT_MAX bytes have already been allocated (which is prevented
+ * by various pieces of program logic, not least this one, never
+ * mind the unlikelihood of actually having that much memory) or
+ * the pool control fields have been corrupted (which could
+ * conceivably happen in an extremely buggy user handler
+ * function). Either way it isn't readily testable, so we
+ * exclude it from the coverage statistics.
+ */
+ return XML_FALSE; /* LCOV_EXCL_LINE */
+ }
if (blockSize < INIT_BLOCK_SIZE)
blockSize = INIT_BLOCK_SIZE;
- else
+ else {
+ /* Detect overflow, avoiding _signed_ overflow undefined behavior */
+ if ((int)((unsigned)blockSize * 2U) < 0) {
+ return XML_FALSE;
+ }
blockSize *= 2;
- tem = (BLOCK *)pool->mem->malloc_fcn(offsetof(BLOCK, s)
- + blockSize * sizeof(XML_Char));
+ }
+
+ bytesToAllocate = poolBytesToAllocateFor(blockSize);
+ if (bytesToAllocate == 0)
+ return XML_FALSE;
+
+ tem = (BLOCK *)pool->mem->malloc_fcn(bytesToAllocate);
if (!tem)
return XML_FALSE;
tem->size = blockSize;
@@ -6338,12 +7066,12 @@ poolGrow(STRING_POOL *pool)
static int FASTCALL
nextScaffoldPart(XML_Parser parser)
{
- DTD * const dtd = _dtd; /* save one level of indirection */
+ DTD * const dtd = parser->m_dtd; /* save one level of indirection */
CONTENT_SCAFFOLD * me;
int next;
if (!dtd->scaffIndex) {
- dtd->scaffIndex = (int *)MALLOC(groupSize * sizeof(int));
+ dtd->scaffIndex = (int *)MALLOC(parser, parser->m_groupSize * sizeof(int));
if (!dtd->scaffIndex)
return -1;
dtd->scaffIndex[0] = 0;
@@ -6353,13 +7081,13 @@ nextScaffoldPart(XML_Parser parser)
CONTENT_SCAFFOLD *temp;
if (dtd->scaffold) {
temp = (CONTENT_SCAFFOLD *)
- REALLOC(dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD));
+ REALLOC(parser, dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD));
if (temp == NULL)
return -1;
dtd->scaffSize *= 2;
}
else {
- temp = (CONTENT_SCAFFOLD *)MALLOC(INIT_SCAFFOLD_ELEMENTS
+ temp = (CONTENT_SCAFFOLD *)MALLOC(parser, INIT_SCAFFOLD_ELEMENTS
* sizeof(CONTENT_SCAFFOLD));
if (temp == NULL)
return -1;
@@ -6390,7 +7118,7 @@ build_node(XML_Parser parser,
XML_Content **contpos,
XML_Char **strpos)
{
- DTD * const dtd = _dtd; /* save one level of indirection */
+ DTD * const dtd = parser->m_dtd; /* save one level of indirection */
dest->type = dtd->scaffold[src_node].type;
dest->quant = dtd->scaffold[src_node].quant;
if (dest->type == XML_CTYPE_NAME) {
@@ -6424,14 +7152,14 @@ build_node(XML_Parser parser,
static XML_Content *
build_model (XML_Parser parser)
{
- DTD * const dtd = _dtd; /* save one level of indirection */
+ DTD * const dtd = parser->m_dtd; /* save one level of indirection */
XML_Content *ret;
XML_Content *cpos;
XML_Char * str;
int allocsize = (dtd->scaffCount * sizeof(XML_Content)
+ (dtd->contentStringLen * sizeof(XML_Char)));
- ret = (XML_Content *)MALLOC(allocsize);
+ ret = (XML_Content *)MALLOC(parser, allocsize);
if (!ret)
return NULL;
@@ -6448,7 +7176,7 @@ getElementType(XML_Parser parser,
const char *ptr,
const char *end)
{
- DTD * const dtd = _dtd; /* save one level of indirection */
+ DTD * const dtd = parser->m_dtd; /* save one level of indirection */
const XML_Char *name = poolStoreString(&dtd->pool, enc, ptr, end);
ELEMENT_TYPE *ret;
@@ -6466,3 +7194,26 @@ getElementType(XML_Parser parser,
}
return ret;
}
+
+static XML_Char *
+copyString(const XML_Char *s,
+ const XML_Memory_Handling_Suite *memsuite)
+{
+ int charsRequired = 0;
+ XML_Char *result;
+
+ /* First determine how long the string is */
+ while (s[charsRequired] != 0) {
+ charsRequired++;
+ }
+ /* Include the terminator */
+ charsRequired++;
+
+ /* Now allocate space for the copy */
+ result = memsuite->malloc_fcn(charsRequired * sizeof(XML_Char));
+ if (result == NULL)
+ return NULL;
+ /* Copy the original into place */
+ memcpy(result, s, charsRequired * sizeof(XML_Char));
+ return result;
+}
diff --git a/freebsd/contrib/expat/lib/xmlrole.c b/freebsd/contrib/expat/lib/xmlrole.c
index 3accd40d..8150e51a 100644
--- a/freebsd/contrib/expat/lib/xmlrole.c
+++ b/freebsd/contrib/expat/lib/xmlrole.c
@@ -1,24 +1,46 @@
#include <machine/rtems-bsd-user-space.h>
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stddef.h>
-#ifdef WIN32
+#ifdef _WIN32
#include "winconfig.h"
-#elif defined(MACOS_CLASSIC)
-#include "macconfig.h"
-#elif defined(__amigaos__)
-#include "amigaconfig.h"
-#elif defined(__WATCOMC__)
-#include "watcomconfig.h"
#else
#ifdef HAVE_EXPAT_CONFIG_H
#include <expat_config.h>
#endif
-#endif /* ndef WIN32 */
+#endif /* ndef _WIN32 */
#include "expat_external.h"
#include "internal.h"
@@ -178,7 +200,14 @@ prolog1(PROLOG_STATE *state,
case XML_TOK_COMMENT:
return XML_ROLE_COMMENT;
case XML_TOK_BOM:
- return XML_ROLE_NONE;
+ /* This case can never arise. To reach this role function, the
+ * parse must have passed through prolog0 and therefore have had
+ * some form of input, even if only a space. At that point, a
+ * byte order mark is no longer a valid character (though
+ * technically it should be interpreted as a non-breaking space),
+ * so will be rejected by the tokenizing stages.
+ */
+ return XML_ROLE_NONE; /* LCOV_EXCL_LINE */
case XML_TOK_DECL_OPEN:
if (!XmlNameMatchesAscii(enc,
ptr + 2 * MIN_BYTES_PER_CHAR(enc),
@@ -1293,6 +1322,26 @@ declClose(PROLOG_STATE *state,
return common(state, tok);
}
+/* This function will only be invoked if the internal logic of the
+ * parser has broken down. It is used in two cases:
+ *
+ * 1: When the XML prolog has been finished. At this point the
+ * processor (the parser level above these role handlers) should
+ * switch from prologProcessor to contentProcessor and reinitialise
+ * the handler function.
+ *
+ * 2: When an error has been detected (via common() below). At this
+ * point again the processor should be switched to errorProcessor,
+ * which will never call a handler.
+ *
+ * The result of this is that error() can only be called if the
+ * processor switch failed to happen, which is an internal error and
+ * therefore we shouldn't be able to provoke it simply by using the
+ * library. It is a necessary backstop, however, so we merely exclude
+ * it from the coverage statistics.
+ *
+ * LCOV_EXCL_START
+ */
static int PTRCALL
error(PROLOG_STATE *UNUSED_P(state),
int UNUSED_P(tok),
@@ -1302,6 +1351,7 @@ error(PROLOG_STATE *UNUSED_P(state),
{
return XML_ROLE_NONE;
}
+/* LCOV_EXCL_STOP */
static int FASTCALL
common(PROLOG_STATE *state, int tok)
diff --git a/freebsd/contrib/expat/lib/xmlrole.h b/freebsd/contrib/expat/lib/xmlrole.h
index 4dd9f06f..e5f048ea 100644
--- a/freebsd/contrib/expat/lib/xmlrole.h
+++ b/freebsd/contrib/expat/lib/xmlrole.h
@@ -1,5 +1,33 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef XmlRole_INCLUDED
diff --git a/freebsd/contrib/expat/lib/xmltok.c b/freebsd/contrib/expat/lib/xmltok.c
index fe9d3450..df66808c 100644
--- a/freebsd/contrib/expat/lib/xmltok.c
+++ b/freebsd/contrib/expat/lib/xmltok.c
@@ -1,24 +1,57 @@
#include <machine/rtems-bsd-user-space.h>
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stddef.h>
+#include <string.h> /* memcpy */
-#ifdef WIN32
+#if defined(_MSC_VER) && (_MSC_VER <= 1700)
+ /* for vs2012/11.0/1700 and earlier Visual Studio compilers */
+# define bool int
+# define false 0
+# define true 1
+#else
+# include <stdbool.h>
+#endif
+
+
+#ifdef _WIN32
#include "winconfig.h"
-#elif defined(MACOS_CLASSIC)
-#include "macconfig.h"
-#elif defined(__amigaos__)
-#include "amigaconfig.h"
-#elif defined(__WATCOMC__)
-#include "watcomconfig.h"
#else
#ifdef HAVE_EXPAT_CONFIG_H
#include <expat_config.h>
#endif
-#endif /* ndef WIN32 */
+#endif /* ndef _WIN32 */
#include "expat_external.h"
#include "internal.h"
@@ -35,7 +68,6 @@
{ PREFIX(prologTok), PREFIX(contentTok), \
PREFIX(cdataSectionTok) IGNORE_SECTION_TOK_VTABLE }, \
{ PREFIX(attributeValueTok), PREFIX(entityValueTok) }, \
- PREFIX(sameName), \
PREFIX(nameMatchesAscii), \
PREFIX(nameLength), \
PREFIX(skipS), \
@@ -332,7 +364,7 @@ enum { /* UTF8_cvalN is value of masked first byte of N byte sequence */
};
void
-align_limit_to_full_utf8_characters(const char * from, const char ** fromLimRef)
+_INTERNAL_trim_to_complete_utf8_characters(const char * from, const char ** fromLimRef)
{
const char * fromLim = *fromLimRef;
size_t walked = 0;
@@ -371,24 +403,39 @@ utf8_toUtf8(const ENCODING *UNUSED_P(enc),
const char **fromP, const char *fromLim,
char **toP, const char *toLim)
{
- enum XML_Convert_Result res = XML_CONVERT_COMPLETED;
- char *to;
- const char *from;
- if (fromLim - *fromP > toLim - *toP) {
- /* Avoid copying partial characters. */
- res = XML_CONVERT_OUTPUT_EXHAUSTED;
- fromLim = *fromP + (toLim - *toP);
- align_limit_to_full_utf8_characters(*fromP, &fromLim);
+ bool input_incomplete = false;
+ bool output_exhausted = false;
+
+ /* Avoid copying partial characters (due to limited space). */
+ const ptrdiff_t bytesAvailable = fromLim - *fromP;
+ const ptrdiff_t bytesStorable = toLim - *toP;
+ if (bytesAvailable > bytesStorable) {
+ fromLim = *fromP + bytesStorable;
+ output_exhausted = true;
+ }
+
+ /* Avoid copying partial characters (from incomplete input). */
+ {
+ const char * const fromLimBefore = fromLim;
+ _INTERNAL_trim_to_complete_utf8_characters(*fromP, &fromLim);
+ if (fromLim < fromLimBefore) {
+ input_incomplete = true;
+ }
+ }
+
+ {
+ const ptrdiff_t bytesToCopy = fromLim - *fromP;
+ memcpy(*toP, *fromP, bytesToCopy);
+ *fromP += bytesToCopy;
+ *toP += bytesToCopy;
}
- for (to = *toP, from = *fromP; (from < fromLim) && (to < toLim); from++, to++)
- *to = *from;
- *fromP = from;
- *toP = to;
- if ((to == toLim) && (from < fromLim))
+ if (output_exhausted) /* needs to go first */
return XML_CONVERT_OUTPUT_EXHAUSTED;
+ else if (input_incomplete)
+ return XML_CONVERT_INPUT_INCOMPLETE;
else
- return res;
+ return XML_CONVERT_COMPLETED;
}
static enum XML_Convert_Result PTRCALL
@@ -404,7 +451,7 @@ utf8_toUtf16(const ENCODING *enc,
case BT_LEAD2:
if (fromLim - from < 2) {
res = XML_CONVERT_INPUT_INCOMPLETE;
- break;
+ goto after;
}
*to++ = (unsigned short)(((from[0] & 0x1f) << 6) | (from[1] & 0x3f));
from += 2;
@@ -412,7 +459,7 @@ utf8_toUtf16(const ENCODING *enc,
case BT_LEAD3:
if (fromLim - from < 3) {
res = XML_CONVERT_INPUT_INCOMPLETE;
- break;
+ goto after;
}
*to++ = (unsigned short)(((from[0] & 0xf) << 12)
| ((from[1] & 0x3f) << 6) | (from[2] & 0x3f));
@@ -443,6 +490,8 @@ utf8_toUtf16(const ENCODING *enc,
break;
}
}
+ if (from < fromLim)
+ res = XML_CONVERT_OUTPUT_EXHAUSTED;
after:
*fromP = from;
*toP = to;
@@ -1025,7 +1074,11 @@ streqci(const char *s1, const char *s2)
if (ASCII_a <= c1 && c1 <= ASCII_z)
c1 += ASCII_A - ASCII_a;
if (ASCII_a <= c2 && c2 <= ASCII_z)
- c2 += ASCII_A - ASCII_a;
+ /* The following line will never get executed. streqci() is
+ * only called from two places, both of which guarantee to put
+ * upper-case strings into s2.
+ */
+ c2 += ASCII_A - ASCII_a; /* LCOV_EXCL_LINE */
if (c1 != c2)
return 0;
if (!c1)
@@ -1297,7 +1350,7 @@ XmlUtf8Encode(int c, char *buf)
};
if (c < 0)
- return 0;
+ return 0; /* LCOV_EXCL_LINE: this case is always eliminated beforehand */
if (c < min2) {
buf[0] = (char)(c | UTF8_cval1);
return 1;
@@ -1320,7 +1373,7 @@ XmlUtf8Encode(int c, char *buf)
buf[3] = (char)((c & 0x3f) | 0x80);
return 4;
}
- return 0;
+ return 0; /* LCOV_EXCL_LINE: this case too is eliminated before calling */
}
int FASTCALL
@@ -1413,9 +1466,8 @@ unknown_toUtf8(const ENCODING *enc,
return XML_CONVERT_OUTPUT_EXHAUSTED;
(*fromP)++;
}
- do {
- *(*toP)++ = *utf8++;
- } while (--n != 0);
+ memcpy(*toP, utf8, n);
+ *toP += n;
}
}
@@ -1471,6 +1523,9 @@ XmlInitUnknownEncoding(void *mem,
else if (c < 0) {
if (c < -4)
return 0;
+ /* Multi-byte sequences need a converter function */
+ if (!convert)
+ return 0;
e->normal.type[i] = (unsigned char)(BT_LEAD2 - (c + 2));
e->utf8[i][0] = 0;
e->utf16[i] = 0;
diff --git a/freebsd/contrib/expat/lib/xmltok.h b/freebsd/contrib/expat/lib/xmltok.h
index 752007e8..50926f38 100644
--- a/freebsd/contrib/expat/lib/xmltok.h
+++ b/freebsd/contrib/expat/lib/xmltok.h
@@ -1,5 +1,33 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/*
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef XmlTok_INCLUDED
@@ -139,9 +167,6 @@ enum XML_Convert_Result {
struct encoding {
SCANNER scanners[XML_N_STATES];
SCANNER literalScanners[XML_N_LITERAL_TYPES];
- int (PTRCALL *sameName)(const ENCODING *,
- const char *,
- const char *);
int (PTRCALL *nameMatchesAscii)(const ENCODING *,
const char *,
const char *,
@@ -232,8 +257,6 @@ struct encoding {
#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
-#define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2))
-
#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
(((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
diff --git a/freebsd/contrib/expat/lib/xmltok_impl.c b/freebsd/contrib/expat/lib/xmltok_impl.c
index 2deec94f..dcb33e2f 100644
--- a/freebsd/contrib/expat/lib/xmltok_impl.c
+++ b/freebsd/contrib/expat/lib/xmltok_impl.c
@@ -1,10 +1,37 @@
#include <machine/rtems-bsd-user-space.h>
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/* This file is included!
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* This file is included! */
#ifdef XML_TOK_IMPL_C
#ifndef IS_INVALID_CHAR
@@ -49,6 +76,7 @@
*nextTokPtr = ptr; \
return XML_TOK_INVALID; \
} \
+ /* fall through */ \
case BT_NMSTRT: \
case BT_HEX: \
case BT_DIGIT: \
@@ -77,6 +105,7 @@
*nextTokPtr = ptr; \
return XML_TOK_INVALID; \
} \
+ /* fall through */ \
case BT_NMSTRT: \
case BT_HEX: \
ptr += MINBPC(enc); \
@@ -577,7 +606,7 @@ PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
return XML_TOK_INVALID;
}
}
- /* fall through */
+ /* fall through */
case BT_EQUALS:
{
int open;
@@ -1200,8 +1229,14 @@ PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr,
const char *start;
if (ptr >= end)
return XML_TOK_NONE;
- else if (! HAS_CHAR(enc, ptr, end))
- return XML_TOK_PARTIAL;
+ else if (! HAS_CHAR(enc, ptr, end)) {
+ /* This line cannot be executed. The incoming data has already
+ * been tokenized once, so incomplete characters like this have
+ * already been eliminated from the input. Retaining the paranoia
+ * check is still valuable, however.
+ */
+ return XML_TOK_PARTIAL; /* LCOV_EXCL_LINE */
+ }
start = ptr;
while (HAS_CHAR(enc, ptr, end)) {
switch (BYTE_TYPE(enc, ptr)) {
@@ -1260,8 +1295,14 @@ PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr,
const char *start;
if (ptr >= end)
return XML_TOK_NONE;
- else if (! HAS_CHAR(enc, ptr, end))
- return XML_TOK_PARTIAL;
+ else if (! HAS_CHAR(enc, ptr, end)) {
+ /* This line cannot be executed. The incoming data has already
+ * been tokenized once, so incomplete characters like this have
+ * already been eliminated from the input. Retaining the paranoia
+ * check is still valuable, however.
+ */
+ return XML_TOK_PARTIAL; /* LCOV_EXCL_LINE */
+ }
start = ptr;
while (HAS_CHAR(enc, ptr, end)) {
switch (BYTE_TYPE(enc, ptr)) {
@@ -1405,6 +1446,7 @@ PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
case BT_NMSTRT:
if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f))
break;
+ /* fall through */
default:
switch (BYTE_TO_ASCII(enc, ptr)) {
case 0x24: /* $ */
@@ -1617,76 +1659,18 @@ PREFIX(predefinedEntityName)(const ENCODING *UNUSED_P(enc), const char *ptr,
}
static int PTRCALL
-PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2)
-{
- for (;;) {
- switch (BYTE_TYPE(enc, ptr1)) {
-#define LEAD_CASE(n) \
- case BT_LEAD ## n: \
- if (*ptr1++ != *ptr2++) \
- return 0;
- LEAD_CASE(4) LEAD_CASE(3) LEAD_CASE(2)
-#undef LEAD_CASE
- /* fall through */
- if (*ptr1++ != *ptr2++)
- return 0;
- break;
- case BT_NONASCII:
- case BT_NMSTRT:
-#ifdef XML_NS
- case BT_COLON:
-#endif
- case BT_HEX:
- case BT_DIGIT:
- case BT_NAME:
- case BT_MINUS:
- if (*ptr2++ != *ptr1++)
- return 0;
- if (MINBPC(enc) > 1) {
- if (*ptr2++ != *ptr1++)
- return 0;
- if (MINBPC(enc) > 2) {
- if (*ptr2++ != *ptr1++)
- return 0;
- if (MINBPC(enc) > 3) {
- if (*ptr2++ != *ptr1++)
- return 0;
- }
- }
- }
- break;
- default:
- if (MINBPC(enc) == 1 && *ptr1 == *ptr2)
- return 1;
- switch (BYTE_TYPE(enc, ptr2)) {
- case BT_LEAD2:
- case BT_LEAD3:
- case BT_LEAD4:
- case BT_NONASCII:
- case BT_NMSTRT:
-#ifdef XML_NS
- case BT_COLON:
-#endif
- case BT_HEX:
- case BT_DIGIT:
- case BT_NAME:
- case BT_MINUS:
- return 0;
- default:
- return 1;
- }
- }
- }
- /* not reached */
-}
-
-static int PTRCALL
PREFIX(nameMatchesAscii)(const ENCODING *UNUSED_P(enc), const char *ptr1,
const char *end1, const char *ptr2)
{
for (; *ptr2; ptr1 += MINBPC(enc), ptr2++) {
- if (end1 - ptr1 < MINBPC(enc))
- return 0;
+ if (end1 - ptr1 < MINBPC(enc)) {
+ /* This line cannot be executed. The incoming data has already
+ * been tokenized once, so incomplete characters like this have
+ * already been eliminated from the input. Retaining the
+ * paranoia check is still valuable, however.
+ */
+ return 0; /* LCOV_EXCL_LINE */
+ }
if (!CHAR_MATCHES(enc, ptr1, *ptr2))
return 0;
}
diff --git a/freebsd/contrib/expat/lib/xmltok_impl.h b/freebsd/contrib/expat/lib/xmltok_impl.h
index da0ea60a..a6420f48 100644
--- a/freebsd/contrib/expat/lib/xmltok_impl.h
+++ b/freebsd/contrib/expat/lib/xmltok_impl.h
@@ -1,6 +1,33 @@
/*
-Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
-See the file COPYING for copying permission.
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
enum {
diff --git a/freebsd/contrib/expat/lib/xmltok_ns.c b/freebsd/contrib/expat/lib/xmltok_ns.c
index f6a7281f..2afb3bdf 100644
--- a/freebsd/contrib/expat/lib/xmltok_ns.c
+++ b/freebsd/contrib/expat/lib/xmltok_ns.c
@@ -1,10 +1,37 @@
#include <machine/rtems-bsd-user-space.h>
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
- See the file COPYING for copying permission.
+/* This file is included!
+ __ __ _
+ ___\ \/ /_ __ __ _| |_
+ / _ \\ /| '_ \ / _` | __|
+ | __// \| |_) | (_| | |_
+ \___/_/\_\ .__/ \__,_|\__|
+ |_| XML parser
+
+ Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
+ Copyright (c) 2000-2017 Expat development team
+ Licensed under the MIT license:
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* This file is included! */
#ifdef XML_TOK_NS_C
const ENCODING *
diff --git a/freebsd/contrib/tcpdump/tcpdump.c b/freebsd/contrib/tcpdump/tcpdump.c
index fbee78ce..3eb1b49e 100644
--- a/freebsd/contrib/tcpdump/tcpdump.c
+++ b/freebsd/contrib/tcpdump/tcpdump.c
@@ -775,7 +775,7 @@ capdns_setup(void)
if (capdnsloc == NULL)
error("unable to open system.dns service");
/* Limit system.dns to reverse DNS lookups. */
- types[0] = "ADDR";
+ types[0] = "ADDR2NAME";
if (cap_dns_type_limit(capdnsloc, types, 1) < 0)
error("unable to limit access to system.dns service");
families[0] = AF_INET;
diff --git a/freebsd/crypto/openssl/include/openssl/opensslv.h b/freebsd/crypto/openssl/include/openssl/opensslv.h
index d23d73f9..363359d9 100644
--- a/freebsd/crypto/openssl/include/openssl/opensslv.h
+++ b/freebsd/crypto/openssl/include/openssl/opensslv.h
@@ -92,7 +92,7 @@ extern "C" {
* should only keep the versions that are binary compatible with the current.
*/
# define SHLIB_VERSION_HISTORY ""
-# define SHLIB_VERSION_NUMBER "9"
+# define SHLIB_VERSION_NUMBER "111"
#ifdef __cplusplus
diff --git a/freebsd/lib/libc/net/nsdispatch.c b/freebsd/lib/libc/net/nsdispatch.c
index 1c7612f1..880a4101 100644
--- a/freebsd/lib/libc/net/nsdispatch.c
+++ b/freebsd/lib/libc/net/nsdispatch.c
@@ -351,6 +351,7 @@ static int
nss_configure(void)
{
static time_t confmod;
+ static int already_initialized = 0;
struct stat statbuf;
int result, isthreaded;
const char *path;
@@ -368,6 +369,16 @@ nss_configure(void)
if (path == NULL)
#endif
path = _PATH_NS_CONF;
+#ifndef NS_REREAD_CONF
+ /*
+ * Define NS_REREAD_CONF to have nsswitch notice changes
+ * to nsswitch.conf(5) during runtime. This involves calling
+ * stat(2) every time, which can result in performance hit.
+ */
+ if (already_initialized)
+ return (0);
+ already_initialized = 1;
+#endif /* NS_REREAD_CONF */
if (stat(path, &statbuf) != 0)
return (0);
if (statbuf.st_mtime <= confmod)
diff --git a/freebsd/lib/libcapsicum/capsicum_helpers.h b/freebsd/lib/libcapsicum/capsicum_helpers.h
index 60c894f3..d1c46e74 100644
--- a/freebsd/lib/libcapsicum/capsicum_helpers.h
+++ b/freebsd/lib/libcapsicum/capsicum_helpers.h
@@ -136,6 +136,35 @@ caph_enter(void)
return (0);
}
+static __inline int
+caph_rights_limit(int fd, const cap_rights_t *rights)
+{
+
+ if (cap_rights_limit(fd, rights) < 0 && errno != ENOSYS)
+ return (-1);
+
+ return (0);
+}
+
+static __inline int
+caph_ioctls_limit(int fd, const unsigned long *cmds, size_t ncmds)
+{
+
+ if (cap_ioctls_limit(fd, cmds, ncmds) < 0 && errno != ENOSYS)
+ return (-1);
+
+ return (0);
+}
+
+static __inline int
+caph_fcntls_limit(int fd, uint32_t fcntlrights)
+{
+
+ if (cap_fcntls_limit(fd, fcntlrights) < 0 && errno != ENOSYS)
+ return (-1);
+
+ return (0);
+}
static __inline int
caph_enter_casper(void)
diff --git a/freebsd/sbin/dhclient/bpf.c b/freebsd/sbin/dhclient/bpf.c
index e1bfacdc..55a8586f 100644
--- a/freebsd/sbin/dhclient/bpf.c
+++ b/freebsd/sbin/dhclient/bpf.c
@@ -59,6 +59,8 @@ __FBSDID("$FreeBSD$");
#include <netinet/udp.h>
#include <netinet/if_ether.h>
+#include <capsicum_helpers.h>
+
#define BPF_FORMAT "/dev/bpf%d"
/*
@@ -166,7 +168,7 @@ if_register_send(struct interface_info *info)
error("Cannot lock bpf");
cap_rights_init(&rights, CAP_WRITE);
- if (cap_rights_limit(info->wfdesc, &rights) < 0 && errno != ENOSYS)
+ if (caph_rights_limit(info->wfdesc, &rights) < 0)
error("Can't limit bpf descriptor: %m");
/*
@@ -272,9 +274,9 @@ if_register_receive(struct interface_info *info)
error("Cannot lock bpf");
cap_rights_init(&rights, CAP_IOCTL, CAP_EVENT, CAP_READ);
- if (cap_rights_limit(info->rfdesc, &rights) < 0 && errno != ENOSYS)
+ if (caph_rights_limit(info->rfdesc, &rights) < 0)
error("Can't limit bpf descriptor: %m");
- if (cap_ioctls_limit(info->rfdesc, cmds, 2) < 0 && errno != ENOSYS)
+ if (caph_ioctls_limit(info->rfdesc, cmds, 2) < 0)
error("Can't limit ioctls for bpf descriptor: %m");
}
diff --git a/freebsd/sbin/dhclient/dhclient.c b/freebsd/sbin/dhclient/dhclient.c
index d155d454..2aedd2f7 100644
--- a/freebsd/sbin/dhclient/dhclient.c
+++ b/freebsd/sbin/dhclient/dhclient.c
@@ -514,7 +514,7 @@ main(int argc, char *argv[])
close(pipe_fd[0]);
privfd = pipe_fd[1];
cap_rights_init(&rights, CAP_READ, CAP_WRITE);
- if (cap_rights_limit(privfd, &rights) < 0 && errno != ENOSYS)
+ if (caph_rights_limit(privfd, &rights) < 0)
error("can't limit private descriptor: %m");
if ((fd = open(path_dhclient_db, O_RDONLY|O_EXLOCK|O_CREAT, 0)) == -1)
@@ -528,7 +528,7 @@ main(int argc, char *argv[])
if (shutdown(routefd, SHUT_WR) < 0)
error("can't shutdown route socket: %m");
cap_rights_init(&rights, CAP_EVENT, CAP_READ);
- if (cap_rights_limit(routefd, &rights) < 0 && errno != ENOSYS)
+ if (caph_rights_limit(routefd, &rights) < 0)
error("can't limit route socket: %m");
endpwent();
@@ -1930,12 +1930,10 @@ rewrite_client_leases(void)
error("can't create %s: %m", path_dhclient_db);
cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_FSYNC,
CAP_FTRUNCATE, CAP_SEEK, CAP_WRITE);
- if (cap_rights_limit(fileno(leaseFile), &rights) < 0 &&
- errno != ENOSYS) {
+ if (caph_rights_limit(fileno(leaseFile), &rights) < 0) {
error("can't limit lease descriptor: %m");
}
- if (cap_fcntls_limit(fileno(leaseFile), CAP_FCNTL_GETFL) < 0 &&
- errno != ENOSYS) {
+ if (caph_fcntls_limit(fileno(leaseFile), CAP_FCNTL_GETFL) < 0) {
error("can't limit lease descriptor fcntls: %m");
}
} else {
@@ -2462,20 +2460,24 @@ go_daemon(void)
cap_rights_init(&rights);
- if (pidfile != NULL)
+ if (pidfile != NULL) {
pidfile_write(pidfile);
+ if (caph_rights_limit(pidfile_fileno(pidfile), &rights) < 0)
+ error("can't limit pidfile descriptor: %m");
+ }
+
if (nullfd != -1) {
close(nullfd);
nullfd = -1;
}
- if (cap_rights_limit(STDIN_FILENO, &rights) < 0 && errno != ENOSYS)
+ if (caph_rights_limit(STDIN_FILENO, &rights) < 0)
error("can't limit stdin: %m");
cap_rights_init(&rights, CAP_WRITE);
- if (cap_rights_limit(STDOUT_FILENO, &rights) < 0 && errno != ENOSYS)
+ if (caph_rights_limit(STDOUT_FILENO, &rights) < 0)
error("can't limit stdout: %m");
- if (cap_rights_limit(STDERR_FILENO, &rights) < 0 && errno != ENOSYS)
+ if (caph_rights_limit(STDERR_FILENO, &rights) < 0)
error("can't limit stderr: %m");
}
diff --git a/freebsd/sbin/ifconfig/af_nd6.c b/freebsd/sbin/ifconfig/af_nd6.c
index 1d9bdd73..964c96b0 100644
--- a/freebsd/sbin/ifconfig/af_nd6.c
+++ b/freebsd/sbin/ifconfig/af_nd6.c
@@ -69,9 +69,17 @@ static const char rcsid[] =
#endif /* __rtems__ */
#define MAX_SYSCTL_TRY 5
+#ifdef DRAFT_IETF_6MAN_IPV6ONLY_FLAG
+#define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \
+ "\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \
+ "\007NO_RADR\010NO_PREFER_IFACE\011NO_DAD" \
+ "\012IPV6_ONLY" \
+ "\020DEFAULTIF"
+#else
#define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \
"\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \
"\007NO_RADR\010NO_PREFER_IFACE\011NO_DAD\020DEFAULTIF"
+#endif
static int isnd6defif(int);
void setnd6flags(const char *, int, int, const struct afswtch *);
diff --git a/freebsd/sbin/pfctl/parse.y b/freebsd/sbin/pfctl/parse.y
index adb6e1c9..8b6808a6 100644
--- a/freebsd/sbin/pfctl/parse.y
+++ b/freebsd/sbin/pfctl/parse.y
@@ -776,8 +776,16 @@ numberstring : NUMBER {
;
varset : STRING '=' varstring {
+ char *s = $1;
if (pf->opts & PF_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
+ while (*s++) {
+ if (isspace((unsigned char)*s)) {
+ yyerror("macro name cannot contain "
+ "whitespace");
+ YYERROR;
+ }
+ }
if (symset($1, $3, 0) == -1)
err(1, "cannot store variable %s", $1);
free($1);
diff --git a/freebsd/sbin/pfctl/pfctl_parser.c b/freebsd/sbin/pfctl/pfctl_parser.c
index 81e23e84..25e2a59b 100644
--- a/freebsd/sbin/pfctl/pfctl_parser.c
+++ b/freebsd/sbin/pfctl/pfctl_parser.c
@@ -1380,6 +1380,9 @@ ifa_lookup(const char *ifa_name, int flags)
last_if = p->ifname;
if ((flags & PFI_AFLAG_NOALIAS) && p->af == AF_INET && got4)
continue;
+ if ((flags & PFI_AFLAG_NOALIAS) && p->af == AF_INET6 &&
+ IN6_IS_ADDR_LINKLOCAL(&p->addr.v.a.addr.v6))
+ continue;
if ((flags & PFI_AFLAG_NOALIAS) && p->af == AF_INET6 && got6)
continue;
if (p->af == AF_INET)
@@ -1414,6 +1417,7 @@ ifa_lookup(const char *ifa_name, int flags)
set_ipmask(n, 128);
}
n->ifindex = p->ifindex;
+ n->ifname = strdup(p->ifname);
n->next = NULL;
n->tail = n;
diff --git a/freebsd/sbin/ping/ping.c b/freebsd/sbin/ping/ping.c
index 376564b7..74cc2fbb 100644
--- a/freebsd/sbin/ping/ping.c
+++ b/freebsd/sbin/ping/ping.c
@@ -305,7 +305,8 @@ main(int argc, char *const *argv)
#endif
struct sockaddr_in *to;
double t;
- u_long alarmtimeout, ultmp;
+ u_long alarmtimeout;
+ long ltmp;
int almost_done, ch, df, hold, i, icmp_len, mib[4], preload;
int ssend_errno, srecv_errno, tos, ttl;
char ctrl[CMSG_SPACE(sizeof(struct timeval))];
@@ -385,12 +386,12 @@ main(int argc, char *const *argv)
options |= F_AUDIBLE;
break;
case 'c':
- ultmp = strtoul(optarg, &ep, 0);
- if (*ep || ep == optarg || ultmp > LONG_MAX || !ultmp)
+ ltmp = strtol(optarg, &ep, 0);
+ if (*ep || ep == optarg || ltmp > LONG_MAX || ltmp <=0)
errx(EX_USAGE,
"invalid count of packets to transmit: `%s'",
optarg);
- npackets = ultmp;
+ npackets = ltmp;
break;
case 'D':
options |= F_HDRINCL;
@@ -408,46 +409,46 @@ main(int argc, char *const *argv)
setbuf(stdout, (char *)NULL);
break;
case 'G': /* Maximum packet size for ping sweep */
- ultmp = strtoul(optarg, &ep, 0);
- if (*ep || ep == optarg)
+ ltmp = strtol(optarg, &ep, 0);
+ if (*ep || ep == optarg || ltmp <= 0)
errx(EX_USAGE, "invalid packet size: `%s'",
optarg);
- if (uid != 0 && ultmp > DEFDATALEN) {
+ if (uid != 0 && ltmp > DEFDATALEN) {
errno = EPERM;
err(EX_NOPERM,
- "packet size too large: %lu > %u",
- ultmp, DEFDATALEN);
+ "packet size too large: %ld > %u",
+ ltmp, DEFDATALEN);
}
options |= F_SWEEP;
- sweepmax = ultmp;
+ sweepmax = ltmp;
break;
case 'g': /* Minimum packet size for ping sweep */
- ultmp = strtoul(optarg, &ep, 0);
- if (*ep || ep == optarg)
+ ltmp = strtol(optarg, &ep, 0);
+ if (*ep || ep == optarg || ltmp <= 0)
errx(EX_USAGE, "invalid packet size: `%s'",
optarg);
- if (uid != 0 && ultmp > DEFDATALEN) {
+ if (uid != 0 && ltmp > DEFDATALEN) {
errno = EPERM;
err(EX_NOPERM,
- "packet size too large: %lu > %u",
- ultmp, DEFDATALEN);
+ "packet size too large: %ld > %u",
+ ltmp, DEFDATALEN);
}
options |= F_SWEEP;
- sweepmin = ultmp;
+ sweepmin = ltmp;
break;
case 'h': /* Packet size increment for ping sweep */
- ultmp = strtoul(optarg, &ep, 0);
- if (*ep || ep == optarg || ultmp < 1)
+ ltmp = strtol(optarg, &ep, 0);
+ if (*ep || ep == optarg || ltmp < 1)
errx(EX_USAGE, "invalid increment size: `%s'",
optarg);
- if (uid != 0 && ultmp > DEFDATALEN) {
+ if (uid != 0 && ltmp > DEFDATALEN) {
errno = EPERM;
err(EX_NOPERM,
- "packet size too large: %lu > %u",
- ultmp, DEFDATALEN);
+ "packet size too large: %ld > %u",
+ ltmp, DEFDATALEN);
}
options |= F_SWEEP;
- sweepincr = ultmp;
+ sweepincr = ltmp;
break;
case 'I': /* multicast interface */
if (inet_aton(optarg, &ifaddr) == 0)
@@ -473,15 +474,15 @@ main(int argc, char *const *argv)
loop = 0;
break;
case 'l':
- ultmp = strtoul(optarg, &ep, 0);
- if (*ep || ep == optarg || ultmp > INT_MAX)
+ ltmp = strtol(optarg, &ep, 0);
+ if (*ep || ep == optarg || ltmp > INT_MAX || ltmp < 0)
errx(EX_USAGE,
"invalid preload value: `%s'", optarg);
if (uid) {
errno = EPERM;
err(EX_NOPERM, "-l flag");
}
- preload = ultmp;
+ preload = ltmp;
break;
case 'M':
switch(optarg[0]) {
@@ -499,10 +500,10 @@ main(int argc, char *const *argv)
}
break;
case 'm': /* TTL */
- ultmp = strtoul(optarg, &ep, 0);
- if (*ep || ep == optarg || ultmp > MAXTTL)
+ ltmp = strtol(optarg, &ep, 0);
+ if (*ep || ep == optarg || ltmp > MAXTTL || ltmp < 0)
errx(EX_USAGE, "invalid TTL: `%s'", optarg);
- ttl = ultmp;
+ ttl = ltmp;
options |= F_TTL;
break;
case 'n':
@@ -544,24 +545,24 @@ main(int argc, char *const *argv)
source = optarg;
break;
case 's': /* size of packet to send */
- ultmp = strtoul(optarg, &ep, 0);
- if (*ep || ep == optarg)
+ ltmp = strtol(optarg, &ep, 0);
+ if (*ep || ep == optarg || ltmp < 0)
errx(EX_USAGE, "invalid packet size: `%s'",
optarg);
- if (uid != 0 && ultmp > DEFDATALEN) {
+ if (uid != 0 && ltmp > DEFDATALEN) {
errno = EPERM;
err(EX_NOPERM,
- "packet size too large: %lu > %u",
- ultmp, DEFDATALEN);
+ "packet size too large: %ld > %u",
+ ltmp, DEFDATALEN);
}
- datalen = ultmp;
+ datalen = ltmp;
break;
case 'T': /* multicast TTL */
- ultmp = strtoul(optarg, &ep, 0);
- if (*ep || ep == optarg || ultmp > MAXTTL)
+ ltmp = strtol(optarg, &ep, 0);
+ if (*ep || ep == optarg || ltmp > MAXTTL || ltmp < 0)
errx(EX_USAGE, "invalid multicast TTL: `%s'",
optarg);
- mttl = ultmp;
+ mttl = ltmp;
options |= F_MTTL;
break;
case 't':
@@ -587,10 +588,10 @@ main(int argc, char *const *argv)
break;
case 'z':
options |= F_HDRINCL;
- ultmp = strtoul(optarg, &ep, 0);
- if (*ep || ep == optarg || ultmp > MAXTOS)
+ ltmp = strtol(optarg, &ep, 0);
+ if (*ep || ep == optarg || ltmp > MAXTOS || ltmp < 0)
errx(EX_USAGE, "invalid TOS: `%s'", optarg);
- tos = ultmp;
+ tos = ltmp;
break;
default:
usage();
@@ -642,11 +643,7 @@ main(int argc, char *const *argv)
if (inet_aton(source, &sock_in.sin_addr) != 0) {
shostname = source;
} else {
- if (capdns != NULL)
- hp = cap_gethostbyname2(capdns, source,
- AF_INET);
- else
- hp = gethostbyname2(source, AF_INET);
+ hp = cap_gethostbyname2(capdns, source, AF_INET);
if (!hp)
errx(EX_NOHOST, "cannot resolve %s: %s",
source, hstrerror(h_errno));
@@ -674,10 +671,7 @@ main(int argc, char *const *argv)
if (inet_aton(target, &to->sin_addr) != 0) {
hostname = target;
} else {
- if (capdns != NULL)
- hp = cap_gethostbyname2(capdns, target, AF_INET);
- else
- hp = gethostbyname2(target, AF_INET);
+ hp = cap_gethostbyname2(capdns, target, AF_INET);
if (!hp)
errx(EX_NOHOST, "cannot resolve %s: %s",
target, hstrerror(h_errno));
@@ -695,7 +689,7 @@ main(int argc, char *const *argv)
if (capdns != NULL) {
const char *types[1];
- types[0] = "ADDR";
+ types[0] = "ADDR2NAME";
if (cap_dns_type_limit(capdns, types, 1) < 0)
err(1, "unable to limit access to system.dns service");
}
@@ -1789,10 +1783,7 @@ pr_addr(struct in_addr ina)
if (options & F_NUMERIC)
return inet_ntoa(ina);
- if (capdns != NULL)
- hp = cap_gethostbyaddr(capdns, (char *)&ina, 4, AF_INET);
- else
- hp = gethostbyaddr((char *)&ina, 4, AF_INET);
+ hp = cap_gethostbyaddr(capdns, (char *)&ina, 4, AF_INET);
if (hp == NULL)
return inet_ntoa(ina);
@@ -1887,8 +1878,8 @@ capdns_setup(void)
cap_close(capcas);
if (capdnsloc == NULL)
err(1, "unable to open system.dns service");
- types[0] = "NAME";
- types[1] = "ADDR";
+ types[0] = "NAME2ADDR";
+ types[1] = "ADDR2NAME";
if (cap_dns_type_limit(capdnsloc, types, 2) < 0)
err(1, "unable to limit access to system.dns service");
families[0] = AF_INET;
diff --git a/freebsd/sbin/route/route.c b/freebsd/sbin/route/route.c
index 80404d66..10c2f2e9 100644
--- a/freebsd/sbin/route/route.c
+++ b/freebsd/sbin/route/route.c
@@ -1109,10 +1109,13 @@ newroute(int argc, char **argv)
}
printf("\n");
}
+ }
- fibnum = 0;
- TAILQ_FOREACH(fl, &fibl_head, fl_next) {
- if (fl->fl_error != 0) {
+ fibnum = 0;
+ TAILQ_FOREACH(fl, &fibl_head, fl_next) {
+ if (fl->fl_error != 0) {
+ error = 1;
+ if (!qflag) {
printf("%s %s %s", cmd, (nrflags & F_ISHOST)
? "host" : "net", dest);
if (*gateway)
@@ -1146,7 +1149,6 @@ newroute(int argc, char **argv)
break;
}
printf(": %s\n", errmsg);
- error = 1;
}
}
}
diff --git a/freebsd/sys/crypto/rijndael/rijndael-api-fst.c b/freebsd/sys/crypto/rijndael/rijndael-api-fst.c
index 1ae535a5..30816c80 100644
--- a/freebsd/sys/crypto/rijndael/rijndael-api-fst.c
+++ b/freebsd/sys/crypto/rijndael/rijndael-api-fst.c
@@ -38,7 +38,6 @@ typedef u_int8_t BYTE;
int rijndael_makeKey(keyInstance *key, BYTE direction, int keyLen,
const char *keyMaterial) {
- u_int8_t cipherKey[RIJNDAEL_MAXKB];
if (key == NULL) {
return BAD_KEY_INSTANCE;
@@ -61,13 +60,12 @@ int rijndael_makeKey(keyInstance *key, BYTE direction, int keyLen,
}
/* initialize key schedule: */
- memcpy(cipherKey, key->keyMaterial, keyLen/8);
if (direction == DIR_ENCRYPT) {
- key->Nr = rijndaelKeySetupEnc(key->rk, cipherKey, keyLen);
+ key->Nr = rijndaelKeySetupEnc(key->rk, key->keyMaterial, keyLen);
} else {
- key->Nr = rijndaelKeySetupDec(key->rk, cipherKey, keyLen);
+ key->Nr = rijndaelKeySetupDec(key->rk, key->keyMaterial, keyLen);
}
- rijndaelKeySetupEnc(key->ek, cipherKey, keyLen);
+ rijndaelKeySetupEnc(key->ek, key->keyMaterial, keyLen);
return TRUE;
}
@@ -188,6 +186,7 @@ int rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key,
return BAD_CIPHER_STATE;
}
+ explicit_bzero(block, sizeof(block));
return 128*numBlocks;
}
@@ -260,6 +259,7 @@ int rijndael_padEncrypt(cipherInstance *cipher, keyInstance *key,
return BAD_CIPHER_STATE;
}
+ explicit_bzero(block, sizeof(block));
return 16*(numBlocks + 1);
}
@@ -359,12 +359,13 @@ int rijndael_blockDecrypt(cipherInstance *cipher, keyInstance *key,
return BAD_CIPHER_STATE;
}
+ explicit_bzero(block, sizeof(block));
return 128*numBlocks;
}
int rijndael_padDecrypt(cipherInstance *cipher, keyInstance *key,
const BYTE *input, int inputOctets, BYTE *outBuffer) {
- int i, numBlocks, padLen;
+ int i, numBlocks, padLen, rval;
u_int8_t block[16];
u_int32_t iv[4];
@@ -394,11 +395,13 @@ int rijndael_padDecrypt(cipherInstance *cipher, keyInstance *key,
rijndaelDecrypt(key->rk, key->Nr, input, block);
padLen = block[15];
if (padLen >= 16) {
- return BAD_DATA;
+ rval = BAD_DATA;
+ goto out;
}
for (i = 16 - padLen; i < 16; i++) {
if (block[i] != padLen) {
- return BAD_DATA;
+ rval = BAD_DATA;
+ goto out;
}
}
memcpy(outBuffer, block, 16 - padLen);
@@ -426,11 +429,13 @@ int rijndael_padDecrypt(cipherInstance *cipher, keyInstance *key,
((u_int32_t*)block)[3] ^= iv[3];
padLen = block[15];
if (padLen <= 0 || padLen > 16) {
- return BAD_DATA;
+ rval = BAD_DATA;
+ goto out;
}
for (i = 16 - padLen; i < 16; i++) {
if (block[i] != padLen) {
- return BAD_DATA;
+ rval = BAD_DATA;
+ goto out;
}
}
memcpy(outBuffer, block, 16 - padLen);
@@ -440,5 +445,9 @@ int rijndael_padDecrypt(cipherInstance *cipher, keyInstance *key,
return BAD_CIPHER_STATE;
}
- return 16*numBlocks - padLen;
+ rval = 16*numBlocks - padLen;
+
+out:
+ explicit_bzero(block, sizeof(block));
+ return rval;
}
diff --git a/freebsd/sys/dev/e1000/em_txrx.c b/freebsd/sys/dev/e1000/em_txrx.c
index 3ceada31..c2b60743 100644
--- a/freebsd/sys/dev/e1000/em_txrx.c
+++ b/freebsd/sys/dev/e1000/em_txrx.c
@@ -460,7 +460,13 @@ em_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear)
ntxd = scctx->isc_ntxd[0];
do {
delta = (int32_t)cur - (int32_t)prev;
+ /*
+ * XXX This appears to be a hack for first-packet.
+ * A correct fix would prevent prev == cur in the first place.
+ */
MPASS(prev == 0 || delta != 0);
+ if (prev == 0 && cur == 0)
+ delta += 1;
if (delta < 0)
delta += ntxd;
DPRINTF(iflib_get_dev(adapter->ctx),
diff --git a/freebsd/sys/dev/e1000/igb_txrx.c b/freebsd/sys/dev/e1000/igb_txrx.c
index 32bab4bf..c54315f0 100644
--- a/freebsd/sys/dev/e1000/igb_txrx.c
+++ b/freebsd/sys/dev/e1000/igb_txrx.c
@@ -335,7 +335,13 @@ igb_isc_txd_credits_update(void *arg, uint16_t txqid, bool clear)
ntxd = scctx->isc_ntxd[0];
do {
delta = (int32_t)cur - (int32_t)prev;
+ /*
+ * XXX This appears to be a hack for first-packet.
+ * A correct fix would prevent prev == cur in the first place.
+ */
MPASS(prev == 0 || delta != 0);
+ if (prev == 0 && cur == 0)
+ delta += 1;
if (delta < 0)
delta += ntxd;
diff --git a/freebsd/sys/dev/evdev/cdev.c b/freebsd/sys/dev/evdev/cdev.c
index 5ae14fed..a9370e7e 100644
--- a/freebsd/sys/dev/evdev/cdev.c
+++ b/freebsd/sys/dev/evdev/cdev.c
@@ -351,6 +351,19 @@ evdev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
if (client->ec_revoked || evdev == NULL)
return (ENODEV);
+ /*
+ * Fix evdev state corrupted with discarding of kdb events.
+ * EVIOCGKEY and EVIOCGLED ioctls can suffer from this.
+ */
+ if (evdev->ev_kdb_active) {
+ EVDEV_LOCK(evdev);
+ if (evdev->ev_kdb_active) {
+ evdev->ev_kdb_active = false;
+ evdev_restore_after_kdb(evdev);
+ }
+ EVDEV_UNLOCK(evdev);
+ }
+
/* file I/O ioctl handling */
switch (cmd) {
case FIOSETOWN:
diff --git a/freebsd/sys/dev/evdev/evdev.c b/freebsd/sys/dev/evdev/evdev.c
index a355ec50..63e651a2 100644
--- a/freebsd/sys/dev/evdev/evdev.c
+++ b/freebsd/sys/dev/evdev/evdev.c
@@ -34,9 +34,11 @@
#include <sys/param.h>
#include <sys/bitstring.h>
#include <sys/conf.h>
+#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/module.h>
+#include <sys/proc.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
@@ -769,6 +771,30 @@ evdev_send_event(struct evdev_dev *evdev, uint16_t type, uint16_t code,
}
}
+void
+evdev_restore_after_kdb(struct evdev_dev *evdev)
+{
+ int code;
+
+ EVDEV_LOCK_ASSERT(evdev);
+
+ /* Report postponed leds */
+ for (code = 0; code < LED_CNT; code++)
+ if (bit_test(evdev->ev_kdb_led_states, code))
+ evdev_send_event(evdev, EV_LED, code,
+ !bit_test(evdev->ev_led_states, code));
+ bit_nclear(evdev->ev_kdb_led_states, 0, LED_MAX);
+
+ /* Release stuck keys (CTRL + ALT + ESC) */
+ evdev_stop_repeat(evdev);
+ for (code = 0; code < KEY_CNT; code++) {
+ if (bit_test(evdev->ev_key_states, code)) {
+ evdev_send_event(evdev, EV_KEY, code, KEY_EVENT_UP);
+ evdev_send_event(evdev, EV_SYN, SYN_REPORT, 1);
+ }
+ }
+}
+
int
evdev_push_event(struct evdev_dev *evdev, uint16_t type, uint16_t code,
int32_t value)
@@ -777,8 +803,26 @@ evdev_push_event(struct evdev_dev *evdev, uint16_t type, uint16_t code,
if (evdev_check_event(evdev, type, code, value) != 0)
return (EINVAL);
+ /*
+ * Discard all but LEDs kdb events as unrelated to userspace.
+ * Aggregate LED updates and postpone reporting until kdb deactivation.
+ */
+ if (kdb_active || SCHEDULER_STOPPED()) {
+ evdev->ev_kdb_active = true;
+ if (type == EV_LED)
+ bit_set(evdev->ev_kdb_led_states,
+ bit_test(evdev->ev_led_states, code) != value);
+ return (0);
+ }
+
EVDEV_ENTER(evdev);
+ /* Fix evdev state corrupted with discarding of kdb events */
+ if (evdev->ev_kdb_active) {
+ evdev->ev_kdb_active = false;
+ evdev_restore_after_kdb(evdev);
+ }
+
evdev_modify_event(evdev, type, code, &value);
if (type == EV_SYN && code == SYN_REPORT &&
bit_test(evdev->ev_flags, EVDEV_FLAG_MT_AUTOREL))
diff --git a/freebsd/sys/dev/evdev/evdev_private.h b/freebsd/sys/dev/evdev/evdev_private.h
index 05206a9d..71bdecaa 100644
--- a/freebsd/sys/dev/evdev/evdev_private.h
+++ b/freebsd/sys/dev/evdev/evdev_private.h
@@ -117,6 +117,10 @@ struct evdev_dev
bitstr_t bit_decl(ev_sw_states, SW_CNT);
bool ev_report_opened;
+ /* KDB state: */
+ bool ev_kdb_active;
+ bitstr_t bit_decl(ev_kdb_led_states, LED_CNT);
+
/* Multitouch protocol type B state: */
struct evdev_mt * ev_mt;
@@ -132,9 +136,14 @@ struct evdev_dev
LIST_HEAD(, evdev_client) ev_clients;
};
+#define SYSTEM_CONSOLE_LOCK &Giant
+
#define EVDEV_LOCK(evdev) mtx_lock((evdev)->ev_lock)
#define EVDEV_UNLOCK(evdev) mtx_unlock((evdev)->ev_lock)
-#define EVDEV_LOCK_ASSERT(evdev) mtx_assert((evdev)->ev_lock, MA_OWNED)
+#define EVDEV_LOCK_ASSERT(evdev) do { \
+ if ((evdev)->ev_lock != SYSTEM_CONSOLE_LOCK) \
+ mtx_assert((evdev)->ev_lock, MA_OWNED); \
+} while (0)
#define EVDEV_ENTER(evdev) do { \
if ((evdev)->ev_lock_type == EV_LOCK_INTERNAL) \
EVDEV_LOCK(evdev); \
@@ -185,6 +194,7 @@ int evdev_cdev_destroy(struct evdev_dev *);
bool evdev_event_supported(struct evdev_dev *, uint16_t);
void evdev_set_abs_bit(struct evdev_dev *, uint16_t);
void evdev_set_absinfo(struct evdev_dev *, uint16_t, struct input_absinfo *);
+void evdev_restore_after_kdb(struct evdev_dev *);
/* Client interface: */
int evdev_register_client(struct evdev_dev *, struct evdev_client *);
diff --git a/freebsd/sys/dev/usb/controller/dwc_otg.c b/freebsd/sys/dev/usb/controller/dwc_otg.c
index 1332b485..005c7ece 100644
--- a/freebsd/sys/dev/usb/controller/dwc_otg.c
+++ b/freebsd/sys/dev/usb/controller/dwc_otg.c
@@ -1434,6 +1434,19 @@ dwc_otg_host_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td)
goto receive_pkt;
}
} else if (td->ep_type == UE_ISOCHRONOUS) {
+ if (td->hcsplt != 0) {
+ /*
+ * Sometimes the complete
+ * split packet may be queued
+ * too early and the
+ * transaction translator will
+ * return a NAK. Ignore
+ * this message and retry the
+ * complete split instead.
+ */
+ DPRINTF("Retrying complete split\n");
+ goto receive_pkt;
+ }
goto complete;
}
td->did_nak = 1;
diff --git a/freebsd/sys/dev/usb/input/uhid.c b/freebsd/sys/dev/usb/input/uhid.c
index 90761ab7..8570f676 100644
--- a/freebsd/sys/dev/usb/input/uhid.c
+++ b/freebsd/sys/dev/usb/input/uhid.c
@@ -677,6 +677,8 @@ uhid_probe(device_t dev)
{
struct usb_attach_arg *uaa = device_get_ivars(dev);
int error;
+ void *buf;
+ uint16_t len;
DPRINTFN(11, "\n");
@@ -703,6 +705,25 @@ uhid_probe(device_t dev)
!usb_test_quirk(uaa, UQ_UMS_IGNORE))))
return (ENXIO);
+ /* Check for mandatory multitouch usages to give wmt(4) a chance */
+ if (!usb_test_quirk(uaa, UQ_WMT_IGNORE)) {
+ error = usbd_req_get_hid_desc(uaa->device, NULL,
+ &buf, &len, M_USBDEV, uaa->info.bIfaceIndex);
+ /* Let HID decscriptor-less devices to be handled at attach */
+ if (!error) {
+ if (hid_locate(buf, len,
+ HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACT_MAX),
+ hid_feature, 0, NULL, NULL, NULL) &&
+ hid_locate(buf, len,
+ HID_USAGE2(HUP_DIGITIZERS, HUD_CONTACTID),
+ hid_input, 0, NULL, NULL, NULL)) {
+ free(buf, M_USBDEV);
+ return (ENXIO);
+ }
+ free(buf, M_USBDEV);
+ }
+ }
+
return (BUS_PROBE_GENERIC);
}
diff --git a/freebsd/sys/dev/usb/input/ukbd.c b/freebsd/sys/dev/usb/input/ukbd.c
index 8fb450bc..770d1d3f 100644
--- a/freebsd/sys/dev/usb/input/ukbd.c
+++ b/freebsd/sys/dev/usb/input/ukbd.c
@@ -1363,7 +1363,7 @@ ukbd_attach(device_t dev)
if (sc->sc_flags & UKBD_FLAG_SCROLLLOCK)
evdev_support_led(evdev, LED_SCROLLL);
- if (evdev_register(evdev))
+ if (evdev_register_mtx(evdev, &Giant))
evdev_free(evdev);
else
sc->sc_evdev = evdev;
diff --git a/freebsd/sys/fs/devfs/devfs_vnops.c b/freebsd/sys/fs/devfs/devfs_vnops.c
index dfa8413b..176664db 100644
--- a/freebsd/sys/fs/devfs/devfs_vnops.c
+++ b/freebsd/sys/fs/devfs/devfs_vnops.c
@@ -782,6 +782,29 @@ devfs_ioctl_f(struct file *fp, u_long com, void *data, struct ucred *cred, struc
return (error);
}
+void *
+fiodgname_buf_get_ptr(void *fgnp, u_long com)
+{
+ union {
+ struct fiodgname_arg fgn;
+#ifdef COMPAT_FREEBSD32
+ struct fiodgname_arg32 fgn32;
+#endif
+ } *fgnup;
+
+ fgnup = fgnp;
+ switch (com) {
+ case FIODGNAME:
+ return (fgnup->fgn.buf);
+#ifdef COMPAT_FREEBSD32
+ case FIODGNAME_32:
+ return ((void *)(uintptr_t)fgnup->fgn32.buf);
+#endif
+ default:
+ panic("Unhandled ioctl command %ld", com);
+ }
+}
+
static int
devfs_ioctl(struct vop_ioctl_args *ap)
{
@@ -804,24 +827,27 @@ devfs_ioctl(struct vop_ioctl_args *ap)
KASSERT(dev->si_refcount > 0,
("devfs: un-referenced struct cdev *(%s)", devtoname(dev)));
- if (com == FIODTYPE) {
+ switch (com) {
+ case FIODTYPE:
*(int *)ap->a_data = dsw->d_flags & D_TYPEMASK;
error = 0;
- goto out;
- } else if (com == FIODGNAME) {
+ break;
+ case FIODGNAME:
+#ifdef COMPAT_FREEBSD32
+ case FIODGNAME_32:
+#endif
fgn = ap->a_data;
p = devtoname(dev);
i = strlen(p) + 1;
if (i > fgn->len)
error = EINVAL;
else
- error = copyout(p, fgn->buf, i);
- goto out;
+ error = copyout(p, fiodgname_buf_get_ptr(fgn, com), i);
+ break;
+ default:
+ error = dsw->d_ioctl(dev, com, ap->a_data, ap->a_fflag, td);
}
- error = dsw->d_ioctl(dev, com, ap->a_data, ap->a_fflag, td);
-
-out:
dev_relthread(dev, ref);
if (error == ENOIOCTL)
error = ENOTTY;
@@ -1370,6 +1396,8 @@ devfs_readdir(struct vop_readdir_args *ap)
if (dp->d_reclen > uio->uio_resid)
break;
dp->d_fileno = de->de_inode;
+ /* NOTE: d_off is the offset for the *next* entry. */
+ dp->d_off = off + dp->d_reclen;
if (off >= uio->uio_offset) {
error = vfs_read_dirent(ap, dp, off);
if (error)
diff --git a/freebsd/sys/kern/init_main.c b/freebsd/sys/kern/init_main.c
index 43eaea5c..8fcc314b 100644
--- a/freebsd/sys/kern/init_main.c
+++ b/freebsd/sys/kern/init_main.c
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/kernel.h>
+#include <sys/epoch.h>
#include <sys/exec.h>
#include <sys/file.h>
#include <sys/filedesc.h>
@@ -538,6 +539,7 @@ proc0_init(void *dummy __unused)
td->td_pflags = TDP_KTHREAD;
td->td_cpuset = cpuset_thread0();
td->td_domain.dr_policy = td->td_cpuset->cs_domain;
+ epoch_thread_init(td);
prison0_init();
p->p_peers = 0;
p->p_leader = p;
diff --git a/freebsd/sys/kern/kern_mbuf.c b/freebsd/sys/kern/kern_mbuf.c
index 09cae9b2..f94eda5b 100644
--- a/freebsd/sys/kern/kern_mbuf.c
+++ b/freebsd/sys/kern/kern_mbuf.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/conf.h>
+#include <sys/domainset.h>
#include <sys/malloc.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
@@ -423,8 +424,6 @@ nd_buf_import(void *arg, void **store, int count, int domain __unused,
struct mbuf *m;
int i;
- KASSERT(!dumping, ("%s: ran out of pre-allocated mbufs", __func__));
-
q = arg;
for (i = 0; i < count; i++) {
@@ -434,6 +433,8 @@ nd_buf_import(void *arg, void **store, int count, int domain __unused,
trash_init(m, q == &nd_mbufq ? MSIZE : nd_clsize, flags);
store[i] = m;
}
+ KASSERT((flags & M_WAITOK) == 0 || i == count,
+ ("%s: ran out of pre-allocated mbufs", __func__));
return (i);
}
@@ -460,8 +461,6 @@ nd_pack_import(void *arg __unused, void **store, int count, int domain __unused,
void *clust;
int i;
- KASSERT(!dumping, ("%s: ran out of pre-allocated mbufs", __func__));
-
for (i = 0; i < count; i++) {
m = m_get(MT_DATA, M_NOWAIT);
if (m == NULL)
@@ -474,6 +473,8 @@ nd_pack_import(void *arg __unused, void **store, int count, int domain __unused,
mb_ctor_clust(clust, nd_clsize, m, 0);
store[i] = m;
}
+ KASSERT((flags & M_WAITOK) == 0 || i == count,
+ ("%s: ran out of pre-allocated mbufs", __func__));
return (i);
}
@@ -605,8 +606,9 @@ mbuf_jumbo_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *flags,
/* Inform UMA that this allocator uses kernel_map/object. */
*flags = UMA_SLAB_KERNEL;
#ifndef __rtems__
- return ((void *)kmem_alloc_contig_domain(domain, bytes, wait,
- (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0, VM_MEMATTR_DEFAULT));
+ return ((void *)kmem_alloc_contig_domainset(DOMAINSET_FIXED(domain),
+ bytes, wait, (vm_paddr_t)0, ~(vm_paddr_t)0, 1, 0,
+ VM_MEMATTR_DEFAULT));
#else /* __rtems__ */
return ((void *)malloc(bytes, M_TEMP, wait));
#endif /* __rtems__ */
diff --git a/freebsd/sys/kern/kern_sysctl.c b/freebsd/sys/kern/kern_sysctl.c
index 3baea2e4..ea9c1821 100644
--- a/freebsd/sys/kern/kern_sysctl.c
+++ b/freebsd/sys/kern/kern_sysctl.c
@@ -1704,6 +1704,53 @@ retry:
}
/*
+ * Based on on sysctl_handle_int() convert microseconds to a sbintime.
+ */
+int
+sysctl_usec_to_sbintime(SYSCTL_HANDLER_ARGS)
+{
+ int error;
+ int64_t tt;
+ sbintime_t sb;
+
+ tt = *(int64_t *)arg1;
+ sb = ustosbt(tt);
+
+ error = sysctl_handle_64(oidp, &sb, 0, req);
+ if (error || !req->newptr)
+ return (error);
+
+ tt = sbttous(sb);
+ *(int64_t *)arg1 = tt;
+
+ return (0);
+}
+
+/*
+ * Based on on sysctl_handle_int() convert milliseconds to a sbintime.
+ */
+int
+sysctl_msec_to_sbintime(SYSCTL_HANDLER_ARGS)
+{
+ int error;
+ int64_t tt;
+ sbintime_t sb;
+
+ tt = *(int64_t *)arg1;
+ sb = mstosbt(tt);
+
+ error = sysctl_handle_64(oidp, &sb, 0, req);
+ if (error || !req->newptr)
+ return (error);
+
+ tt = sbttoms(sb);
+ *(int64_t *)arg1 = tt;
+
+ return (0);
+}
+
+
+/*
* Transfer functions to/from kernel space.
* XXX: rather untested at this point
*/
diff --git a/freebsd/sys/kern/subr_blist.c b/freebsd/sys/kern/subr_blist.c
index e5b40e62..79a5a7b4 100644
--- a/freebsd/sys/kern/subr_blist.c
+++ b/freebsd/sys/kern/subr_blist.c
@@ -48,11 +48,11 @@
* upper bound on a potential allocation, but not necessarily a tight upper
* bound.
*
- * The radix tree also implements two collapsed states for meta nodes:
- * the ALL-ALLOCATED state and the ALL-FREE state. If a meta node is
- * in either of these two states, all information contained underneath
- * the node is considered stale. These states are used to optimize
- * allocation and freeing operations.
+ * The bitmap field in each node directs the search for available blocks.
+ * For a leaf node, a bit is set if the corresponding block is free. For a
+ * meta node, a bit is set if the corresponding subtree contains a free
+ * block somewhere within it. The search at a meta node considers only
+ * children of that node that represent a range that includes a free block.
*
* The hinting greatly increases code efficiency for allocations while
* the general radix structure optimizes both allocations and frees. The
@@ -61,19 +61,19 @@
*
* The blist code wires all necessary memory at creation time. Neither
* allocations nor frees require interaction with the memory subsystem.
- * The non-blocking features of the blist code are used in the swap code
- * (vm/swap_pager.c).
+ * The non-blocking nature of allocations and frees is required by swap
+ * code (vm/swap_pager.c).
*
- * LAYOUT: The radix tree is laid out recursively using a
- * linear array. Each meta node is immediately followed (laid out
- * sequentially in memory) by BLIST_META_RADIX lower level nodes. This
- * is a recursive structure but one that can be easily scanned through
- * a very simple 'skip' calculation. In order to support large radixes,
- * portions of the tree may reside outside our memory allocation. We
- * handle this with an early-termination optimization (when bighint is
- * set to -1) on the scan. The memory allocation is only large enough
- * to cover the number of blocks requested at creation time even if it
- * must be encompassed in larger root-node radix.
+ * LAYOUT: The radix tree is laid out recursively using a linear array.
+ * Each meta node is immediately followed (laid out sequentially in
+ * memory) by BLIST_META_RADIX lower level nodes. This is a recursive
+ * structure but one that can be easily scanned through a very simple
+ * 'skip' calculation. The memory allocation is only large enough to
+ * cover the number of blocks requested at creation time. Nodes that
+ * represent blocks beyond that limit, nodes that would never be read
+ * or written, are not allocated, so that the last of the
+ * BLIST_META_RADIX lower level nodes of a some nodes may not be
+ * allocated.
*
* NOTE: the allocator cannot currently allocate more than
* BLIST_BMAP_RADIX blocks per call. It will panic with 'allocation too
@@ -107,6 +107,7 @@ __FBSDID("$FreeBSD$");
#define BLIST_DEBUG
#endif
+#include <sys/errno.h>
#include <sys/types.h>
#include <sys/malloc.h>
#include <sys/sbuf.h>
@@ -120,7 +121,7 @@ __FBSDID("$FreeBSD$");
#define bitcount64(x) __bitcount64((uint64_t)(x))
#define malloc(a,b,c) calloc(a, 1)
#define free(a,b) free(a)
-static __inline int imax(int a, int b) { return (a > b ? a : b); }
+#define ummin(a,b) ((a) < (b) ? (a) : (b))
#include <sys/blist.h>
@@ -181,6 +182,18 @@ radix_to_skip(daddr_t radix)
}
/*
+ * Provide a mask with count bits set, starting as position n.
+ */
+static inline u_daddr_t
+bitrange(int n, int count)
+{
+
+ return (((u_daddr_t)-1 << n) &
+ ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - (n + count))));
+}
+
+
+/*
* Use binary search, or a faster method, to find the 1 bit in a u_daddr_t.
* Assumes that the argument has only one bit set.
*/
@@ -222,9 +235,7 @@ blist_t
blist_create(daddr_t blocks, int flags)
{
blist_t bl;
- daddr_t i, last_block;
- u_daddr_t nodes, radix, skip;
- int digit;
+ u_daddr_t nodes, radix;
if (blocks == 0)
panic("invalid block count");
@@ -232,30 +243,13 @@ blist_create(daddr_t blocks, int flags)
/*
* Calculate the radix and node count used for scanning.
*/
- last_block = blocks - 1;
+ nodes = 1;
radix = BLIST_BMAP_RADIX;
- while (radix < blocks) {
- if (((last_block / radix + 1) & BLIST_META_MASK) != 0)
- /*
- * We must widen the blist to avoid partially
- * filled nodes.
- */
- last_block |= radix - 1;
+ while (radix <= blocks) {
+ nodes += 1 + (blocks - 1) / radix;
radix *= BLIST_META_RADIX;
}
- /*
- * Count the meta-nodes in the expanded tree, including the final
- * terminator, from the bottom level up to the root.
- */
- nodes = 1;
- if (radix - blocks >= BLIST_BMAP_RADIX)
- nodes++;
- last_block /= BLIST_BMAP_RADIX;
- while (last_block > 0) {
- nodes += last_block + 1;
- last_block /= BLIST_META_RADIX;
- }
bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags |
M_ZERO);
if (bl == NULL)
@@ -263,33 +257,6 @@ blist_create(daddr_t blocks, int flags)
bl->bl_blocks = blocks;
bl->bl_radix = radix;
- bl->bl_cursor = 0;
-
- /*
- * Initialize the empty tree by filling in root values, then initialize
- * just the terminators in the rest of the tree.
- */
- bl->bl_root[0].bm_bighint = 0;
- if (radix == BLIST_BMAP_RADIX)
- bl->bl_root[0].u.bmu_bitmap = 0;
- else
- bl->bl_root[0].u.bmu_avail = 0;
- last_block = blocks - 1;
- i = 0;
- while (radix > BLIST_BMAP_RADIX) {
- radix /= BLIST_META_RADIX;
- skip = radix_to_skip(radix);
- digit = last_block / radix;
- i += 1 + digit * skip;
- if (digit != BLIST_META_MASK) {
- /*
- * Add a terminator.
- */
- bl->bl_root[i + skip].bm_bighint = (daddr_t)-1;
- bl->bl_root[i + skip].u.bmu_bitmap = 0;
- }
- last_block %= radix;
- }
#if defined(BLIST_DEBUG)
printf(
@@ -323,6 +290,9 @@ blist_alloc(blist_t bl, daddr_t count)
{
daddr_t blk;
+ if (count > BLIST_MAX_ALLOC)
+ panic("allocation too large");
+
/*
* This loop iterates at most twice. An allocation failure in the
* first iteration leads to a second iteration only if the cursor was
@@ -333,12 +303,13 @@ blist_alloc(blist_t bl, daddr_t count)
blk = blst_meta_alloc(bl->bl_root, bl->bl_cursor, count,
bl->bl_radix);
if (blk != SWAPBLK_NONE) {
+ bl->bl_avail -= count;
bl->bl_cursor = blk + count;
if (bl->bl_cursor == bl->bl_blocks)
bl->bl_cursor = 0;
return (blk);
- } else if (bl->bl_cursor != 0)
- bl->bl_cursor = 0;
+ }
+ bl->bl_cursor = 0;
}
return (SWAPBLK_NONE);
}
@@ -350,10 +321,7 @@ daddr_t
blist_avail(blist_t bl)
{
- if (bl->bl_radix == BLIST_BMAP_RADIX)
- return (bitcount64(bl->bl_root->u.bmu_bitmap));
- else
- return (bl->bl_root->u.bmu_avail);
+ return (bl->bl_avail);
}
/*
@@ -365,7 +333,10 @@ void
blist_free(blist_t bl, daddr_t blkno, daddr_t count)
{
+ if (blkno < 0 || blkno + count > bl->bl_blocks)
+ panic("freeing invalid range");
blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix);
+ bl->bl_avail += count;
}
/*
@@ -377,8 +348,13 @@ blist_free(blist_t bl, daddr_t blkno, daddr_t count)
daddr_t
blist_fill(blist_t bl, daddr_t blkno, daddr_t count)
{
+ daddr_t filled;
- return (blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix));
+ if (blkno < 0 || blkno + count > bl->bl_blocks)
+ panic("filling invalid range");
+ filled = blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix);
+ bl->bl_avail -= filled;
+ return (filled);
}
/*
@@ -416,8 +392,11 @@ blist_resize(blist_t *pbl, daddr_t count, int freenew, int flags)
void
blist_print(blist_t bl)
{
- printf("BLIST cursor = %08jx {\n", (uintmax_t)bl->bl_cursor);
- blst_radix_print(bl->bl_root, 0, bl->bl_radix, 4);
+ printf("BLIST avail = %jd, cursor = %08jx {\n",
+ (uintmax_t)bl->bl_avail, (uintmax_t)bl->bl_cursor);
+
+ if (bl->bl_root->bm_bitmap != 0)
+ blst_radix_print(bl->bl_root, 0, bl->bl_radix, 4);
printf("}\n");
}
@@ -571,16 +550,11 @@ blist_stats(blist_t bl, struct sbuf *s)
* Check for skippable subtrees starting at i.
*/
while (radix > BLIST_BMAP_RADIX) {
- if (bl->bl_root[nodes].u.bmu_avail == 0) {
+ if (bl->bl_root[nodes].bm_bitmap == 0) {
if (gap_stats_counting(stats))
update_gap_stats(stats, i);
break;
}
- if (bl->bl_root[nodes].u.bmu_avail == radix) {
- if (!gap_stats_counting(stats))
- update_gap_stats(stats, i);
- break;
- }
/*
* Skip subtree root.
@@ -592,7 +566,7 @@ blist_stats(blist_t bl, struct sbuf *s)
/*
* Scan leaf.
*/
- mask = bl->bl_root[nodes].u.bmu_bitmap;
+ mask = bl->bl_root[nodes].bm_bitmap;
diff = mask ^ (mask << 1);
if (gap_stats_counting(stats))
diff ^= 1;
@@ -620,7 +594,57 @@ blist_stats(blist_t bl, struct sbuf *s)
*/
/*
- * blist_leaf_alloc() - allocate at a leaf in the radix tree (a bitmap).
+ * BLST_NEXT_LEAF_ALLOC() - allocate the first few blocks in the next leaf.
+ *
+ * 'scan' is a leaf node, associated with a block containing 'blk'.
+ * The next leaf node could be adjacent, or several nodes away if the
+ * least common ancestor of 'scan' and its neighbor is several levels
+ * up. Use 'blk' to determine how many meta-nodes lie between the
+ * leaves. If the next leaf has enough initial bits set, clear them
+ * and clear the bits in the meta nodes on the path up to the least
+ * common ancestor to mark any subtrees made completely empty.
+ */
+static int
+blst_next_leaf_alloc(blmeta_t *scan, daddr_t blk, int count)
+{
+ blmeta_t *next;
+ daddr_t skip;
+ u_daddr_t radix;
+ int digit;
+
+ next = scan + 1;
+ blk += BLIST_BMAP_RADIX;
+ radix = BLIST_BMAP_RADIX;
+ while ((digit = ((blk / radix) & BLIST_META_MASK)) == 0 &&
+ (next->bm_bitmap & 1) == 1) {
+ next++;
+ radix *= BLIST_META_RADIX;
+ }
+ if (((next->bm_bitmap + 1) & ~((u_daddr_t)-1 << count)) != 0) {
+ /*
+ * The next leaf doesn't have enough free blocks at the
+ * beginning to complete the spanning allocation.
+ */
+ return (ENOMEM);
+ }
+ /* Clear the first 'count' bits in the next leaf to allocate. */
+ next->bm_bitmap &= (u_daddr_t)-1 << count;
+
+ /*
+ * Update bitmaps of next-ancestors, up to least common ancestor.
+ */
+ skip = radix_to_skip(radix);
+ while (radix != BLIST_BMAP_RADIX && next->bm_bitmap == 0) {
+ (--next)->bm_bitmap ^= 1;
+ radix /= BLIST_META_RADIX;
+ }
+ if (next->bm_bitmap == 0)
+ scan[-digit * skip].bm_bitmap ^= (u_daddr_t)1 << digit;
+ return (0);
+}
+
+/*
+ * BLST_LEAF_ALLOC() - allocate at a leaf in the radix tree (a bitmap).
*
* This is the core of the allocator and is optimized for the
* BLIST_BMAP_RADIX block allocation case. Otherwise, execution
@@ -635,15 +659,15 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count)
range1 = 0;
count1 = count - 1;
num_shifts = fls(count1);
- mask = scan->u.bmu_bitmap;
+ mask = scan->bm_bitmap;
while ((-mask & ~mask) != 0 && num_shifts > 0) {
/*
* If bit i is set in mask, then bits in [i, i+range1] are set
- * in scan->u.bmu_bitmap. The value of range1 is equal to
+ * in scan->bm_bitmap. The value of range1 is equal to
* count1 >> num_shifts. Grow range and reduce num_shifts to 0,
* while preserving these invariants. The updates to mask leave
* fewer bits set, but each bit that remains set represents a
- * longer string of consecutive bits set in scan->u.bmu_bitmap.
+ * longer string of consecutive bits set in scan->bm_bitmap.
* If more updates to mask cannot clear more bits, because mask
* is partitioned with all 0 bits preceding all 1 bits, the loop
* terminates immediately.
@@ -687,31 +711,14 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count)
* An allocation within this leaf is impossible, so a successful
* allocation depends on the next leaf providing some of the blocks.
*/
- if (((blk / BLIST_BMAP_RADIX + 1) & BLIST_META_MASK) == 0) {
- /*
- * The next leaf has a different meta-node parent, so it
- * is not necessarily initialized. Update bighint,
- * comparing the range found at the end of mask to the
- * largest earlier range that could have been made to
- * vanish in the initial processing of mask.
- */
- scan->bm_bighint = imax(BLIST_BMAP_RADIX - lo, range1);
- return (SWAPBLK_NONE);
- }
- hi -= BLIST_BMAP_RADIX;
- if (((scan[1].u.bmu_bitmap + 1) & ~((u_daddr_t)-1 << hi)) != 0) {
+ if (blst_next_leaf_alloc(scan, blk, hi - BLIST_BMAP_RADIX) != 0)
/*
- * The next leaf doesn't have enough free blocks at the
- * beginning to complete the spanning allocation. The
- * hint cannot be updated, because the same allocation
- * request could be satisfied later, by this leaf, if
- * the state of the next leaf changes, and without any
- * changes to this leaf.
+ * The hint cannot be updated, because the same
+ * allocation request could be satisfied later, by this
+ * leaf, if the state of the next leaf changes, and
+ * without any changes to this leaf.
*/
return (SWAPBLK_NONE);
- }
- /* Clear the first 'hi' bits in the next leaf, allocating them. */
- scan[1].u.bmu_bitmap &= (u_daddr_t)-1 << hi;
hi = BLIST_BMAP_RADIX;
}
@@ -726,12 +733,9 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count)
} else {
/* Clear the bits of mask at position 'hi' and higher. */
mask &= (u_daddr_t)-1 >> (BLIST_BMAP_RADIX - hi);
- /* If this allocation uses all the bits, clear the hint. */
- if (mask == scan->u.bmu_bitmap)
- scan->bm_bighint = 0;
}
/* Clear the allocated bits from this leaf. */
- scan->u.bmu_bitmap &= ~mask;
+ scan->bm_bitmap &= ~mask;
return ((blk & ~BLIST_BMAP_MASK) + lo);
}
@@ -746,81 +750,61 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count)
static daddr_t
blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_t count, u_daddr_t radix)
{
- daddr_t blk, i, next_skip, r, skip;
- int child;
+ daddr_t blk, i, r, skip;
+ u_daddr_t bit, mask;
bool scan_from_start;
+ int digit;
if (radix == BLIST_BMAP_RADIX)
return (blst_leaf_alloc(scan, cursor, count));
- if (scan->u.bmu_avail < count) {
- /*
- * The meta node's hint must be too large if the allocation
- * exceeds the number of free blocks. Reduce the hint, and
- * return failure.
- */
- scan->bm_bighint = scan->u.bmu_avail;
- return (SWAPBLK_NONE);
- }
blk = cursor & -radix;
+ scan_from_start = (cursor == blk);
+ radix /= BLIST_META_RADIX;
skip = radix_to_skip(radix);
- next_skip = skip / BLIST_META_RADIX;
+ mask = scan->bm_bitmap;
+
+ /* Discard any candidates that appear before cursor. */
+ digit = (cursor / radix) & BLIST_META_MASK;
+ mask &= (u_daddr_t)-1 << digit;
/*
- * An ALL-FREE meta node requires special handling before allocating
- * any of its blocks.
+ * If the first try is for a block that includes the cursor, pre-undo
+ * the digit * radix offset in the first call; otherwise, ignore the
+ * cursor entirely.
*/
- if (scan->u.bmu_avail == radix) {
- radix /= BLIST_META_RADIX;
-
- /*
- * Reinitialize each of the meta node's children. An ALL-FREE
- * meta node cannot have a terminator in any subtree.
- */
- for (i = 1; i < skip; i += next_skip) {
- if (next_skip == 1)
- scan[i].u.bmu_bitmap = (u_daddr_t)-1;
- else
- scan[i].u.bmu_avail = radix;
- scan[i].bm_bighint = radix;
- }
- } else {
- radix /= BLIST_META_RADIX;
- }
+ if (((mask >> digit) & 1) == 1)
+ cursor -= digit * radix;
+ else
+ cursor = blk;
- if (count > radix) {
- /*
- * The allocation exceeds the number of blocks that are
- * managed by a subtree of this meta node.
- */
- panic("allocation too large");
- }
- scan_from_start = cursor == blk;
- child = (cursor - blk) / radix;
- blk += child * radix;
- for (i = 1 + child * next_skip; i < skip; i += next_skip) {
+ /*
+ * Examine the nonempty subtree associated with each bit set in mask.
+ */
+ do {
+ bit = mask & -mask;
+ digit = bitpos(bit);
+ i = 1 + digit * skip;
if (count <= scan[i].bm_bighint) {
/*
* The allocation might fit beginning in the i'th subtree.
*/
- r = blst_meta_alloc(&scan[i],
- cursor > blk ? cursor : blk, count, radix);
+ r = blst_meta_alloc(&scan[i], cursor + digit * radix,
+ count, radix);
if (r != SWAPBLK_NONE) {
- scan->u.bmu_avail -= count;
+ if (scan[i].bm_bitmap == 0)
+ scan->bm_bitmap ^= bit;
return (r);
}
- } else if (scan[i].bm_bighint == (daddr_t)-1) {
- /*
- * Terminator
- */
- break;
}
- blk += radix;
- }
+ cursor = blk;
+ } while ((mask ^= bit) != 0);
/*
- * We couldn't allocate count in this subtree, update bighint.
+ * We couldn't allocate count in this subtree. If the whole tree was
+ * scanned, and the last tree node is allocated, update bighint.
*/
- if (scan_from_start && scan->bm_bighint >= count)
+ if (scan_from_start && !(digit == BLIST_META_RADIX - 1 &&
+ scan[i].bm_bighint == BLIST_MAX_ALLOC))
scan->bm_bighint = count - 1;
return (SWAPBLK_NONE);
@@ -834,7 +818,6 @@ static void
blst_leaf_free(blmeta_t *scan, daddr_t blk, int count)
{
u_daddr_t mask;
- int n;
/*
* free some data in this bitmap
@@ -842,20 +825,10 @@ blst_leaf_free(blmeta_t *scan, daddr_t blk, int count)
* \_________/\__/
* count n
*/
- n = blk & BLIST_BMAP_MASK;
- mask = ((u_daddr_t)-1 << n) &
- ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - count - n));
- if (scan->u.bmu_bitmap & mask)
+ mask = bitrange(blk & BLIST_BMAP_MASK, count);
+ if (scan->bm_bitmap & mask)
panic("freeing free block");
- scan->u.bmu_bitmap |= mask;
-
- /*
- * We could probably do a better job here. We are required to make
- * bighint at least as large as the biggest contiguous block of
- * data. If we just shoehorn it, a little extra overhead will
- * be incured on the next allocation (but only that one typically).
- */
- scan->bm_bighint = BLIST_BMAP_RADIX;
+ scan->bm_bitmap |= mask;
}
/*
@@ -871,79 +844,37 @@ blst_leaf_free(blmeta_t *scan, daddr_t blk, int count)
static void
blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, u_daddr_t radix)
{
- daddr_t blk, i, next_skip, skip, v;
- int child;
-
- if (scan->bm_bighint == (daddr_t)-1)
- panic("freeing invalid range");
- if (radix == BLIST_BMAP_RADIX)
- return (blst_leaf_free(scan, freeBlk, count));
- skip = radix_to_skip(radix);
- next_skip = skip / BLIST_META_RADIX;
-
- if (scan->u.bmu_avail == 0) {
- /*
- * ALL-ALLOCATED special case, with possible
- * shortcut to ALL-FREE special case.
- */
- scan->u.bmu_avail = count;
- scan->bm_bighint = count;
-
- if (count != radix) {
- for (i = 1; i < skip; i += next_skip) {
- if (scan[i].bm_bighint == (daddr_t)-1)
- break;
- scan[i].bm_bighint = 0;
- if (next_skip == 1) {
- scan[i].u.bmu_bitmap = 0;
- } else {
- scan[i].u.bmu_avail = 0;
- }
- }
- /* fall through */
- }
- } else {
- scan->u.bmu_avail += count;
- /* scan->bm_bighint = radix; */
- }
+ daddr_t blk, endBlk, i, skip;
+ int digit, endDigit;
/*
- * ALL-FREE special case.
+ * We could probably do a better job here. We are required to make
+ * bighint at least as large as the biggest allocable block of data.
+ * If we just shoehorn it, a little extra overhead will be incurred
+ * on the next allocation (but only that one typically).
*/
+ scan->bm_bighint = BLIST_MAX_ALLOC;
- if (scan->u.bmu_avail == radix)
- return;
- if (scan->u.bmu_avail > radix)
- panic("blst_meta_free: freeing already free blocks (%lld) %lld/%lld",
- (long long)count, (long long)scan->u.bmu_avail,
- (long long)radix);
-
- /*
- * Break the free down into its components
- */
+ if (radix == BLIST_BMAP_RADIX)
+ return (blst_leaf_free(scan, freeBlk, count));
- blk = freeBlk & -radix;
+ endBlk = ummin(freeBlk + count, (freeBlk + radix) & -radix);
radix /= BLIST_META_RADIX;
-
- child = (freeBlk - blk) / radix;
- blk += child * radix;
- i = 1 + child * next_skip;
- while (i < skip && blk < freeBlk + count) {
- v = blk + radix - freeBlk;
- if (v > count)
- v = count;
- blst_meta_free(&scan[i], freeBlk, v, radix);
- if (scan->bm_bighint < scan[i].bm_bighint)
- scan->bm_bighint = scan[i].bm_bighint;
- count -= v;
- freeBlk += v;
+ skip = radix_to_skip(radix);
+ blk = freeBlk & -radix;
+ digit = (blk / radix) & BLIST_META_MASK;
+ endDigit = 1 + (((endBlk - 1) / radix) & BLIST_META_MASK);
+ scan->bm_bitmap |= bitrange(digit, endDigit - digit);
+ for (i = 1 + digit * skip; blk < endBlk; i += skip) {
blk += radix;
- i += next_skip;
+ count = ummin(blk, endBlk) - freeBlk;
+ blst_meta_free(&scan[i], freeBlk, count, radix);
+ freeBlk = blk;
}
}
/*
- * BLIST_RADIX_COPY() - copy one radix tree to another
+ * BLST_COPY() - copy one radix tree to another
*
* Locates free space in the source tree and frees it in the destination
* tree. The space may not already be free in the destination.
@@ -952,21 +883,21 @@ static void
blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, blist_t dest,
daddr_t count)
{
- daddr_t i, next_skip, skip;
+ daddr_t endBlk, i, skip;
/*
* Leaf node
*/
if (radix == BLIST_BMAP_RADIX) {
- u_daddr_t v = scan->u.bmu_bitmap;
+ u_daddr_t v = scan->bm_bitmap;
if (v == (u_daddr_t)-1) {
blist_free(dest, blk, count);
} else if (v != 0) {
int i;
- for (i = 0; i < BLIST_BMAP_RADIX && i < count; ++i) {
+ for (i = 0; i < count; ++i) {
if (v & ((u_daddr_t)1 << i))
blist_free(dest, blk + i, 1);
}
@@ -978,42 +909,22 @@ blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, blist_t dest,
* Meta node
*/
- if (scan->u.bmu_avail == 0) {
+ if (scan->bm_bitmap == 0) {
/*
* Source all allocated, leave dest allocated
*/
return;
}
- if (scan->u.bmu_avail == radix) {
- /*
- * Source all free, free entire dest
- */
- if (count < radix)
- blist_free(dest, blk, count);
- else
- blist_free(dest, blk, radix);
- return;
- }
-
- skip = radix_to_skip(radix);
- next_skip = skip / BLIST_META_RADIX;
+ endBlk = blk + count;
radix /= BLIST_META_RADIX;
-
- for (i = 1; count && i < skip; i += next_skip) {
- if (scan[i].bm_bighint == (daddr_t)-1)
- break;
-
- if (count >= radix) {
- blst_copy(&scan[i], blk, radix, dest, radix);
- count -= radix;
- } else {
- if (count) {
- blst_copy(&scan[i], blk, radix, dest, count);
- }
- count = 0;
- }
+ skip = radix_to_skip(radix);
+ for (i = 1; blk < endBlk; i += skip) {
blk += radix;
+ count = radix;
+ if (blk >= endBlk)
+ count -= blk - endBlk;
+ blst_copy(&scan[i], blk - radix, radix, dest, count);
}
}
@@ -1029,16 +940,13 @@ blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count)
{
daddr_t nblks;
u_daddr_t mask;
- int n;
- n = blk & BLIST_BMAP_MASK;
- mask = ((u_daddr_t)-1 << n) &
- ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - count - n));
+ mask = bitrange(blk & BLIST_BMAP_MASK, count);
/* Count the number of blocks that we are allocating. */
- nblks = bitcount64(scan->u.bmu_bitmap & mask);
+ nblks = bitcount64(scan->bm_bitmap & mask);
- scan->u.bmu_bitmap &= ~mask;
+ scan->bm_bitmap &= ~mask;
return (nblks);
}
@@ -1053,70 +961,27 @@ blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count)
static daddr_t
blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count, u_daddr_t radix)
{
- daddr_t blk, i, nblks, next_skip, skip, v;
- int child;
+ daddr_t blk, endBlk, i, nblks, skip;
+ int digit;
- if (scan->bm_bighint == (daddr_t)-1)
- panic("filling invalid range");
- if (count > radix) {
- /*
- * The allocation exceeds the number of blocks that are
- * managed by this node.
- */
- panic("fill too large");
- }
if (radix == BLIST_BMAP_RADIX)
return (blst_leaf_fill(scan, allocBlk, count));
- if (count == radix || scan->u.bmu_avail == 0) {
- /*
- * ALL-ALLOCATED special case
- */
- nblks = scan->u.bmu_avail;
- scan->u.bmu_avail = 0;
- scan->bm_bighint = 0;
- return (nblks);
- }
+
+ endBlk = ummin(allocBlk + count, (allocBlk + radix) & -radix);
+ radix /= BLIST_META_RADIX;
skip = radix_to_skip(radix);
- next_skip = skip / BLIST_META_RADIX;
blk = allocBlk & -radix;
-
- /*
- * An ALL-FREE meta node requires special handling before allocating
- * any of its blocks.
- */
- if (scan->u.bmu_avail == radix) {
- radix /= BLIST_META_RADIX;
-
- /*
- * Reinitialize each of the meta node's children. An ALL-FREE
- * meta node cannot have a terminator in any subtree.
- */
- for (i = 1; i < skip; i += next_skip) {
- if (next_skip == 1)
- scan[i].u.bmu_bitmap = (u_daddr_t)-1;
- else
- scan[i].u.bmu_avail = radix;
- scan[i].bm_bighint = radix;
- }
- } else {
- radix /= BLIST_META_RADIX;
- }
-
nblks = 0;
- child = (allocBlk - blk) / radix;
- blk += child * radix;
- i = 1 + child * next_skip;
- while (i < skip && blk < allocBlk + count) {
- v = blk + radix - allocBlk;
- if (v > count)
- v = count;
- nblks += blst_meta_fill(&scan[i], allocBlk, v, radix);
- count -= v;
- allocBlk += v;
+ while (blk < endBlk) {
+ digit = (blk / radix) & BLIST_META_MASK;
+ i = 1 + digit * skip;
blk += radix;
- i += next_skip;
+ count = ummin(blk, endBlk) - allocBlk;
+ nblks += blst_meta_fill(&scan[i], allocBlk, count, radix);
+ if (scan[i].bm_bitmap == 0)
+ scan->bm_bitmap &= ~((u_daddr_t)1 << digit);
+ allocBlk = blk;
}
- scan->u.bmu_avail -= nblks;
return (nblks);
}
@@ -1125,64 +990,44 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count, u_daddr_t radix)
static void
blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int tab)
{
- daddr_t i, next_skip, skip;
+ daddr_t skip;
+ u_daddr_t bit, mask;
+ int digit;
if (radix == BLIST_BMAP_RADIX) {
printf(
- "%*.*s(%08llx,%lld): bitmap %016llx big=%lld\n",
+ "%*.*s(%08llx,%lld): bitmap %0*llx big=%lld\n",
tab, tab, "",
(long long)blk, (long long)radix,
- (long long)scan->u.bmu_bitmap,
+ 1 + (BLIST_BMAP_RADIX - 1) / 4,
+ (long long)scan->bm_bitmap,
(long long)scan->bm_bighint
);
return;
}
- if (scan->u.bmu_avail == 0) {
- printf(
- "%*.*s(%08llx,%lld) ALL ALLOCATED\n",
- tab, tab, "",
- (long long)blk,
- (long long)radix
- );
- return;
- }
- if (scan->u.bmu_avail == radix) {
- printf(
- "%*.*s(%08llx,%lld) ALL FREE\n",
- tab, tab, "",
- (long long)blk,
- (long long)radix
- );
- return;
- }
-
printf(
- "%*.*s(%08llx,%lld): subtree (%lld/%lld) big=%lld {\n",
+ "%*.*s(%08llx): subtree (%lld/%lld) bitmap %0*llx big=%lld {\n",
tab, tab, "",
(long long)blk, (long long)radix,
- (long long)scan->u.bmu_avail,
(long long)radix,
+ 1 + (BLIST_META_RADIX - 1) / 4,
+ (long long)scan->bm_bitmap,
(long long)scan->bm_bighint
);
- skip = radix_to_skip(radix);
- next_skip = skip / BLIST_META_RADIX;
radix /= BLIST_META_RADIX;
+ skip = radix_to_skip(radix);
tab += 4;
- for (i = 1; i < skip; i += next_skip) {
- if (scan[i].bm_bighint == (daddr_t)-1) {
- printf(
- "%*.*s(%08llx,%lld): Terminator\n",
- tab, tab, "",
- (long long)blk, (long long)radix
- );
- break;
- }
- blst_radix_print(&scan[i], blk, radix, tab);
- blk += radix;
- }
+ mask = scan->bm_bitmap;
+ /* Examine the nonempty subtree associated with each bit set in mask */
+ do {
+ bit = mask & -mask;
+ digit = bitpos(bit);
+ blst_radix_print(&scan[1 + digit * skip], blk + digit * radix,
+ radix, tab);
+ } while ((mask ^= bit) != 0);
tab -= 4;
printf(
@@ -1198,7 +1043,7 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int tab)
int
main(int ac, char **av)
{
- int size = 1024;
+ int size = BLIST_META_RADIX * BLIST_BMAP_RADIX;
int i;
blist_t bl;
struct sbuf *s;
diff --git a/freebsd/sys/kern/subr_gtaskqueue.c b/freebsd/sys/kern/subr_gtaskqueue.c
index e56e90d7..3f80cd2c 100644
--- a/freebsd/sys/kern/subr_gtaskqueue.c
+++ b/freebsd/sys/kern/subr_gtaskqueue.c
@@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$");
static MALLOC_DEFINE(M_GTASKQUEUE, "gtaskqueue", "Group Task Queues");
static void gtaskqueue_thread_enqueue(void *);
static void gtaskqueue_thread_loop(void *arg);
+static int task_is_running(struct gtaskqueue *queue, struct gtask *gtask);
+static void gtaskqueue_drain_locked(struct gtaskqueue *queue, struct gtask *gtask);
TASKQGROUP_DEFINE(softirq, mp_ncpus, 1);
TASKQGROUP_DEFINE(config, 1, 1);
@@ -188,6 +190,44 @@ gtaskqueue_free(struct gtaskqueue *queue)
free(queue, M_GTASKQUEUE);
}
+/*
+ * Wait for all to complete, then prevent it from being enqueued
+ */
+void
+grouptask_block(struct grouptask *grouptask)
+{
+ struct gtaskqueue *queue = grouptask->gt_taskqueue;
+ struct gtask *gtask = &grouptask->gt_task;
+
+#ifdef INVARIANTS
+ if (queue == NULL) {
+ gtask_dump(gtask);
+ panic("queue == NULL");
+ }
+#endif
+ TQ_LOCK(queue);
+ gtask->ta_flags |= TASK_NOENQUEUE;
+ gtaskqueue_drain_locked(queue, gtask);
+ TQ_UNLOCK(queue);
+}
+
+void
+grouptask_unblock(struct grouptask *grouptask)
+{
+ struct gtaskqueue *queue = grouptask->gt_taskqueue;
+ struct gtask *gtask = &grouptask->gt_task;
+
+#ifdef INVARIANTS
+ if (queue == NULL) {
+ gtask_dump(gtask);
+ panic("queue == NULL");
+ }
+#endif
+ TQ_LOCK(queue);
+ gtask->ta_flags &= ~TASK_NOENQUEUE;
+ TQ_UNLOCK(queue);
+}
+
int
grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *gtask)
{
@@ -202,6 +242,10 @@ grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *gtask)
TQ_UNLOCK(queue);
return (0);
}
+ if (gtask->ta_flags & TASK_NOENQUEUE) {
+ TQ_UNLOCK(queue);
+ return (EAGAIN);
+ }
STAILQ_INSERT_TAIL(&queue->tq_queue, gtask, ta_link);
gtask->ta_flags |= TASK_ENQUEUED;
TQ_UNLOCK(queue);
@@ -383,6 +427,13 @@ gtaskqueue_cancel(struct gtaskqueue *queue, struct gtask *gtask)
return (error);
}
+static void
+gtaskqueue_drain_locked(struct gtaskqueue *queue, struct gtask *gtask)
+{
+ while ((gtask->ta_flags & TASK_ENQUEUED) || task_is_running(queue, gtask))
+ TQ_SLEEP(queue, gtask, &queue->tq_mutex, PWAIT, "-", 0);
+}
+
void
gtaskqueue_drain(struct gtaskqueue *queue, struct gtask *gtask)
{
@@ -391,8 +442,7 @@ gtaskqueue_drain(struct gtaskqueue *queue, struct gtask *gtask)
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__);
TQ_LOCK(queue);
- while ((gtask->ta_flags & TASK_ENQUEUED) || task_is_running(queue, gtask))
- TQ_SLEEP(queue, gtask, &queue->tq_mutex, PWAIT, "-", 0);
+ gtaskqueue_drain_locked(queue, gtask);
TQ_UNLOCK(queue);
}
@@ -857,6 +907,7 @@ taskqgroup_detach(struct taskqgroup *qgroup, struct grouptask *gtask)
{
int i;
+ grouptask_block(gtask);
mtx_lock(&qgroup->tqg_lock);
for (i = 0; i < qgroup->tqg_cnt; i++)
if (qgroup->tqg_queue[i].tgc_taskq == gtask->gt_taskqueue)
@@ -867,6 +918,7 @@ taskqgroup_detach(struct taskqgroup *qgroup, struct grouptask *gtask)
LIST_REMOVE(gtask, gt_list);
mtx_unlock(&qgroup->tqg_lock);
gtask->gt_taskqueue = NULL;
+ gtask->gt_task.ta_flags &= ~TASK_NOENQUEUE;
}
static void
diff --git a/freebsd/sys/kern/sys_generic.c b/freebsd/sys/kern/sys_generic.c
index b0da68a8..70638ad0 100644
--- a/freebsd/sys/kern/sys_generic.c
+++ b/freebsd/sys/kern/sys_generic.c
@@ -1366,16 +1366,15 @@ sys_poll(struct thread *td, struct poll_args *uap)
}
int
-kern_poll(struct thread *td, struct pollfd *fds, u_int nfds,
+kern_poll(struct thread *td, struct pollfd *ufds, u_int nfds,
struct timespec *tsp, sigset_t *uset)
{
- struct pollfd *bits;
- struct pollfd smallbits[32];
+ struct pollfd *kfds;
+ struct pollfd stackfds[32];
sbintime_t sbt, precision, tmp;
time_t over;
struct timespec ts;
int error;
- size_t ni;
precision = 0;
if (tsp != NULL) {
@@ -1402,18 +1401,24 @@ kern_poll(struct thread *td, struct pollfd *fds, u_int nfds,
} else
sbt = -1;
+ /*
+ * This is kinda bogus. We have fd limits, but that is not
+ * really related to the size of the pollfd array. Make sure
+ * we let the process use at least FD_SETSIZE entries and at
+ * least enough for the system-wide limits. We want to be reasonably
+ * safe, but not overly restrictive.
+ */
#ifndef __rtems__
if (nfds > maxfilesperproc && nfds > FD_SETSIZE)
#else /* __rtems__ */
if (nfds > rtems_libio_number_iops)
#endif /* __rtems__ */
return (EINVAL);
- ni = nfds * sizeof(struct pollfd);
- if (ni > sizeof(smallbits))
- bits = malloc(ni, M_TEMP, M_WAITOK);
+ if (nfds > nitems(stackfds))
+ kfds = mallocarray(nfds, sizeof(*kfds), M_TEMP, M_WAITOK);
else
- bits = smallbits;
- error = copyin(fds, bits, ni);
+ kfds = stackfds;
+ error = copyin(ufds, kfds, nfds * sizeof(*kfds));
if (error)
goto done;
@@ -1438,7 +1443,7 @@ kern_poll(struct thread *td, struct pollfd *fds, u_int nfds,
seltdinit(td);
/* Iterate until the timeout expires or descriptors become ready. */
for (;;) {
- error = pollscan(td, bits, nfds);
+ error = pollscan(td, kfds, nfds);
if (error || td->td_retval[0] != 0)
break;
error = seltdwait(td, sbt, precision);
@@ -1457,13 +1462,13 @@ done:
if (error == EWOULDBLOCK)
error = 0;
if (error == 0) {
- error = pollout(td, bits, fds, nfds);
+ error = pollout(td, kfds, ufds, nfds);
if (error)
goto out;
}
out:
- if (ni > sizeof(smallbits))
- free(bits, M_TEMP);
+ if (nfds > nitems(stackfds))
+ free(kfds, M_TEMP);
return (error);
}
#ifdef __rtems__
diff --git a/freebsd/sys/kern/sys_pipe.c b/freebsd/sys/kern/sys_pipe.c
index f562b38f..b6616271 100755
--- a/freebsd/sys/kern/sys_pipe.c
+++ b/freebsd/sys/kern/sys_pipe.c
@@ -593,9 +593,8 @@ retry:
#ifndef __rtems__
buffer = (caddr_t) vm_map_min(pipe_map);
- error = vm_map_find(pipe_map, NULL, 0,
- (vm_offset_t *) &buffer, size, 0, VMFS_ANY_SPACE,
- VM_PROT_ALL, VM_PROT_ALL, 0);
+ error = vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, size, 0,
+ VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0);
if (error != KERN_SUCCESS) {
#else /* __rtems__ */
(void)error;
diff --git a/freebsd/sys/kern/tty.c b/freebsd/sys/kern/tty.c
index f4a2b01f..aa9734cf 100644
--- a/freebsd/sys/kern/tty.c
+++ b/freebsd/sys/kern/tty.c
@@ -35,6 +35,7 @@
__FBSDID("$FreeBSD$");
#include <rtems/bsd/local/opt_capsicum.h>
+#include <rtems/bsd/local/opt_printf.h>
#include <sys/param.h>
#include <sys/capsicum.h>
@@ -108,6 +109,12 @@ SYSCTL_INT(_kern, OID_AUTO, tty_drainwait, CTLFLAG_RWTUN,
#define TTYBUF_MAX 65536
+#ifdef PRINTF_BUFR_SIZE
+#define TTY_PRBUF_SIZE PRINTF_BUFR_SIZE
+#else
+#define TTY_PRBUF_SIZE 256
+#endif
+
/*
* Allocate buffer space if necessary, and set low watermarks, based on speed.
* Note that the ttyxxxq_setsize() functions may drop and then reacquire the tty
@@ -1065,7 +1072,9 @@ tty_alloc_mutex(struct ttydevsw *tsw, void *sc, struct mtx *mutex)
PATCH_FUNC(busy);
#undef PATCH_FUNC
- tp = malloc(sizeof(struct tty), M_TTY, M_WAITOK|M_ZERO);
+ tp = malloc(sizeof(struct tty) + TTY_PRBUF_SIZE, M_TTY,
+ M_WAITOK | M_ZERO);
+ tp->t_prbufsz = TTY_PRBUF_SIZE;
tp->t_devsw = tsw;
tp->t_devswsoftc = sc;
tp->t_flags = tsw->tsw_flags;
diff --git a/freebsd/sys/kern/uipc_syscalls.c b/freebsd/sys/kern/uipc_syscalls.c
index 992df712..f338629e 100644
--- a/freebsd/sys/kern/uipc_syscalls.c
+++ b/freebsd/sys/kern/uipc_syscalls.c
@@ -90,10 +90,12 @@ struct getsockaddr_sockaddr {
char data[SOCK_MAXADDRLEN - sizeof(struct sockaddr)];
} __aligned(sizeof(long));
-static int getsockaddr(struct sockaddr **, caddr_t, size_t);
+static int getsockaddr(struct sockaddr **, const struct sockaddr *, size_t);
static int kern_getsockname(struct thread *, int, struct sockaddr **,
socklen_t *);
static int kern_listen(struct thread *, int, int);
+static int kern_setsockopt(struct thread *, int, int, int, const void *,
+ enum uio_seg, socklen_t);
static int kern_shutdown(struct thread *, int, int);
static int kern_socket(struct thread *, int, int, int);
static int kern_socketpair(struct thread *, int, int, int, int *);
@@ -287,7 +289,7 @@ bind(int socket, const struct sockaddr *address, socklen_t address_len)
struct thread *td = rtems_bsd_get_curthread_or_null();
struct bind_args ua = {
.s = socket,
- .name = (caddr_t) address,
+ .name = address,
.namelen = address_len
};
int error;
@@ -363,6 +365,9 @@ sys_bindat(struct thread *td, struct bindat_args *uap)
}
#endif /* __rtems__ */
+#ifdef __rtems__
+static
+#endif /* __rtems__ */
int
sys_listen(struct thread *td, struct listen_args *uap)
{
@@ -681,7 +686,7 @@ connect(int socket, const struct sockaddr *address, socklen_t address_len)
struct thread *td = rtems_bsd_get_curthread_or_null();
struct connect_args ua = {
.s = socket,
- .name = (caddr_t) address,
+ .name = address,
.namelen = address_len
};
int error;
@@ -1111,7 +1116,7 @@ sys_sendto(struct thread *td, struct sendto_args *uap)
struct msghdr msg;
struct iovec aiov;
- msg.msg_name = uap->to;
+ msg.msg_name = __DECONST(void *, uap->to);
msg.msg_namelen = uap->tolen;
msg.msg_iov = &aiov;
msg.msg_iovlen = 1;
@@ -1119,7 +1124,7 @@ sys_sendto(struct thread *td, struct sendto_args *uap)
#ifdef COMPAT_OLDSOCK
msg.msg_flags = 0;
#endif
- aiov.iov_base = uap->buf;
+ aiov.iov_base = __DECONST(void *, uap->buf);
aiov.iov_len = uap->len;
return (sendit(td, uap->s, &msg, uap->flags));
}
@@ -1134,7 +1139,7 @@ sendto(int socket, const void *message, size_t length, int flags,
.buf = (caddr_t) message,
.len = length,
.flags = flags,
- .to = (caddr_t) dest_addr,
+ .to = dest_addr,
.tolen = dest_len
};
int error;
@@ -1189,7 +1194,7 @@ osend(struct thread *td, struct osend_args *uap)
msg.msg_namelen = 0;
msg.msg_iov = &aiov;
msg.msg_iovlen = 1;
- aiov.iov_base = uap->buf;
+ aiov.iov_base = __DECONST(void *, uap->buf);
aiov.iov_len = uap->len;
msg.msg_control = 0;
msg.msg_flags = 0;
@@ -1669,9 +1674,6 @@ shutdown(int socket, int how)
#endif /* __rtems__ */
#ifdef __rtems__
-static int kern_setsockopt( struct thread *td, int s, int level, int name,
- void *val, enum uio_seg valseg, socklen_t valsize);
-
static
#endif /* __rtems__ */
int
@@ -1707,7 +1709,7 @@ setsockopt(int socket, int level, int option_name, const void *option_value,
#endif /* __rtems__ */
int
-kern_setsockopt(struct thread *td, int s, int level, int name, void *val,
+kern_setsockopt(struct thread *td, int s, int level, int name, const void *val,
enum uio_seg valseg, socklen_t valsize)
{
struct socket *so;
@@ -1723,7 +1725,7 @@ kern_setsockopt(struct thread *td, int s, int level, int name, void *val,
sopt.sopt_dir = SOPT_SET;
sopt.sopt_level = level;
sopt.sopt_name = name;
- sopt.sopt_val = val;
+ sopt.sopt_val = __DECONST(void *, val);
sopt.sopt_valsize = valsize;
switch (valseg) {
case UIO_USERSPACE:
@@ -2111,7 +2113,7 @@ sockargs(struct mbuf **mp, char *buf, socklen_t buflen, int type)
}
int
-getsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len)
+getsockaddr(struct sockaddr **namp, const struct sockaddr *uaddr, size_t len)
{
struct sockaddr *sa;
#ifndef __rtems__
diff --git a/freebsd/sys/net/if.c b/freebsd/sys/net/if.c
index 7721af11..d846482e 100644
--- a/freebsd/sys/net/if.c
+++ b/freebsd/sys/net/if.c
@@ -1131,6 +1131,9 @@ if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp)
* the work top-down for us.
*/
if (shutdown) {
+ /* Give interface users the chance to clean up. */
+ EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
+
/*
* In case of a vmove we are done here without error.
* If we would signal an error it would lead to the same
@@ -1773,35 +1776,29 @@ if_data_copy(struct ifnet *ifp, struct if_data *ifd)
void
if_addr_rlock(struct ifnet *ifp)
{
- MPASS(*(uint64_t *)&ifp->if_addr_et == 0);
- epoch_enter_preempt(net_epoch_preempt, &ifp->if_addr_et);
+
+ epoch_enter_preempt(net_epoch_preempt, curthread->td_et);
}
void
if_addr_runlock(struct ifnet *ifp)
{
- epoch_exit_preempt(net_epoch_preempt, &ifp->if_addr_et);
-#ifdef INVARIANTS
- bzero(&ifp->if_addr_et, sizeof(struct epoch_tracker));
-#endif
+
+ epoch_exit_preempt(net_epoch_preempt, curthread->td_et);
}
void
if_maddr_rlock(if_t ifp)
{
- MPASS(*(uint64_t *)&ifp->if_maddr_et == 0);
- epoch_enter_preempt(net_epoch_preempt, &ifp->if_maddr_et);
+ epoch_enter_preempt(net_epoch_preempt, curthread->td_et);
}
void
if_maddr_runlock(if_t ifp)
{
- epoch_exit_preempt(net_epoch_preempt, &ifp->if_maddr_et);
-#ifdef INVARIANTS
- bzero(&ifp->if_maddr_et, sizeof(struct epoch_tracker));
-#endif
+ epoch_exit_preempt(net_epoch_preempt, curthread->td_et);
}
/*
diff --git a/freebsd/sys/net/if_ethersubr.c b/freebsd/sys/net/if_ethersubr.c
index 01e757e5..96ed309a 100644
--- a/freebsd/sys/net/if_ethersubr.c
+++ b/freebsd/sys/net/if_ethersubr.c
@@ -477,6 +477,26 @@ ether_output_frame(struct ifnet *ifp, struct mbuf *m)
return (0);
}
+#ifdef EXPERIMENTAL
+#if defined(INET6) && defined(INET)
+ /* draft-ietf-6man-ipv6only-flag */
+ /* Catch ETHERTYPE_IP, and ETHERTYPE_ARP if we are v6-only. */
+ if ((ND_IFINFO(ifp)->flags & ND6_IFF_IPV6_ONLY) != 0) {
+ struct ether_header *eh;
+
+ eh = mtod(m, struct ether_header *);
+ switch (ntohs(eh->ether_type)) {
+ case ETHERTYPE_IP:
+ case ETHERTYPE_ARP:
+ m_freem(m);
+ return (EAFNOSUPPORT);
+ /* NOTREACHED */
+ break;
+ };
+ }
+#endif
+#endif
+
/*
* Queue message on interface, update output statistics if
* successful, and start output if interface not yet active.
diff --git a/freebsd/sys/net/if_ipsec.c b/freebsd/sys/net/if_ipsec.c
index 08465911..7cc2c961 100644
--- a/freebsd/sys/net/if_ipsec.c
+++ b/freebsd/sys/net/if_ipsec.c
@@ -220,6 +220,12 @@ ipsec_clone_destroy(struct ifnet *ifp)
sx_xlock(&ipsec_ioctl_sx);
sc = ifp->if_softc;
ipsec_delete_tunnel(sc);
+ /*
+ * Delete softc from idhash on interface destroy, since
+ * ipsec_delete_tunnel() keeps reqid unchanged.
+ */
+ if (sc->reqid != 0)
+ CK_LIST_REMOVE(sc, idhash);
bpfdetach(ifp);
if_detach(ifp);
ifp->if_softc = NULL;
@@ -273,6 +279,13 @@ vnet_ipsec_uninit(const void *unused __unused)
if_clone_detach(V_ipsec_cloner);
free(V_ipsec_idhtbl, M_IPSEC);
+ /*
+ * Use V_ipsec_idhtbl pointer as indicator that VNET is going to be
+ * destroyed, it is used by ipsec_srcaddr() callback.
+ */
+ V_ipsec_idhtbl = NULL;
+ IPSEC_WAIT();
+
#ifdef INET
if (IS_DEFAULT_VNET(curvnet))
ip_encap_unregister_srcaddr(ipsec4_srctab);
@@ -785,6 +798,10 @@ ipsec_srcaddr(void *arg __unused, const struct sockaddr *sa,
struct ipsec_softc *sc;
struct secasindex *saidx;
+ /* Check that VNET is ready */
+ if (V_ipsec_idhtbl == NULL)
+ return;
+
MPASS(in_epoch(net_epoch_preempt));
CK_LIST_FOREACH(sc, ipsec_srchash(sa), srchash) {
if (sc->family == 0)
@@ -1031,13 +1048,11 @@ ipsec_delete_tunnel(struct ipsec_softc *sc)
sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
if (sc->family != 0) {
CK_LIST_REMOVE(sc, srchash);
- IPSEC_WAIT();
-
+ sc->family = 0;
/*
* Make sure that ipsec_if_input() will not do access
* to softc's policies.
*/
- sc->family = 0;
IPSEC_WAIT();
key_unregister_ifnet(sc->sp, IPSEC_SPCOUNT);
diff --git a/freebsd/sys/net/if_lagg.c b/freebsd/sys/net/if_lagg.c
index 632ea744..85099115 100644
--- a/freebsd/sys/net/if_lagg.c
+++ b/freebsd/sys/net/if_lagg.c
@@ -635,11 +635,18 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
{
struct lagg_softc *sc_ptr;
struct lagg_port *lp, *tlp;
- int error, i;
+ struct ifreq ifr;
+ int error, i, oldmtu;
uint64_t *pval;
LAGG_XLOCK_ASSERT(sc);
+ if (sc->sc_ifp == ifp) {
+ if_printf(sc->sc_ifp,
+ "cannot add a lagg to itself as a port\n");
+ return (EINVAL);
+ }
+
/* Limit the maximal number of lagg ports */
if (sc->sc_count >= LAGG_MAX_PORTS)
return (ENOSPC);
@@ -658,12 +665,25 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
return (EPROTONOSUPPORT);
/* Allow the first Ethernet member to define the MTU */
- if (CK_SLIST_EMPTY(&sc->sc_ports))
+ oldmtu = -1;
+ if (CK_SLIST_EMPTY(&sc->sc_ports)) {
sc->sc_ifp->if_mtu = ifp->if_mtu;
- else if (sc->sc_ifp->if_mtu != ifp->if_mtu) {
- if_printf(sc->sc_ifp, "invalid MTU for %s\n",
- ifp->if_xname);
- return (EINVAL);
+ } else if (sc->sc_ifp->if_mtu != ifp->if_mtu) {
+ if (ifp->if_ioctl == NULL) {
+ if_printf(sc->sc_ifp, "cannot change MTU for %s\n",
+ ifp->if_xname);
+ return (EINVAL);
+ }
+ oldmtu = ifp->if_mtu;
+ strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name));
+ ifr.ifr_mtu = sc->sc_ifp->if_mtu;
+ error = (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr);
+ if (error != 0) {
+ if_printf(sc->sc_ifp, "invalid MTU for %s\n",
+ ifp->if_xname);
+ return (error);
+ }
+ ifr.ifr_mtu = oldmtu;
}
lp = malloc(sizeof(struct lagg_port), M_DEVBUF, M_WAITOK|M_ZERO);
@@ -675,6 +695,9 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
if (ifp == sc_ptr->sc_ifp) {
LAGG_LIST_UNLOCK();
free(lp, M_DEVBUF);
+ if (oldmtu != -1)
+ (*ifp->if_ioctl)(ifp, SIOCSIFMTU,
+ (caddr_t)&ifr);
return (EINVAL);
/* XXX disable stacking for the moment, its untested */
#ifdef LAGG_PORT_STACKING
@@ -683,6 +706,9 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
LAGG_MAX_STACKING) {
LAGG_LIST_UNLOCK();
free(lp, M_DEVBUF);
+ if (oldmtu != -1)
+ (*ifp->if_ioctl)(ifp, SIOCSIFMTU,
+ (caddr_t)&ifr);
return (E2BIG);
}
#endif
@@ -748,6 +774,8 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
if ((error = lagg_proto_addport(sc, lp)) != 0) {
/* Remove the port, without calling pr_delport. */
lagg_port_destroy(lp, 0);
+ if (oldmtu != -1)
+ (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr);
return (error);
}
@@ -1466,8 +1494,31 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
case SIOCSIFMTU:
- /* Do not allow the MTU to be directly changed */
- error = EINVAL;
+ LAGG_XLOCK(sc);
+ CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) {
+ if (lp->lp_ioctl != NULL)
+ error = (*lp->lp_ioctl)(lp->lp_ifp, cmd, data);
+ else
+ error = EINVAL;
+ if (error != 0) {
+ if_printf(ifp,
+ "failed to change MTU to %d on port %s, "
+ "reverting all ports to original MTU (%d)\n",
+ ifr->ifr_mtu, lp->lp_ifp->if_xname, ifp->if_mtu);
+ break;
+ }
+ }
+ if (error == 0) {
+ ifp->if_mtu = ifr->ifr_mtu;
+ } else {
+ /* set every port back to the original MTU */
+ ifr->ifr_mtu = ifp->if_mtu;
+ CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) {
+ if (lp->lp_ioctl != NULL)
+ (*lp->lp_ioctl)(lp->lp_ifp, cmd, data);
+ }
+ }
+ LAGG_XUNLOCK(sc);
break;
default:
diff --git a/freebsd/sys/net/if_stf.c b/freebsd/sys/net/if_stf.c
index 1102a62d..3ba9f8c0 100644
--- a/freebsd/sys/net/if_stf.c
+++ b/freebsd/sys/net/if_stf.c
@@ -373,6 +373,7 @@ stf_encapcheck(const struct mbuf *m, int off, int proto, void *arg)
static int
stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *addr, struct in6_addr *mask)
{
+ struct rm_priotracker in_ifa_tracker;
struct ifaddr *ia;
struct in_ifaddr *ia4;
struct in6_ifaddr *ia6;
@@ -388,9 +389,11 @@ stf_getsrcifa6(struct ifnet *ifp, struct in6_addr *addr, struct in6_addr *mask)
continue;
bcopy(GET_V4(&sin6->sin6_addr), &in, sizeof(in));
+ IN_IFADDR_RLOCK(&in_ifa_tracker);
LIST_FOREACH(ia4, INADDR_HASH(in.s_addr), ia_hash)
if (ia4->ia_addr.sin_addr.s_addr == in.s_addr)
break;
+ IN_IFADDR_RUNLOCK(&in_ifa_tracker);
if (ia4 == NULL)
continue;
diff --git a/freebsd/sys/net/if_var.h b/freebsd/sys/net/if_var.h
index 6504837b..d23928e5 100644
--- a/freebsd/sys/net/if_var.h
+++ b/freebsd/sys/net/if_var.h
@@ -390,8 +390,6 @@ struct ifnet {
struct netdump_methods *if_netdump_methods;
#endif /* __rtems__ */
struct epoch_context if_epoch_ctx;
- struct epoch_tracker if_addr_et;
- struct epoch_tracker if_maddr_et;
#ifndef __rtems__
/*
diff --git a/freebsd/sys/net/pfvar.h b/freebsd/sys/net/pfvar.h
index 5e80b665..2924c06d 100644
--- a/freebsd/sys/net/pfvar.h
+++ b/freebsd/sys/net/pfvar.h
@@ -824,13 +824,21 @@ typedef void pfsync_update_state_t(struct pf_state *);
typedef void pfsync_delete_state_t(struct pf_state *);
typedef void pfsync_clear_states_t(u_int32_t, const char *);
typedef int pfsync_defer_t(struct pf_state *, struct mbuf *);
-
-extern pfsync_state_import_t *pfsync_state_import_ptr;
-extern pfsync_insert_state_t *pfsync_insert_state_ptr;
-extern pfsync_update_state_t *pfsync_update_state_ptr;
-extern pfsync_delete_state_t *pfsync_delete_state_ptr;
-extern pfsync_clear_states_t *pfsync_clear_states_ptr;
-extern pfsync_defer_t *pfsync_defer_ptr;
+typedef void pfsync_detach_ifnet_t(struct ifnet *);
+
+VNET_DECLARE(pfsync_state_import_t *, pfsync_state_import_ptr);
+#define V_pfsync_state_import_ptr VNET(pfsync_state_import_ptr)
+VNET_DECLARE(pfsync_insert_state_t *, pfsync_insert_state_ptr);
+#define V_pfsync_insert_state_ptr VNET(pfsync_insert_state_ptr)
+VNET_DECLARE(pfsync_update_state_t *, pfsync_update_state_ptr);
+#define V_pfsync_update_state_ptr VNET(pfsync_update_state_ptr)
+VNET_DECLARE(pfsync_delete_state_t *, pfsync_delete_state_ptr);
+#define V_pfsync_delete_state_ptr VNET(pfsync_delete_state_ptr)
+VNET_DECLARE(pfsync_clear_states_t *, pfsync_clear_states_ptr);
+#define V_pfsync_clear_states_ptr VNET(pfsync_clear_states_ptr)
+VNET_DECLARE(pfsync_defer_t *, pfsync_defer_ptr);
+#define V_pfsync_defer_ptr VNET(pfsync_defer_ptr)
+extern pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr;
void pfsync_state_export(struct pfsync_state *,
struct pf_state *);
@@ -1205,6 +1213,19 @@ struct pf_divert {
#define PFR_KENTRY_HIWAT 200000 /* Number of table entries */
/*
+ * Limit the length of the fragment queue traversal. Remember
+ * search entry points based on the fragment offset.
+ */
+#define PF_FRAG_ENTRY_POINTS 16
+
+/*
+ * The number of entries in the fragment queue must be limited
+ * to avoid DoS by linear seaching. Instead of a global limit,
+ * use a limit per entry point. For large packets these sum up.
+ */
+#define PF_FRAG_ENTRY_LIMIT 64
+
+/*
* ioctl parameter structures
*/
diff --git a/freebsd/sys/netinet/icmp6.h b/freebsd/sys/netinet/icmp6.h
index 310684b8..d4da06d0 100644
--- a/freebsd/sys/netinet/icmp6.h
+++ b/freebsd/sys/netinet/icmp6.h
@@ -244,6 +244,10 @@ struct nd_router_advert { /* router advertisement */
#define ND_RA_FLAG_RTPREF_LOW 0x18 /* 00011000 */
#define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */
+#ifdef EXPERIMENTAL
+#define ND_RA_FLAG_IPV6_ONLY 0x02 /* draft-ietf-6man-ipv6only-flag */
+#endif
+
#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
struct nd_neighbor_solicit { /* neighbor solicitation */
diff --git a/freebsd/sys/netinet/in_gif.c b/freebsd/sys/netinet/in_gif.c
index b8732a33..be0303d0 100644
--- a/freebsd/sys/netinet/in_gif.c
+++ b/freebsd/sys/netinet/in_gif.c
@@ -150,7 +150,8 @@ in_gif_srcaddr(void *arg __unused, const struct sockaddr *sa,
const struct sockaddr_in *sin;
struct gif_softc *sc;
- if (V_ipv4_srchashtbl == NULL)
+ /* Check that VNET is ready */
+ if (V_ipv4_hashtbl == NULL)
return;
MPASS(in_epoch(net_epoch_preempt));
@@ -459,6 +460,8 @@ in_gif_uninit(void)
}
if (V_ipv4_hashtbl != NULL) {
gif_hashdestroy(V_ipv4_hashtbl);
+ V_ipv4_hashtbl = NULL;
+ GIF_WAIT();
gif_hashdestroy(V_ipv4_srchashtbl);
}
}
diff --git a/freebsd/sys/netinet/in_mcast.c b/freebsd/sys/netinet/in_mcast.c
index e0fd4c37..3b1d57f8 100644
--- a/freebsd/sys/netinet/in_mcast.c
+++ b/freebsd/sys/netinet/in_mcast.c
@@ -1446,6 +1446,7 @@ static int
inp_block_unblock_source(struct inpcb *inp, struct sockopt *sopt)
{
struct group_source_req gsr;
+ struct rm_priotracker in_ifa_tracker;
sockunion_t *gsa, *ssa;
struct ifnet *ifp;
struct in_mfilter *imf;
@@ -1483,9 +1484,11 @@ inp_block_unblock_source(struct inpcb *inp, struct sockopt *sopt)
ssa->sin.sin_len = sizeof(struct sockaddr_in);
ssa->sin.sin_addr = mreqs.imr_sourceaddr;
- if (!in_nullhost(mreqs.imr_interface))
+ if (!in_nullhost(mreqs.imr_interface)) {
+ IN_IFADDR_RLOCK(&in_ifa_tracker);
INADDR_TO_IFP(mreqs.imr_interface, ifp);
-
+ IN_IFADDR_RUNLOCK(&in_ifa_tracker);
+ }
if (sopt->sopt_name == IP_BLOCK_SOURCE)
doblock = 1;
@@ -1971,7 +1974,6 @@ inp_getmoptions(struct inpcb *inp, struct sockopt *sopt)
*
* Returns NULL if no ifp could be found.
*
- * SMPng: TODO: Acquire the appropriate locks for INADDR_TO_IFP.
* FUTURE: Implement IPv4 source-address selection.
*/
static struct ifnet *
@@ -1989,7 +1991,9 @@ inp_lookup_mcast_ifp(const struct inpcb *inp,
ifp = NULL;
if (!in_nullhost(ina)) {
+ IN_IFADDR_RLOCK(&in_ifa_tracker);
INADDR_TO_IFP(ina, ifp);
+ IN_IFADDR_RUNLOCK(&in_ifa_tracker);
} else {
fibnum = inp ? inp->inp_inc.inc_fibnum : 0;
if (fib4_lookup_nh_basic(fibnum, gsin->sin_addr, 0, 0, &nh4)==0)
@@ -2334,6 +2338,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sopt)
{
struct group_source_req gsr;
struct ip_mreq_source mreqs;
+ struct rm_priotracker in_ifa_tracker;
sockunion_t *gsa, *ssa;
struct ifnet *ifp;
struct in_mfilter *imf;
@@ -2392,9 +2397,11 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sopt)
* XXX NOTE WELL: The RFC 3678 API is preferred because
* using an IPv4 address as a key is racy.
*/
- if (!in_nullhost(mreqs.imr_interface))
+ if (!in_nullhost(mreqs.imr_interface)) {
+ IN_IFADDR_RLOCK(&in_ifa_tracker);
INADDR_TO_IFP(mreqs.imr_interface, ifp);
-
+ IN_IFADDR_RUNLOCK(&in_ifa_tracker);
+ }
CTR3(KTR_IGMPV3, "%s: imr_interface = 0x%08x, ifp = %p",
__func__, ntohl(mreqs.imr_interface.s_addr), ifp);
@@ -2562,6 +2569,7 @@ out_inp_locked:
static int
inp_set_multicast_if(struct inpcb *inp, struct sockopt *sopt)
{
+ struct rm_priotracker in_ifa_tracker;
struct in_addr addr;
struct ip_mreqn mreqn;
struct ifnet *ifp;
@@ -2600,7 +2608,9 @@ inp_set_multicast_if(struct inpcb *inp, struct sockopt *sopt)
if (in_nullhost(addr)) {
ifp = NULL;
} else {
+ IN_IFADDR_RLOCK(&in_ifa_tracker);
INADDR_TO_IFP(addr, ifp);
+ IN_IFADDR_RUNLOCK(&in_ifa_tracker);
if (ifp == NULL)
return (EADDRNOTAVAIL);
}
diff --git a/freebsd/sys/netinet/in_pcb.c b/freebsd/sys/netinet/in_pcb.c
index 5ba918fa..6bf43464 100644
--- a/freebsd/sys/netinet/in_pcb.c
+++ b/freebsd/sys/netinet/in_pcb.c
@@ -272,7 +272,7 @@ in_pcblbgroup_resize(struct inpcblbgrouphead *hdr,
grp = in_pcblbgroup_alloc(hdr, old_grp->il_vflag,
old_grp->il_lport, &old_grp->il_dependladdr, size);
- if (!grp)
+ if (grp == NULL)
return (NULL);
KASSERT(old_grp->il_inpcnt < grp->il_inpsiz,
@@ -294,21 +294,20 @@ static void
in_pcblbgroup_reorder(struct inpcblbgrouphead *hdr, struct inpcblbgroup **grpp,
int i)
{
- struct inpcblbgroup *grp = *grpp;
+ struct inpcblbgroup *grp, *new_grp;
+ grp = *grpp;
for (; i + 1 < grp->il_inpcnt; ++i)
grp->il_inp[i] = grp->il_inp[i + 1];
grp->il_inpcnt--;
if (grp->il_inpsiz > INPCBLBGROUP_SIZMIN &&
- grp->il_inpcnt <= (grp->il_inpsiz / 4)) {
+ grp->il_inpcnt <= grp->il_inpsiz / 4) {
/* Shrink this group. */
- struct inpcblbgroup *new_grp =
- in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz / 2);
- if (new_grp)
+ new_grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz / 2);
+ if (new_grp != NULL)
*grpp = new_grp;
}
- return;
}
/*
@@ -322,31 +321,17 @@ in_pcbinslbgrouphash(struct inpcb *inp)
struct inpcbinfo *pcbinfo;
struct inpcblbgrouphead *hdr;
struct inpcblbgroup *grp;
- uint16_t hashmask, lport;
- uint32_t group_index;
- struct ucred *cred;
+ uint32_t idx;
pcbinfo = inp->inp_pcbinfo;
INP_WLOCK_ASSERT(inp);
INP_HASH_WLOCK_ASSERT(pcbinfo);
- if (pcbinfo->ipi_lbgrouphashbase == NULL)
- return (0);
-
- hashmask = pcbinfo->ipi_lbgrouphashmask;
- lport = inp->inp_lport;
- group_index = INP_PCBLBGROUP_PORTHASH(lport, hashmask);
- hdr = &pcbinfo->ipi_lbgrouphashbase[group_index];
-
/*
* Don't allow jailed socket to join local group.
*/
- if (inp->inp_socket != NULL)
- cred = inp->inp_socket->so_cred;
- else
- cred = NULL;
- if (cred != NULL && jailed(cred))
+ if (inp->inp_socket != NULL && jailed(inp->inp_socket->so_cred))
return (0);
#ifdef INET6
@@ -360,24 +345,23 @@ in_pcbinslbgrouphash(struct inpcb *inp)
}
#endif
- hdr = &pcbinfo->ipi_lbgrouphashbase[
- INP_PCBLBGROUP_PORTHASH(inp->inp_lport,
- pcbinfo->ipi_lbgrouphashmask)];
+ idx = INP_PCBLBGROUP_PORTHASH(inp->inp_lport,
+ pcbinfo->ipi_lbgrouphashmask);
+ hdr = &pcbinfo->ipi_lbgrouphashbase[idx];
CK_LIST_FOREACH(grp, hdr, il_list) {
if (grp->il_vflag == inp->inp_vflag &&
grp->il_lport == inp->inp_lport &&
memcmp(&grp->il_dependladdr,
- &inp->inp_inc.inc_ie.ie_dependladdr,
- sizeof(grp->il_dependladdr)) == 0) {
+ &inp->inp_inc.inc_ie.ie_dependladdr,
+ sizeof(grp->il_dependladdr)) == 0)
break;
- }
}
if (grp == NULL) {
/* Create new load balance group. */
grp = in_pcblbgroup_alloc(hdr, inp->inp_vflag,
inp->inp_lport, &inp->inp_inc.inc_ie.ie_dependladdr,
INPCBLBGROUP_SIZMIN);
- if (!grp)
+ if (grp == NULL)
return (ENOBUFS);
} else if (grp->il_inpcnt == grp->il_inpsiz) {
if (grp->il_inpsiz >= INPCBLBGROUP_SIZMAX) {
@@ -389,13 +373,13 @@ in_pcbinslbgrouphash(struct inpcb *inp)
/* Expand this local group. */
grp = in_pcblbgroup_resize(hdr, grp, grp->il_inpsiz * 2);
- if (!grp)
+ if (grp == NULL)
return (ENOBUFS);
}
KASSERT(grp->il_inpcnt < grp->il_inpsiz,
- ("invalid local group size %d and count %d",
- grp->il_inpsiz, grp->il_inpcnt));
+ ("invalid local group size %d and count %d", grp->il_inpsiz,
+ grp->il_inpcnt));
grp->il_inp[grp->il_inpcnt] = inp;
grp->il_inpcnt++;
@@ -418,9 +402,6 @@ in_pcbremlbgrouphash(struct inpcb *inp)
INP_WLOCK_ASSERT(inp);
INP_HASH_WLOCK_ASSERT(pcbinfo);
- if (pcbinfo->ipi_lbgrouphashbase == NULL)
- return;
-
hdr = &pcbinfo->ipi_lbgrouphashbase[
INP_PCBLBGROUP_PORTHASH(inp->inp_lport,
pcbinfo->ipi_lbgrouphashmask)];
@@ -2301,13 +2282,11 @@ in_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, struct in_addr faddr,
/*
* Then look in lb group (for wildcard match).
*/
- if (pcbinfo->ipi_lbgrouphashbase != NULL &&
- (lookupflags & INPLOOKUP_WILDCARD)) {
+ if ((lookupflags & INPLOOKUP_WILDCARD) != 0) {
inp = in_pcblookup_lbgroup(pcbinfo, &laddr, lport, &faddr,
fport, lookupflags);
- if (inp != NULL) {
+ if (inp != NULL)
return (inp);
- }
}
/*
diff --git a/freebsd/sys/netinet/ip_carp.c b/freebsd/sys/netinet/ip_carp.c
index 8f7f6edf..1fb208a2 100644
--- a/freebsd/sys/netinet/ip_carp.c
+++ b/freebsd/sys/netinet/ip_carp.c
@@ -2178,6 +2178,21 @@ static struct protosw in6_carp_protosw = {
};
#endif
+#ifdef VIMAGE
+#if defined(__i386__)
+/*
+ * XXX This is a hack to work around an absolute relocation outside
+ * set_vnet by one (on the stop symbol) for carpstats. Add a dummy variable
+ * to the end of the file in the hope that the linker will just keep the
+ * order (as it seems to do at the moment). It is understood to be fragile.
+ * See PR 230857 for a longer discussion of the problem and the referenced
+ * review for possible alternate solutions. Each is a hack; we just need
+ * the least intrusive one for the next release.
+ */
+VNET_DEFINE(char, carp_zzz) = 0xde;
+#endif
+#endif
+
static void
carp_mod_cleanup(void)
{
diff --git a/freebsd/sys/netinet/ip_gre.c b/freebsd/sys/netinet/ip_gre.c
index 6a88f37f..1758bfff 100644
--- a/freebsd/sys/netinet/ip_gre.c
+++ b/freebsd/sys/netinet/ip_gre.c
@@ -169,7 +169,8 @@ in_gre_srcaddr(void *arg __unused, const struct sockaddr *sa,
const struct sockaddr_in *sin;
struct gre_softc *sc;
- if (V_ipv4_srchashtbl == NULL)
+ /* Check that VNET is ready */
+ if (V_ipv4_hashtbl == NULL)
return;
MPASS(in_epoch(net_epoch_preempt));
@@ -352,6 +353,8 @@ in_gre_uninit(void)
}
if (V_ipv4_hashtbl != NULL) {
gre_hashdestroy(V_ipv4_hashtbl);
+ V_ipv4_hashtbl = NULL;
+ GRE_WAIT();
gre_hashdestroy(V_ipv4_srchashtbl);
}
}
diff --git a/freebsd/sys/netinet/ip_icmp.c b/freebsd/sys/netinet/ip_icmp.c
index 2f8b6fd1..7e75f3d9 100644
--- a/freebsd/sys/netinet/ip_icmp.c
+++ b/freebsd/sys/netinet/ip_icmp.c
@@ -266,6 +266,7 @@ icmp_error(struct mbuf *n, int type, int code, uint32_t dest, int mtu)
if (n->m_len < oiphlen + tcphlen &&
(n = m_pullup(n, oiphlen + tcphlen)) == NULL)
goto freeit;
+ oip = mtod(n, struct ip *);
icmpelen = max(tcphlen, min(V_icmp_quotelen,
ntohs(oip->ip_len) - oiphlen));
} else if (oip->ip_p == IPPROTO_SCTP) {
@@ -321,7 +322,8 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs(oip->ip_len) -
#endif
icmplen = min(icmplen, M_TRAILINGSPACE(m) -
sizeof(struct ip) - ICMP_MINLEN);
- m_align(m, ICMP_MINLEN + icmplen);
+ m_align(m, sizeof(struct ip) + ICMP_MINLEN + icmplen);
+ m->m_data += sizeof(struct ip);
m->m_len = ICMP_MINLEN + icmplen;
/* XXX MRT make the outgoing packet use the same FIB
@@ -363,6 +365,8 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs(oip->ip_len) -
* reply should bypass as well.
*/
m->m_flags |= n->m_flags & M_SKIP_FIREWALL;
+ KASSERT(M_LEADINGSPACE(m) >= sizeof(struct ip),
+ ("insufficient space for ip header"));
m->m_data -= sizeof(struct ip);
m->m_len += sizeof(struct ip);
m->m_pkthdr.len = m->m_len;
diff --git a/freebsd/sys/netinet/ip_input.c b/freebsd/sys/netinet/ip_input.c
index 2852b52e..136a774f 100644
--- a/freebsd/sys/netinet/ip_input.c
+++ b/freebsd/sys/netinet/ip_input.c
@@ -450,6 +450,7 @@ ip_direct_input(struct mbuf *m)
void
ip_input(struct mbuf *m)
{
+ struct rm_priotracker in_ifa_tracker;
struct ip *ip = NULL;
struct in_ifaddr *ia = NULL;
struct ifaddr *ifa;
@@ -683,7 +684,7 @@ passin:
/*
* Check for exact addresses in the hash bucket.
*/
- /* IN_IFADDR_RLOCK(); */
+ IN_IFADDR_RLOCK(&in_ifa_tracker);
LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) {
/*
* If the address matches, verify that the packet
@@ -695,11 +696,11 @@ passin:
counter_u64_add(ia->ia_ifa.ifa_ipackets, 1);
counter_u64_add(ia->ia_ifa.ifa_ibytes,
m->m_pkthdr.len);
- /* IN_IFADDR_RUNLOCK(); */
+ IN_IFADDR_RUNLOCK(&in_ifa_tracker);
goto ours;
}
}
- /* IN_IFADDR_RUNLOCK(); */
+ IN_IFADDR_RUNLOCK(&in_ifa_tracker);
/*
* Check for broadcast addresses.
diff --git a/freebsd/sys/netinet/ip_reass.c b/freebsd/sys/netinet/ip_reass.c
index 95603390..8bc5b53b 100644
--- a/freebsd/sys/netinet/ip_reass.c
+++ b/freebsd/sys/netinet/ip_reass.c
@@ -230,6 +230,16 @@ ip_reass(struct mbuf *m)
ip->ip_off = htons(ntohs(ip->ip_off) << 3);
/*
+ * Make sure the fragment lies within a packet of valid size.
+ */
+ if (ntohs(ip->ip_len) + ntohs(ip->ip_off) > IP_MAXPACKET) {
+ IPSTAT_INC(ips_toolong);
+ IPSTAT_INC(ips_fragdropped);
+ m_freem(m);
+ return (NULL);
+ }
+
+ /*
* Attempt reassembly; if it succeeds, proceed.
* ip_reass() will return a different mbuf.
*/
diff --git a/freebsd/sys/netinet/sctp_output.c b/freebsd/sys/netinet/sctp_output.c
index 9493882c..b01ec41f 100644
--- a/freebsd/sys/netinet/sctp_output.c
+++ b/freebsd/sys/netinet/sctp_output.c
@@ -3735,6 +3735,7 @@ sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *er
return (0);
}
+#if defined(INET) || defined(INET6)
static struct sctp_tcb *
sctp_findassociation_cmsgs(struct sctp_inpcb **inp_p,
uint16_t port,
@@ -3824,6 +3825,7 @@ sctp_findassociation_cmsgs(struct sctp_inpcb **inp_p,
}
return (NULL);
}
+#endif
static struct mbuf *
sctp_add_cookie(struct mbuf *init, int init_offset,
@@ -12701,9 +12703,11 @@ sctp_lower_sosend(struct socket *so,
SCTP_INP_WUNLOCK(inp);
/* With the lock applied look again */
stcb = sctp_findassociation_ep_addr(&t_inp, addr, &net, NULL, NULL);
+#if defined(INET) || defined(INET6)
if ((stcb == NULL) && (control != NULL) && (port > 0)) {
stcb = sctp_findassociation_cmsgs(&t_inp, port, control, &net, &error);
}
+#endif
if (stcb == NULL) {
SCTP_INP_WLOCK(inp);
SCTP_INP_DECR_REF(inp);
diff --git a/freebsd/sys/netinet/sctp_sysctl.h b/freebsd/sys/netinet/sctp_sysctl.h
index 8187ae9e..219b9532 100644
--- a/freebsd/sys/netinet/sctp_sysctl.h
+++ b/freebsd/sys/netinet/sctp_sysctl.h
@@ -212,7 +212,7 @@ struct sctp_sysctl {
#define SCTPCTL_MAXBURST_DEFAULT SCTP_DEF_MAX_BURST
/* fr_maxburst: Default max burst for sctp endpoints when fast retransmitting */
-#define SCTPCTL_FRMAXBURST_DESC "Default fr max burst for sctp endpoints"
+#define SCTPCTL_FRMAXBURST_DESC "Default max burst for SCTP endpoints when fast retransmitting"
#define SCTPCTL_FRMAXBURST_MIN 0
#define SCTPCTL_FRMAXBURST_MAX 0xFFFFFFFF
#define SCTPCTL_FRMAXBURST_DEFAULT SCTP_DEF_FRMAX_BURST
@@ -243,7 +243,7 @@ struct sctp_sysctl {
#define SCTPCTL_MIN_SPLIT_POINT_DEFAULT SCTP_DEFAULT_SPLIT_POINT_MIN
/* chunkscale: Tunable for Scaling of number of chunks and messages */
-#define SCTPCTL_CHUNKSCALE_DESC "Tunable for Scaling of number of chunks and messages"
+#define SCTPCTL_CHUNKSCALE_DESC "Tunable for scaling of number of chunks and messages"
#define SCTPCTL_CHUNKSCALE_MIN 1
#define SCTPCTL_CHUNKSCALE_MAX 0xFFFFFFFF
#define SCTPCTL_CHUNKSCALE_DEFAULT SCTP_CHUNKQUEUE_SCALE
@@ -327,7 +327,7 @@ struct sctp_sysctl {
#define SCTPCTL_VALID_COOKIE_LIFE_DEFAULT SCTP_DEFAULT_COOKIE_LIFE
/* init_rtx_max: Default maximum number of retransmission for INIT chunks */
-#define SCTPCTL_INIT_RTX_MAX_DESC "Default maximum number of retransmission for INIT chunks"
+#define SCTPCTL_INIT_RTX_MAX_DESC "Default maximum number of retransmissions for INIT chunks"
#define SCTPCTL_INIT_RTX_MAX_MIN 0
#define SCTPCTL_INIT_RTX_MAX_MAX 0xFFFFFFFF
#define SCTPCTL_INIT_RTX_MAX_DEFAULT SCTP_DEF_MAX_INIT
@@ -380,8 +380,8 @@ struct sctp_sysctl {
#define SCTPCTL_CMT_USE_DAC_MAX 1
#define SCTPCTL_CMT_USE_DAC_DEFAULT 0
-/* cwnd_maxburst: Use a CWND adjusting maxburst */
-#define SCTPCTL_CWND_MAXBURST_DESC "Use a CWND adjusting maxburst"
+/* cwnd_maxburst: Use a CWND adjusting to implement maxburst */
+#define SCTPCTL_CWND_MAXBURST_DESC "Adjust congestion control window to limit maximum burst when sending"
#define SCTPCTL_CWND_MAXBURST_MIN 0
#define SCTPCTL_CWND_MAXBURST_MAX 1
#define SCTPCTL_CWND_MAXBURST_DEFAULT 1
@@ -417,7 +417,7 @@ struct sctp_sysctl {
#define SCTPCTL_HB_MAX_BURST_DEFAULT SCTP_DEF_HBMAX_BURST
/* abort_at_limit: When one-2-one hits qlimit abort */
-#define SCTPCTL_ABORT_AT_LIMIT_DESC "When one-2-one hits qlimit abort"
+#define SCTPCTL_ABORT_AT_LIMIT_DESC "Abort when one-to-one hits qlimit"
#define SCTPCTL_ABORT_AT_LIMIT_MIN 0
#define SCTPCTL_ABORT_AT_LIMIT_MAX 1
#define SCTPCTL_ABORT_AT_LIMIT_DEFAULT 0
@@ -429,7 +429,7 @@ struct sctp_sysctl {
#define SCTPCTL_MIN_RESIDUAL_DEFAULT 1452
/* max_retran_chunk: max chunk retransmissions */
-#define SCTPCTL_MAX_RETRAN_CHUNK_DESC "Maximum times an unlucky chunk can be retran'd before assoc abort"
+#define SCTPCTL_MAX_RETRAN_CHUNK_DESC "Maximum times an unlucky chunk can be retransmitted before assoc abort"
#define SCTPCTL_MAX_RETRAN_CHUNK_MIN 0
#define SCTPCTL_MAX_RETRAN_CHUNK_MAX 65535
#define SCTPCTL_MAX_RETRAN_CHUNK_DEFAULT 30
@@ -477,63 +477,63 @@ struct sctp_sysctl {
#define SCTPCTL_UDP_TUNNELING_PORT_DEFAULT 0
/* Enable sending of the SACK-IMMEDIATELY bit */
-#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC "Enable sending of the SACK-IMMEDIATELY-bit."
+#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DESC "Enable sending of the SACK-IMMEDIATELY-bit"
#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN 0
#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX 1
#define SCTPCTL_SACK_IMMEDIATELY_ENABLE_DEFAULT SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX
/* Enable sending of the NAT-FRIENDLY message */
-#define SCTPCTL_NAT_FRIENDLY_INITS_DESC "Enable sending of the nat-friendly SCTP option on INITs."
+#define SCTPCTL_NAT_FRIENDLY_INITS_DESC "Enable sending of the nat-friendly SCTP option on INITs"
#define SCTPCTL_NAT_FRIENDLY_INITS_MIN 0
#define SCTPCTL_NAT_FRIENDLY_INITS_MAX 1
#define SCTPCTL_NAT_FRIENDLY_INITS_DEFAULT SCTPCTL_NAT_FRIENDLY_INITS_MIN
/* Vtag time wait in seconds */
-#define SCTPCTL_TIME_WAIT_DESC "Vtag time wait time in seconds, 0 disables it."
+#define SCTPCTL_TIME_WAIT_DESC "Vtag time wait time in seconds, 0 disables it"
#define SCTPCTL_TIME_WAIT_MIN 0
#define SCTPCTL_TIME_WAIT_MAX 0xffffffff
#define SCTPCTL_TIME_WAIT_DEFAULT SCTP_TIME_WAIT
/* Enable Send/Receive buffer splitting */
-#define SCTPCTL_BUFFER_SPLITTING_DESC "Enable send/receive buffer splitting."
+#define SCTPCTL_BUFFER_SPLITTING_DESC "Enable send/receive buffer splitting"
#define SCTPCTL_BUFFER_SPLITTING_MIN 0
#define SCTPCTL_BUFFER_SPLITTING_MAX 0x3
#define SCTPCTL_BUFFER_SPLITTING_DEFAULT SCTPCTL_BUFFER_SPLITTING_MIN
-/* Initial congestion window in MTU */
-#define SCTPCTL_INITIAL_CWND_DESC "Initial congestion window in MTUs"
+/* Initial congestion window in MTUs */
+#define SCTPCTL_INITIAL_CWND_DESC "Defines the initial congestion window size in MTUs"
#define SCTPCTL_INITIAL_CWND_MIN 0
#define SCTPCTL_INITIAL_CWND_MAX 0xffffffff
#define SCTPCTL_INITIAL_CWND_DEFAULT 3
/* rttvar smooth avg for bw calc */
-#define SCTPCTL_RTTVAR_BW_DESC "Shift amount for bw smoothing on rtt calc"
+#define SCTPCTL_RTTVAR_BW_DESC "Shift amount DCCC uses for bw smoothing on rtt calc"
#define SCTPCTL_RTTVAR_BW_MIN 0
#define SCTPCTL_RTTVAR_BW_MAX 32
#define SCTPCTL_RTTVAR_BW_DEFAULT 4
/* rttvar smooth avg for bw calc */
-#define SCTPCTL_RTTVAR_RTT_DESC "Shift amount for rtt smoothing on rtt calc"
+#define SCTPCTL_RTTVAR_RTT_DESC "Shift amount DCCC uses for rtt smoothing on rtt calc"
#define SCTPCTL_RTTVAR_RTT_MIN 0
#define SCTPCTL_RTTVAR_RTT_MAX 32
#define SCTPCTL_RTTVAR_RTT_DEFAULT 5
-#define SCTPCTL_RTTVAR_EQRET_DESC "What to return when rtt and bw are unchanged"
+#define SCTPCTL_RTTVAR_EQRET_DESC "Whether DCCC increases cwnd when the rtt and bw are unchanged"
#define SCTPCTL_RTTVAR_EQRET_MIN 0
#define SCTPCTL_RTTVAR_EQRET_MAX 1
#define SCTPCTL_RTTVAR_EQRET_DEFAULT 0
-#define SCTPCTL_RTTVAR_STEADYS_DESC "How many the sames it takes to try step down of cwnd"
+#define SCTPCTL_RTTVAR_STEADYS_DESC "Number of identical bw measurements DCCC takes to try step down of cwnd"
#define SCTPCTL_RTTVAR_STEADYS_MIN 0
#define SCTPCTL_RTTVAR_STEADYS_MAX 0xFFFF
#define SCTPCTL_RTTVAR_STEADYS_DEFAULT 20 /* 0 means disable feature */
-#define SCTPCTL_RTTVAR_DCCCECN_DESC "Enable for RTCC CC datacenter ECN"
+#define SCTPCTL_RTTVAR_DCCCECN_DESC "Enable ECN for DCCC."
#define SCTPCTL_RTTVAR_DCCCECN_MIN 0
#define SCTPCTL_RTTVAR_DCCCECN_MAX 1
#define SCTPCTL_RTTVAR_DCCCECN_DEFAULT 1 /* 0 means disable feature */
-#define SCTPCTL_BLACKHOLE_DESC "Enable SCTP blackholing. See blackhole(4) for more details."
+#define SCTPCTL_BLACKHOLE_DESC "Enable SCTP blackholing, see blackhole(4) for more details"
#define SCTPCTL_BLACKHOLE_MIN 0
#define SCTPCTL_BLACKHOLE_MAX 2
#define SCTPCTL_BLACKHOLE_DEFAULT SCTPCTL_BLACKHOLE_MIN
@@ -553,7 +553,7 @@ struct sctp_sysctl {
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
-#define SCTPCTL_OUTPUT_UNLOCKED_DESC "Unlock socket when sending packets down to IP."
+#define SCTPCTL_OUTPUT_UNLOCKED_DESC "Unlock socket when sending packets down to IP"
#define SCTPCTL_OUTPUT_UNLOCKED_MIN 0
#define SCTPCTL_OUTPUT_UNLOCKED_MAX 1
#define SCTPCTL_OUTPUT_UNLOCKED_DEFAULT SCTPCTL_OUTPUT_UNLOCKED_MIN
diff --git a/freebsd/sys/netinet/tcp_syncache.c b/freebsd/sys/netinet/tcp_syncache.c
index a913f5b6..bfbf9f42 100644
--- a/freebsd/sys/netinet/tcp_syncache.c
+++ b/freebsd/sys/netinet/tcp_syncache.c
@@ -583,15 +583,28 @@ syncache_chkrst(struct in_conninfo *inc, struct tcphdr *th, struct mbuf *m)
/*
* If the RST bit is set, check the sequence number to see
* if this is a valid reset segment.
+ *
* RFC 793 page 37:
* In all states except SYN-SENT, all reset (RST) segments
* are validated by checking their SEQ-fields. A reset is
* valid if its sequence number is in the window.
*
- * The sequence number in the reset segment is normally an
- * echo of our outgoing acknowlegement numbers, but some hosts
- * send a reset with the sequence number at the rightmost edge
- * of our receive window, and we have to handle this case.
+ * RFC 793 page 69:
+ * There are four cases for the acceptability test for an incoming
+ * segment:
+ *
+ * Segment Receive Test
+ * Length Window
+ * ------- ------- -------------------------------------------
+ * 0 0 SEG.SEQ = RCV.NXT
+ * 0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
+ * >0 0 not acceptable
+ * >0 >0 RCV.NXT =< SEG.SEQ < RCV.NXT+RCV.WND
+ * or RCV.NXT =< SEG.SEQ+SEG.LEN-1 < RCV.NXT+RCV.WND
+ *
+ * Note that when receiving a SYN segment in the LISTEN state,
+ * IRS is set to SEG.SEQ and RCV.NXT is set to SEG.SEQ+1, as
+ * described in RFC 793, page 66.
*/
if ((SEQ_GEQ(th->th_seq, sc->sc_irs + 1) &&
SEQ_LT(th->th_seq, sc->sc_irs + 1 + sc->sc_wnd)) ||
diff --git a/freebsd/sys/netinet6/in6_gif.c b/freebsd/sys/netinet6/in6_gif.c
index 66c2cfb4..d7396bb1 100644
--- a/freebsd/sys/netinet6/in6_gif.c
+++ b/freebsd/sys/netinet6/in6_gif.c
@@ -155,7 +155,8 @@ in6_gif_srcaddr(void *arg __unused, const struct sockaddr *sa, int event)
const struct sockaddr_in6 *sin;
struct gif_softc *sc;
- if (V_ipv6_srchashtbl == NULL)
+ /* Check that VNET is ready */
+ if (V_ipv6_hashtbl == NULL)
return;
MPASS(in_epoch(net_epoch_preempt));
@@ -482,6 +483,8 @@ in6_gif_uninit(void)
}
if (V_ipv6_hashtbl != NULL) {
gif_hashdestroy(V_ipv6_hashtbl);
+ V_ipv6_hashtbl = NULL;
+ GIF_WAIT();
gif_hashdestroy(V_ipv6_srchashtbl);
}
}
diff --git a/freebsd/sys/netinet6/in6_ifattach.c b/freebsd/sys/netinet6/in6_ifattach.c
index 1cab31d1..6af4b557 100644
--- a/freebsd/sys/netinet6/in6_ifattach.c
+++ b/freebsd/sys/netinet6/in6_ifattach.c
@@ -487,9 +487,16 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet *altifp)
return (-1);
}
- ia = in6ifa_ifpforlinklocal(ifp, 0); /* ia must not be NULL */
- KASSERT(ia != NULL, ("%s: ia == NULL, ifp=%p", __func__, ifp));
-
+ ia = in6ifa_ifpforlinklocal(ifp, 0);
+ if (ia == NULL) {
+ /*
+ * Another thread removed the address that we just added.
+ * This should be rare, but it happens.
+ */
+ nd6log((LOG_NOTICE, "%s: %s: new link-local address "
+ "disappeared\n", __func__, if_name(ifp)));
+ return (-1);
+ }
ifa_free(&ia->ia_ifa);
/*
diff --git a/freebsd/sys/netinet6/in6_pcb.c b/freebsd/sys/netinet6/in6_pcb.c
index 53102764..f5b22db7 100644
--- a/freebsd/sys/netinet6/in6_pcb.c
+++ b/freebsd/sys/netinet6/in6_pcb.c
@@ -1175,13 +1175,11 @@ in6_pcblookup_hash_locked(struct inpcbinfo *pcbinfo, struct in6_addr *faddr,
/*
* Then look in lb group (for wildcard match).
*/
- if (pcbinfo->ipi_lbgrouphashbase != NULL &&
- (lookupflags & INPLOOKUP_WILDCARD)) {
+ if ((lookupflags & INPLOOKUP_WILDCARD) != 0) {
inp = in6_pcblookup_lbgroup(pcbinfo, laddr, lport, faddr,
fport, lookupflags);
- if (inp != NULL) {
+ if (inp != NULL)
return (inp);
- }
}
/*
diff --git a/freebsd/sys/netinet6/nd6.h b/freebsd/sys/netinet6/nd6.h
index cabfeec0..7544d23c 100644
--- a/freebsd/sys/netinet6/nd6.h
+++ b/freebsd/sys/netinet6/nd6.h
@@ -90,6 +90,9 @@ struct nd_ifinfo {
#define ND6_IFF_NO_RADR 0x40
#define ND6_IFF_NO_PREFER_IFACE 0x80 /* XXX: not related to ND. */
#define ND6_IFF_NO_DAD 0x100
+#ifdef EXPERIMENTAL
+#define ND6_IFF_IPV6_ONLY 0x200 /* draft-ietf-6man-ipv6only-flag */
+#endif
#ifdef _KERNEL
#define ND_IFINFO(ifp) \
diff --git a/freebsd/sys/netinet6/nd6_rtr.c b/freebsd/sys/netinet6/nd6_rtr.c
index a60e7c66..59868383 100644
--- a/freebsd/sys/netinet6/nd6_rtr.c
+++ b/freebsd/sys/netinet6/nd6_rtr.c
@@ -206,6 +206,37 @@ nd6_rs_input(struct mbuf *m, int off, int icmp6len)
m_freem(m);
}
+#ifdef EXPERIMENTAL
+/*
+ * An initial update routine for draft-ietf-6man-ipv6only-flag.
+ * We need to iterate over all default routers for the given
+ * interface to see whether they are all advertising the "6"
+ * (IPv6-Only) flag. If they do set, otherwise unset, the
+ * interface flag we later use to filter on.
+ */
+static void
+defrtr_ipv6_only_ifp(struct ifnet *ifp)
+{
+ struct nd_defrouter *dr;
+ bool ipv6_only;
+
+ ipv6_only = true;
+ ND6_RLOCK();
+ TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry)
+ if (dr->ifp == ifp &&
+ (dr->raflags & ND_RA_FLAG_IPV6_ONLY) == 0)
+ ipv6_only = false;
+ ND6_RUNLOCK();
+
+ IF_AFDATA_WLOCK(ifp);
+ if (ipv6_only)
+ ND_IFINFO(ifp)->flags |= ND6_IFF_IPV6_ONLY;
+ else
+ ND_IFINFO(ifp)->flags &= ~ND6_IFF_IPV6_ONLY;
+ IF_AFDATA_WUNLOCK(ifp);
+}
+#endif
+
/*
* Receive Router Advertisement Message.
*
@@ -321,6 +352,9 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len)
}
}
dr = defrtrlist_update(&dr0);
+#ifdef EXPERIMENTAL
+ defrtr_ipv6_only_ifp(ifp);
+#endif
}
/*
@@ -694,6 +728,10 @@ defrouter_del(struct nd_defrouter *dr)
if (ND_IFINFO(dr->ifp)->flags & ND6_IFF_ACCEPT_RTADV)
rt6_flush(&dr->rtaddr, dr->ifp);
+#ifdef EXPERIMENTAL
+ defrtr_ipv6_only_ifp(dr->ifp);
+#endif
+
if (dr->installed) {
deldr = dr;
defrouter_delreq(dr);
diff --git a/freebsd/sys/netinet6/raw_ip6.c b/freebsd/sys/netinet6/raw_ip6.c
index 9c3d7a61..73d0832a 100644
--- a/freebsd/sys/netinet6/raw_ip6.c
+++ b/freebsd/sys/netinet6/raw_ip6.c
@@ -189,6 +189,45 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
if (!IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr) &&
!IN6_ARE_ADDR_EQUAL(&in6p->in6p_faddr, &ip6->ip6_src))
continue;
+ if (last != NULL) {
+ struct mbuf *n = m_copym(m, 0, M_COPYALL, M_NOWAIT);
+
+#if defined(IPSEC) || defined(IPSEC_SUPPORT)
+ /*
+ * Check AH/ESP integrity.
+ */
+ if (IPSEC_ENABLED(ipv6)) {
+ if (n != NULL &&
+ IPSEC_CHECK_POLICY(ipv6, n, last) != 0) {
+ m_freem(n);
+ /* Do not inject data into pcb. */
+ n = NULL;
+ }
+ }
+#endif /* IPSEC */
+ if (n) {
+ if (last->inp_flags & INP_CONTROLOPTS ||
+ last->inp_socket->so_options & SO_TIMESTAMP)
+ ip6_savecontrol(last, n, &opts);
+ /* strip intermediate headers */
+ m_adj(n, *offp);
+ if (sbappendaddr(&last->inp_socket->so_rcv,
+ (struct sockaddr *)&fromsa,
+ n, opts) == 0) {
+ m_freem(n);
+ if (opts)
+ m_freem(opts);
+ RIP6STAT_INC(rip6s_fullsock);
+ } else
+ sorwakeup(last->inp_socket);
+ opts = NULL;
+ }
+ INP_RUNLOCK(last);
+ last = NULL;
+ }
+ INP_RLOCK(in6p);
+ if (__predict_false(in6p->inp_flags2 & INP_FREED))
+ goto skip_2;
if (jailed_without_vnet(in6p->inp_cred)) {
/*
* Allow raw socket in jail to receive multicast;
@@ -198,16 +237,14 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
if (!IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) &&
prison_check_ip6(in6p->inp_cred,
&ip6->ip6_dst) != 0)
- continue;
+ goto skip_2;
}
- INP_RLOCK(in6p);
if (in6p->in6p_cksum != -1) {
RIP6STAT_INC(rip6s_isum);
if (in6_cksum(m, proto, *offp,
m->m_pkthdr.len - *offp)) {
- INP_RUNLOCK(in6p);
RIP6STAT_INC(rip6s_badsum);
- continue;
+ goto skip_2;
}
}
/*
@@ -253,46 +290,13 @@ rip6_input(struct mbuf **mp, int *offp, int proto)
}
if (blocked != MCAST_PASS) {
IP6STAT_INC(ip6s_notmember);
- INP_RUNLOCK(in6p);
- continue;
- }
- }
- if (last != NULL) {
- struct mbuf *n = m_copym(m, 0, M_COPYALL, M_NOWAIT);
-
-#if defined(IPSEC) || defined(IPSEC_SUPPORT)
- /*
- * Check AH/ESP integrity.
- */
- if (IPSEC_ENABLED(ipv6)) {
- if (n != NULL &&
- IPSEC_CHECK_POLICY(ipv6, n, last) != 0) {
- m_freem(n);
- /* Do not inject data into pcb. */
- n = NULL;
- }
- }
-#endif /* IPSEC */
- if (n) {
- if (last->inp_flags & INP_CONTROLOPTS ||
- last->inp_socket->so_options & SO_TIMESTAMP)
- ip6_savecontrol(last, n, &opts);
- /* strip intermediate headers */
- m_adj(n, *offp);
- if (sbappendaddr(&last->inp_socket->so_rcv,
- (struct sockaddr *)&fromsa,
- n, opts) == 0) {
- m_freem(n);
- if (opts)
- m_freem(opts);
- RIP6STAT_INC(rip6s_fullsock);
- } else
- sorwakeup(last->inp_socket);
- opts = NULL;
+ goto skip_2;
}
- INP_RUNLOCK(last);
}
last = in6p;
+ continue;
+skip_2:
+ INP_RUNLOCK(in6p);
}
INP_INFO_RUNLOCK_ET(&V_ripcbinfo, et);
#if defined(IPSEC) || defined(IPSEC_SUPPORT)
diff --git a/freebsd/sys/netpfil/pf/if_pfsync.c b/freebsd/sys/netpfil/pf/if_pfsync.c
index dae091db..9612ac99 100644
--- a/freebsd/sys/netpfil/pf/if_pfsync.c
+++ b/freebsd/sys/netpfil/pf/if_pfsync.c
@@ -283,6 +283,7 @@ static void pfsync_bulk_status(u_int8_t);
static void pfsync_bulk_update(void *);
static void pfsync_bulk_fail(void *);
+static void pfsync_detach_ifnet(struct ifnet *);
#ifdef IPSEC
static void pfsync_update_net_tdb(struct pfsync_tdb *);
#endif
@@ -1364,10 +1365,10 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
sc->sc_maxupdates = pfsyncr.pfsyncr_maxupdates;
if (pfsyncr.pfsyncr_defer) {
sc->sc_flags |= PFSYNCF_DEFER;
- pfsync_defer_ptr = pfsync_defer;
+ V_pfsync_defer_ptr = pfsync_defer;
} else {
sc->sc_flags &= ~PFSYNCF_DEFER;
- pfsync_defer_ptr = NULL;
+ V_pfsync_defer_ptr = NULL;
}
if (sifp == NULL) {
@@ -1395,6 +1396,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
if (error) {
if_rele(sifp);
free(mship, M_PFSYNC);
+ PFSYNC_UNLOCK(sc);
return (error);
}
}
@@ -2294,6 +2296,29 @@ pfsync_multicast_cleanup(struct pfsync_softc *sc)
imo->imo_multicast_ifp = NULL;
}
+void
+pfsync_detach_ifnet(struct ifnet *ifp)
+{
+ struct pfsync_softc *sc = V_pfsyncif;
+
+ if (sc == NULL)
+ return;
+
+ PFSYNC_LOCK(sc);
+
+ if (sc->sc_sync_if == ifp) {
+ /* We don't need mutlicast cleanup here, because the interface
+ * is going away. We do need to ensure we don't try to do
+ * cleanup later.
+ */
+ sc->sc_imo.imo_membership = NULL;
+ sc->sc_imo.imo_multicast_ifp = NULL;
+ sc->sc_sync_if = NULL;
+ }
+
+ PFSYNC_UNLOCK(sc);
+}
+
#ifdef INET
extern struct domain inetdomain;
static struct protosw in_pfsync_protosw = {
@@ -2313,12 +2338,12 @@ pfsync_pointers_init()
{
PF_RULES_WLOCK();
- pfsync_state_import_ptr = pfsync_state_import;
- pfsync_insert_state_ptr = pfsync_insert_state;
- pfsync_update_state_ptr = pfsync_update_state;
- pfsync_delete_state_ptr = pfsync_delete_state;
- pfsync_clear_states_ptr = pfsync_clear_states;
- pfsync_defer_ptr = pfsync_defer;
+ V_pfsync_state_import_ptr = pfsync_state_import;
+ V_pfsync_insert_state_ptr = pfsync_insert_state;
+ V_pfsync_update_state_ptr = pfsync_update_state;
+ V_pfsync_delete_state_ptr = pfsync_delete_state;
+ V_pfsync_clear_states_ptr = pfsync_clear_states;
+ V_pfsync_defer_ptr = pfsync_defer;
PF_RULES_WUNLOCK();
}
@@ -2327,12 +2352,12 @@ pfsync_pointers_uninit()
{
PF_RULES_WLOCK();
- pfsync_state_import_ptr = NULL;
- pfsync_insert_state_ptr = NULL;
- pfsync_update_state_ptr = NULL;
- pfsync_delete_state_ptr = NULL;
- pfsync_clear_states_ptr = NULL;
- pfsync_defer_ptr = NULL;
+ V_pfsync_state_import_ptr = NULL;
+ V_pfsync_insert_state_ptr = NULL;
+ V_pfsync_update_state_ptr = NULL;
+ V_pfsync_delete_state_ptr = NULL;
+ V_pfsync_clear_states_ptr = NULL;
+ V_pfsync_defer_ptr = NULL;
PF_RULES_WUNLOCK();
}
@@ -2349,6 +2374,8 @@ vnet_pfsync_init(const void *unused __unused)
if_clone_detach(V_pfsync_cloner);
log(LOG_INFO, "swi_add() failed in %s\n", __func__);
}
+
+ pfsync_pointers_init();
}
VNET_SYSINIT(vnet_pfsync_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY,
vnet_pfsync_init, NULL);
@@ -2357,14 +2384,13 @@ static void
vnet_pfsync_uninit(const void *unused __unused)
{
+ pfsync_pointers_uninit();
+
if_clone_detach(V_pfsync_cloner);
swi_remove(V_pfsync_swi_cookie);
}
-/*
- * Detach after pf is gone; otherwise we might touch pfsync memory
- * from within pf after freeing pfsync.
- */
-VNET_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_INIT_IF, SI_ORDER_SECOND,
+
+VNET_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_FOURTH,
vnet_pfsync_uninit, NULL);
static int
@@ -2373,6 +2399,8 @@ pfsync_init()
#ifdef INET
int error;
+ pfsync_detach_ifnet_ptr = pfsync_detach_ifnet;
+
error = pf_proto_register(PF_INET, &in_pfsync_protosw);
if (error)
return (error);
@@ -2382,7 +2410,6 @@ pfsync_init()
return (error);
}
#endif
- pfsync_pointers_init();
return (0);
}
@@ -2390,8 +2417,7 @@ pfsync_init()
static void
pfsync_uninit()
{
-
- pfsync_pointers_uninit();
+ pfsync_detach_ifnet_ptr = NULL;
#ifdef INET
ipproto_unregister(IPPROTO_PFSYNC);
@@ -2408,12 +2434,6 @@ pfsync_modevent(module_t mod, int type, void *data)
case MOD_LOAD:
error = pfsync_init();
break;
- case MOD_QUIESCE:
- /*
- * Module should not be unloaded due to race conditions.
- */
- error = EBUSY;
- break;
case MOD_UNLOAD:
pfsync_uninit();
break;
diff --git a/freebsd/sys/netpfil/pf/pf.c b/freebsd/sys/netpfil/pf/pf.c
index 5fa7a8fe..e115061a 100644
--- a/freebsd/sys/netpfil/pf/pf.c
+++ b/freebsd/sys/netpfil/pf/pf.c
@@ -1270,8 +1270,8 @@ pf_state_insert(struct pfi_kif *kif, struct pf_state_key *skw,
refcount_init(&s->refs, 2);
counter_u64_add(V_pf_status.fcounters[FCNT_STATE_INSERT], 1);
- if (pfsync_insert_state_ptr != NULL)
- pfsync_insert_state_ptr(s);
+ if (V_pfsync_insert_state_ptr != NULL)
+ V_pfsync_insert_state_ptr(s);
/* Returns locked. */
return (0);
@@ -1674,8 +1674,8 @@ pf_unlink_state(struct pf_state *s, u_int flags)
LIST_REMOVE(s, entry);
pf_src_tree_remove_state(s);
- if (pfsync_delete_state_ptr != NULL)
- pfsync_delete_state_ptr(s);
+ if (V_pfsync_delete_state_ptr != NULL)
+ V_pfsync_delete_state_ptr(s);
STATE_DEC_COUNTERS(s);
@@ -3441,7 +3441,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm, int direction,
if (PF_ANEQ(daddr,
&nk->addr[pd->didx], AF_INET6))
- PF_ACPY(saddr, &nk->addr[pd->didx], af);
+ PF_ACPY(daddr, &nk->addr[pd->didx], af);
break;
#endif /* INET */
}
@@ -3594,7 +3594,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm, int direction,
if (*sm != NULL && !((*sm)->state_flags & PFSTATE_NOSYNC) &&
direction == PF_OUT &&
- pfsync_defer_ptr != NULL && pfsync_defer_ptr(*sm, m))
+ V_pfsync_defer_ptr != NULL && V_pfsync_defer_ptr(*sm, m))
/*
* We want the state created, but we dont
* want to send this in case a partner
@@ -6008,8 +6008,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb *
action = pf_test_state_tcp(&s, dir, kif, m, off, h, &pd,
&reason);
if (action == PF_PASS) {
- if (pfsync_update_state_ptr != NULL)
- pfsync_update_state_ptr(s);
+ if (V_pfsync_update_state_ptr != NULL)
+ V_pfsync_update_state_ptr(s);
r = s->rule.ptr;
a = s->anchor.ptr;
log = s->log;
@@ -6037,8 +6037,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb *
}
action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd);
if (action == PF_PASS) {
- if (pfsync_update_state_ptr != NULL)
- pfsync_update_state_ptr(s);
+ if (V_pfsync_update_state_ptr != NULL)
+ V_pfsync_update_state_ptr(s);
r = s->rule.ptr;
a = s->anchor.ptr;
log = s->log;
@@ -6060,8 +6060,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb *
action = pf_test_state_icmp(&s, dir, kif, m, off, h, &pd,
&reason);
if (action == PF_PASS) {
- if (pfsync_update_state_ptr != NULL)
- pfsync_update_state_ptr(s);
+ if (V_pfsync_update_state_ptr != NULL)
+ V_pfsync_update_state_ptr(s);
r = s->rule.ptr;
a = s->anchor.ptr;
log = s->log;
@@ -6083,8 +6083,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb *
default:
action = pf_test_state_other(&s, dir, kif, m, &pd);
if (action == PF_PASS) {
- if (pfsync_update_state_ptr != NULL)
- pfsync_update_state_ptr(s);
+ if (V_pfsync_update_state_ptr != NULL)
+ V_pfsync_update_state_ptr(s);
r = s->rule.ptr;
a = s->anchor.ptr;
log = s->log;
@@ -6447,8 +6447,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb
action = pf_test_state_tcp(&s, dir, kif, m, off, h, &pd,
&reason);
if (action == PF_PASS) {
- if (pfsync_update_state_ptr != NULL)
- pfsync_update_state_ptr(s);
+ if (V_pfsync_update_state_ptr != NULL)
+ V_pfsync_update_state_ptr(s);
r = s->rule.ptr;
a = s->anchor.ptr;
log = s->log;
@@ -6476,8 +6476,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb
}
action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd);
if (action == PF_PASS) {
- if (pfsync_update_state_ptr != NULL)
- pfsync_update_state_ptr(s);
+ if (V_pfsync_update_state_ptr != NULL)
+ V_pfsync_update_state_ptr(s);
r = s->rule.ptr;
a = s->anchor.ptr;
log = s->log;
@@ -6506,8 +6506,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb
action = pf_test_state_icmp(&s, dir, kif,
m, off, h, &pd, &reason);
if (action == PF_PASS) {
- if (pfsync_update_state_ptr != NULL)
- pfsync_update_state_ptr(s);
+ if (V_pfsync_update_state_ptr != NULL)
+ V_pfsync_update_state_ptr(s);
r = s->rule.ptr;
a = s->anchor.ptr;
log = s->log;
@@ -6520,8 +6520,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb
default:
action = pf_test_state_other(&s, dir, kif, m, &pd);
if (action == PF_PASS) {
- if (pfsync_update_state_ptr != NULL)
- pfsync_update_state_ptr(s);
+ if (V_pfsync_update_state_ptr != NULL)
+ V_pfsync_update_state_ptr(s);
r = s->rule.ptr;
a = s->anchor.ptr;
log = s->log;
diff --git a/freebsd/sys/netpfil/pf/pf_if.c b/freebsd/sys/netpfil/pf/pf_if.c
index 2c321118..ed69acad 100644
--- a/freebsd/sys/netpfil/pf/pf_if.c
+++ b/freebsd/sys/netpfil/pf/pf_if.c
@@ -167,8 +167,10 @@ pfi_cleanup_vnet(void)
RB_REMOVE(pfi_ifhead, &V_pfi_ifs, kif);
if (kif->pfik_group)
kif->pfik_group->ifg_pf_kif = NULL;
- if (kif->pfik_ifp)
+ if (kif->pfik_ifp) {
+ if_rele(kif->pfik_ifp);
kif->pfik_ifp->if_pf_kif = NULL;
+ }
free(kif, PFI_MTYPE);
}
@@ -324,6 +326,8 @@ pfi_attach_ifnet(struct ifnet *ifp)
V_pfi_update++;
kif = pfi_kif_attach(kif, ifp->if_xname);
+ if_ref(ifp);
+
kif->pfik_ifp = ifp;
ifp->if_pf_kif = kif;
@@ -555,7 +559,8 @@ pfi_instance_add(struct ifnet *ifp, int net, int flags)
if ((flags & PFI_AFLAG_PEER) &&
!(ifp->if_flags & IFF_POINTOPOINT))
continue;
- if ((flags & PFI_AFLAG_NETWORK) && af == AF_INET6 &&
+ if ((flags & (PFI_AFLAG_NETWORK | PFI_AFLAG_NOALIAS)) &&
+ af == AF_INET6 &&
IN6_IS_ADDR_LINKLOCAL(
&((struct sockaddr_in6 *)ia->ifa_addr)->sin6_addr))
continue;
@@ -835,6 +840,9 @@ pfi_detach_ifnet_event(void *arg __unused, struct ifnet *ifp)
{
struct pfi_kif *kif = (struct pfi_kif *)ifp->if_pf_kif;
+ if (pfsync_detach_ifnet_ptr)
+ pfsync_detach_ifnet_ptr(ifp);
+
if (kif == NULL)
return;
@@ -842,10 +850,13 @@ pfi_detach_ifnet_event(void *arg __unused, struct ifnet *ifp)
/* Avoid teardown race in the least expensive way. */
return;
}
+
PF_RULES_WLOCK();
V_pfi_update++;
pfi_kif_update(kif);
+ if_rele(kif->pfik_ifp);
+
kif->pfik_ifp = NULL;
ifp->if_pf_kif = NULL;
#ifdef ALTQ
@@ -906,6 +917,9 @@ pfi_detach_group_event(void *arg __unused, struct ifg_group *ifg)
static void
pfi_ifaddr_event(void *arg __unused, struct ifnet *ifp)
{
+
+ KASSERT(ifp, ("ifp == NULL"));
+
if (ifp->if_pf_kif == NULL)
return;
@@ -914,7 +928,7 @@ pfi_ifaddr_event(void *arg __unused, struct ifnet *ifp)
return;
}
PF_RULES_WLOCK();
- if (ifp && ifp->if_pf_kif) {
+ if (ifp->if_pf_kif) {
V_pfi_update++;
pfi_kif_update(ifp->if_pf_kif);
}
diff --git a/freebsd/sys/netpfil/pf/pf_ioctl.c b/freebsd/sys/netpfil/pf/pf_ioctl.c
index 9ca15a41..3f732d62 100644
--- a/freebsd/sys/netpfil/pf/pf_ioctl.c
+++ b/freebsd/sys/netpfil/pf/pf_ioctl.c
@@ -214,12 +214,14 @@ struct sx pf_ioctl_lock;
struct sx pf_end_lock;
/* pfsync */
-pfsync_state_import_t *pfsync_state_import_ptr = NULL;
-pfsync_insert_state_t *pfsync_insert_state_ptr = NULL;
-pfsync_update_state_t *pfsync_update_state_ptr = NULL;
-pfsync_delete_state_t *pfsync_delete_state_ptr = NULL;
-pfsync_clear_states_t *pfsync_clear_states_ptr = NULL;
-pfsync_defer_t *pfsync_defer_ptr = NULL;
+VNET_DEFINE(pfsync_state_import_t *, pfsync_state_import_ptr);
+VNET_DEFINE(pfsync_insert_state_t *, pfsync_insert_state_ptr);
+VNET_DEFINE(pfsync_update_state_t *, pfsync_update_state_ptr);
+VNET_DEFINE(pfsync_delete_state_t *, pfsync_delete_state_ptr);
+VNET_DEFINE(pfsync_clear_states_t *, pfsync_clear_states_ptr);
+VNET_DEFINE(pfsync_defer_t *, pfsync_defer_ptr);
+pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr;
+
/* pflog */
pflog_packet_t *pflog_packet_ptr = NULL;
@@ -1885,8 +1887,8 @@ relock_DIOCCLRSTATES:
PF_HASHROW_UNLOCK(ih);
}
psk->psk_killed = killed;
- if (pfsync_clear_states_ptr != NULL)
- pfsync_clear_states_ptr(V_pf_status.hostid, psk->psk_ifname);
+ if (V_pfsync_clear_states_ptr != NULL)
+ V_pfsync_clear_states_ptr(V_pf_status.hostid, psk->psk_ifname);
break;
}
@@ -1973,9 +1975,9 @@ relock_DIOCKILLSTATES:
error = EINVAL;
break;
}
- if (pfsync_state_import_ptr != NULL) {
+ if (V_pfsync_state_import_ptr != NULL) {
PF_RULES_RLOCK();
- error = pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL);
+ error = V_pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL);
PF_RULES_RUNLOCK();
} else
error = EOPNOTSUPP;
diff --git a/freebsd/sys/netpfil/pf/pf_norm.c b/freebsd/sys/netpfil/pf/pf_norm.c
index 0f98c669..9538e97c 100644
--- a/freebsd/sys/netpfil/pf/pf_norm.c
+++ b/freebsd/sys/netpfil/pf/pf_norm.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
- * Copyright 2011 Alexander Bluhm <bluhm@openbsd.org>
+ * Copyright 2011-2018 Alexander Bluhm <bluhm@openbsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -89,14 +89,17 @@ struct pf_fragment {
#define fr_af fr_key.frc_af
#define fr_proto fr_key.frc_proto
+ /* pointers to queue element */
+ struct pf_frent *fr_firstoff[PF_FRAG_ENTRY_POINTS];
+ /* count entries between pointers */
+ uint8_t fr_entries[PF_FRAG_ENTRY_POINTS];
RB_ENTRY(pf_fragment) fr_entry;
TAILQ_ENTRY(pf_fragment) frag_next;
uint32_t fr_timeout;
uint16_t fr_maxlen; /* maximum length of single fragment */
- uint16_t fr_entries; /* Total number of pf_fragment entries */
+ u_int16_t fr_holes; /* number of holes in the queue */
TAILQ_HEAD(pf_fragq, pf_frent) fr_queue;
};
-#define PF_MAX_FRENT_PER_FRAGMENT 64
struct pf_fragment_tag {
uint16_t ft_hdrlen; /* header length of reassembled pkt */
@@ -136,11 +139,18 @@ static void pf_remove_fragment(struct pf_fragment *);
static int pf_normalize_tcpopt(struct pf_rule *, struct mbuf *,
struct tcphdr *, int, sa_family_t);
static struct pf_frent *pf_create_fragment(u_short *);
+static int pf_frent_holes(struct pf_frent *frent);
static struct pf_fragment *pf_find_fragment(struct pf_fragment_cmp *key,
struct pf_frag_tree *tree);
+static inline int pf_frent_index(struct pf_frent *);
+static int pf_frent_insert(struct pf_fragment *,
+ struct pf_frent *, struct pf_frent *);
+void pf_frent_remove(struct pf_fragment *,
+ struct pf_frent *);
+struct pf_frent *pf_frent_previous(struct pf_fragment *,
+ struct pf_frent *);
static struct pf_fragment *pf_fillup_fragment(struct pf_fragment_cmp *,
struct pf_frent *, u_short *);
-static int pf_isfull_fragment(struct pf_fragment *);
static struct mbuf *pf_join_fragment(struct pf_fragment *);
#ifdef INET
static void pf_scrub_ip(struct mbuf **, uint32_t, uint8_t, uint8_t);
@@ -311,6 +321,7 @@ pf_remove_fragment(struct pf_fragment *frag)
{
PF_FRAG_ASSERT();
+ KASSERT(frag, ("frag != NULL"));
RB_REMOVE(pf_frag_tree, &V_pf_frag_tree, frag);
TAILQ_REMOVE(&V_pf_fragqueue, frag, frag_next);
@@ -337,9 +348,201 @@ pf_create_fragment(u_short *reason)
return (frent);
}
+/*
+ * Calculate the additional holes that were created in the fragment
+ * queue by inserting this fragment. A fragment in the middle
+ * creates one more hole by splitting. For each connected side,
+ * it loses one hole.
+ * Fragment entry must be in the queue when calling this function.
+ */
+static int
+pf_frent_holes(struct pf_frent *frent)
+{
+ struct pf_frent *prev = TAILQ_PREV(frent, pf_fragq, fr_next);
+ struct pf_frent *next = TAILQ_NEXT(frent, fr_next);
+ int holes = 1;
+
+ if (prev == NULL) {
+ if (frent->fe_off == 0)
+ holes--;
+ } else {
+ KASSERT(frent->fe_off != 0, ("frent->fe_off != 0"));
+ if (frent->fe_off == prev->fe_off + prev->fe_len)
+ holes--;
+ }
+ if (next == NULL) {
+ if (!frent->fe_mff)
+ holes--;
+ } else {
+ KASSERT(frent->fe_mff, ("frent->fe_mff"));
+ if (next->fe_off == frent->fe_off + frent->fe_len)
+ holes--;
+ }
+ return holes;
+}
+
+static inline int
+pf_frent_index(struct pf_frent *frent)
+{
+ /*
+ * We have an array of 16 entry points to the queue. A full size
+ * 65535 octet IP packet can have 8192 fragments. So the queue
+ * traversal length is at most 512 and at most 16 entry points are
+ * checked. We need 128 additional bytes on a 64 bit architecture.
+ */
+ CTASSERT(((u_int16_t)0xffff &~ 7) / (0x10000 / PF_FRAG_ENTRY_POINTS) ==
+ 16 - 1);
+ CTASSERT(((u_int16_t)0xffff >> 3) / PF_FRAG_ENTRY_POINTS == 512 - 1);
+
+ return frent->fe_off / (0x10000 / PF_FRAG_ENTRY_POINTS);
+}
+
+static int
+pf_frent_insert(struct pf_fragment *frag, struct pf_frent *frent,
+ struct pf_frent *prev)
+{
+ int index;
+
+ CTASSERT(PF_FRAG_ENTRY_LIMIT <= 0xff);
+
+ /*
+ * A packet has at most 65536 octets. With 16 entry points, each one
+ * spawns 4096 octets. We limit these to 64 fragments each, which
+ * means on average every fragment must have at least 64 octets.
+ */
+ index = pf_frent_index(frent);
+ if (frag->fr_entries[index] >= PF_FRAG_ENTRY_LIMIT)
+ return ENOBUFS;
+ frag->fr_entries[index]++;
+
+ if (prev == NULL) {
+ TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next);
+ } else {
+ KASSERT(prev->fe_off + prev->fe_len <= frent->fe_off,
+ ("overlapping fragment"));
+ TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next);
+ }
+
+ if (frag->fr_firstoff[index] == NULL) {
+ KASSERT(prev == NULL || pf_frent_index(prev) < index,
+ ("prev == NULL || pf_frent_index(pref) < index"));
+ frag->fr_firstoff[index] = frent;
+ } else {
+ if (frent->fe_off < frag->fr_firstoff[index]->fe_off) {
+ KASSERT(prev == NULL || pf_frent_index(prev) < index,
+ ("prev == NULL || pf_frent_index(pref) < index"));
+ frag->fr_firstoff[index] = frent;
+ } else {
+ KASSERT(prev != NULL, ("prev != NULL"));
+ KASSERT(pf_frent_index(prev) == index,
+ ("pf_frent_index(prev) == index"));
+ }
+ }
+
+ frag->fr_holes += pf_frent_holes(frent);
+
+ return 0;
+}
+
+void
+pf_frent_remove(struct pf_fragment *frag, struct pf_frent *frent)
+{
+#ifdef INVARIANTS
+ struct pf_frent *prev = TAILQ_PREV(frent, pf_fragq, fr_next);
+#endif
+ struct pf_frent *next = TAILQ_NEXT(frent, fr_next);
+ int index;
+
+ frag->fr_holes -= pf_frent_holes(frent);
+
+ index = pf_frent_index(frent);
+ KASSERT(frag->fr_firstoff[index] != NULL, ("frent not found"));
+ if (frag->fr_firstoff[index]->fe_off == frent->fe_off) {
+ if (next == NULL) {
+ frag->fr_firstoff[index] = NULL;
+ } else {
+ KASSERT(frent->fe_off + frent->fe_len <= next->fe_off,
+ ("overlapping fragment"));
+ if (pf_frent_index(next) == index) {
+ frag->fr_firstoff[index] = next;
+ } else {
+ frag->fr_firstoff[index] = NULL;
+ }
+ }
+ } else {
+ KASSERT(frag->fr_firstoff[index]->fe_off < frent->fe_off,
+ ("frag->fr_firstoff[index]->fe_off < frent->fe_off"));
+ KASSERT(prev != NULL, ("prev != NULL"));
+ KASSERT(prev->fe_off + prev->fe_len <= frent->fe_off,
+ ("overlapping fragment"));
+ KASSERT(pf_frent_index(prev) == index,
+ ("pf_frent_index(prev) == index"));
+ }
+
+ TAILQ_REMOVE(&frag->fr_queue, frent, fr_next);
+
+ KASSERT(frag->fr_entries[index] > 0, ("No fragments remaining"));
+ frag->fr_entries[index]--;
+}
+
+struct pf_frent *
+pf_frent_previous(struct pf_fragment *frag, struct pf_frent *frent)
+{
+ struct pf_frent *prev, *next;
+ int index;
+
+ /*
+ * If there are no fragments after frag, take the final one. Assume
+ * that the global queue is not empty.
+ */
+ prev = TAILQ_LAST(&frag->fr_queue, pf_fragq);
+ KASSERT(prev != NULL, ("prev != NULL"));
+ if (prev->fe_off <= frent->fe_off)
+ return prev;
+ /*
+ * We want to find a fragment entry that is before frag, but still
+ * close to it. Find the first fragment entry that is in the same
+ * entry point or in the first entry point after that. As we have
+ * already checked that there are entries behind frag, this will
+ * succeed.
+ */
+ for (index = pf_frent_index(frent); index < PF_FRAG_ENTRY_POINTS;
+ index++) {
+ prev = frag->fr_firstoff[index];
+ if (prev != NULL)
+ break;
+ }
+ KASSERT(prev != NULL, ("prev != NULL"));
+ /*
+ * In prev we may have a fragment from the same entry point that is
+ * before frent, or one that is just one position behind frent.
+ * In the latter case, we go back one step and have the predecessor.
+ * There may be none if the new fragment will be the first one.
+ */
+ if (prev->fe_off > frent->fe_off) {
+ prev = TAILQ_PREV(prev, pf_fragq, fr_next);
+ if (prev == NULL)
+ return NULL;
+ KASSERT(prev->fe_off <= frent->fe_off,
+ ("prev->fe_off <= frent->fe_off"));
+ return prev;
+ }
+ /*
+ * In prev is the first fragment of the entry point. The offset
+ * of frag is behind it. Find the closest previous fragment.
+ */
+ for (next = TAILQ_NEXT(prev, fr_next); next != NULL;
+ next = TAILQ_NEXT(next, fr_next)) {
+ if (next->fe_off > frent->fe_off)
+ break;
+ prev = next;
+ }
+ return prev;
+}
+
static struct pf_fragment *
pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent,
- u_short *reason)
+ u_short *reason)
{
struct pf_frent *after, *next, *prev;
struct pf_fragment *frag;
@@ -386,23 +589,22 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent,
}
*(struct pf_fragment_cmp *)frag = *key;
+ memset(frag->fr_firstoff, 0, sizeof(frag->fr_firstoff));
+ memset(frag->fr_entries, 0, sizeof(frag->fr_entries));
frag->fr_timeout = time_uptime;
frag->fr_maxlen = frent->fe_len;
- frag->fr_entries = 0;
+ frag->fr_holes = 1;
TAILQ_INIT(&frag->fr_queue);
RB_INSERT(pf_frag_tree, &V_pf_frag_tree, frag);
TAILQ_INSERT_HEAD(&V_pf_fragqueue, frag, frag_next);
- /* We do not have a previous fragment. */
- TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next);
+ /* We do not have a previous fragment, cannot fail. */
+ pf_frent_insert(frag, frent, NULL);
return (frag);
}
- if (frag->fr_entries >= PF_MAX_FRENT_PER_FRAGMENT)
- goto bad_fragment;
-
KASSERT(!TAILQ_EMPTY(&frag->fr_queue), ("!TAILQ_EMPTY()->fr_queue"));
/* Remember maximum fragment len for refragmentation. */
@@ -427,17 +629,15 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent,
goto bad_fragment;
}
- /* Find a fragment after the current one. */
- prev = NULL;
- TAILQ_FOREACH(after, &frag->fr_queue, fr_next) {
- if (after->fe_off > frent->fe_off)
- break;
- prev = after;
+ /* Find neighbors for newly inserted fragment */
+ prev = pf_frent_previous(frag, frent);
+ if (prev == NULL) {
+ after = TAILQ_FIRST(&frag->fr_queue);
+ KASSERT(after != NULL, ("after != NULL"));
+ } else {
+ after = TAILQ_NEXT(prev, fr_next);
}
- KASSERT(prev != NULL || after != NULL,
- ("prev != NULL || after != NULL"));
-
if (prev != NULL && prev->fe_off + prev->fe_len > frent->fe_off) {
uint16_t precut;
@@ -465,17 +665,16 @@ pf_fillup_fragment(struct pf_fragment_cmp *key, struct pf_frent *frent,
/* This fragment is completely overlapped, lose it. */
next = TAILQ_NEXT(after, fr_next);
+ pf_frent_remove(frag, after);
m_freem(after->fe_m);
- TAILQ_REMOVE(&frag->fr_queue, after, fr_next);
uma_zfree(V_pf_frent_z, after);
}
- if (prev == NULL)
- TAILQ_INSERT_HEAD(&frag->fr_queue, frent, fr_next);
- else
- TAILQ_INSERT_AFTER(&frag->fr_queue, prev, frent, fr_next);
-
- frag->fr_entries++;
+ /* If part of the queue gets too long, there is not way to recover. */
+ if (pf_frent_insert(frag, frent, prev)) {
+ DPFPRINTF(("fragment queue limit exceeded"));
+ goto bad_fragment;
+ }
return (frag);
@@ -486,40 +685,6 @@ drop_fragment:
return (NULL);
}
-static int
-pf_isfull_fragment(struct pf_fragment *frag)
-{
- struct pf_frent *frent, *next;
- uint16_t off, total;
-
- /* Check if we are completely reassembled */
- if (TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_mff)
- return (0);
-
- /* Maximum data we have seen already */
- total = TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_off +
- TAILQ_LAST(&frag->fr_queue, pf_fragq)->fe_len;
-
- /* Check if we have all the data */
- off = 0;
- for (frent = TAILQ_FIRST(&frag->fr_queue); frent; frent = next) {
- next = TAILQ_NEXT(frent, fr_next);
-
- off += frent->fe_len;
- if (off < total && (next == NULL || next->fe_off != off)) {
- DPFPRINTF(("missing fragment at %d, next %d, total %d",
- off, next == NULL ? -1 : next->fe_off, total));
- return (0);
- }
- }
- DPFPRINTF(("%d < %d?", off, total));
- if (off < total)
- return (0);
- KASSERT(off == total, ("off == total"));
-
- return (1);
-}
-
static struct mbuf *
pf_join_fragment(struct pf_fragment *frag)
{
@@ -580,8 +745,10 @@ pf_reassemble(struct mbuf **m0, struct ip *ip, int dir, u_short *reason)
/* The mbuf is part of the fragment entry, no direct free or access */
m = *m0 = NULL;
- if (!pf_isfull_fragment(frag))
+ if (frag->fr_holes) {
+ DPFPRINTF(("frag %d, holes %d", frag->fr_id, frag->fr_holes));
return (PF_PASS); /* drop because *m0 is NULL, no error */
+ }
/* We have all the data */
frent = TAILQ_FIRST(&frag->fr_queue);
@@ -664,7 +831,8 @@ pf_reassemble6(struct mbuf **m0, struct ip6_hdr *ip6, struct ip6_frag *fraghdr,
/* The mbuf is part of the fragment entry, no direct free or access. */
m = *m0 = NULL;
- if (!pf_isfull_fragment(frag)) {
+ if (frag->fr_holes) {
+ DPFPRINTF(("frag %d, holes %d", frag->fr_id, frag->fr_holes));
PF_FRAG_UNLOCK();
return (PF_PASS); /* Drop because *m0 is NULL, no error. */
}
diff --git a/freebsd/sys/netpfil/pf/pf_table.c b/freebsd/sys/netpfil/pf/pf_table.c
index 1fadd38c..3f15fb0e 100644
--- a/freebsd/sys/netpfil/pf/pf_table.c
+++ b/freebsd/sys/netpfil/pf/pf_table.c
@@ -1756,6 +1756,7 @@ pfr_setflags_ktable(struct pfr_ktable *kt, int newf)
PF_RULES_WASSERT();
if (!(newf & PFR_TFLAG_REFERENCED) &&
+ !(newf & PFR_TFLAG_REFDANCHOR) &&
!(newf & PFR_TFLAG_PERSIST))
newf &= ~PFR_TFLAG_ACTIVE;
if (!(newf & PFR_TFLAG_ACTIVE))
diff --git a/freebsd/sys/opencrypto/xform_auth.h b/freebsd/sys/opencrypto/xform_auth.h
index 06183868..9af0f8e6 100644
--- a/freebsd/sys/opencrypto/xform_auth.h
+++ b/freebsd/sys/opencrypto/xform_auth.h
@@ -36,6 +36,7 @@
#include <sys/md5.h>
#include <crypto/sha1.h>
+#include <crypto/sha2/sha224.h>
#include <crypto/sha2/sha256.h>
#include <crypto/sha2/sha384.h>
#include <crypto/sha2/sha512.h>
@@ -89,6 +90,7 @@ union authctx {
MD5_CTX md5ctx;
SHA1_CTX sha1ctx;
RMD160_CTX rmd160ctx;
+ SHA224_CTX sha224ctx;
SHA256_CTX sha256ctx;
SHA384_CTX sha384ctx;
SHA512_CTX sha512ctx;
diff --git a/freebsd/sys/security/audit/audit.h b/freebsd/sys/security/audit/audit.h
index f24bc1e5..2e47b8c4 100644
--- a/freebsd/sys/security/audit/audit.h
+++ b/freebsd/sys/security/audit/audit.h
@@ -122,7 +122,7 @@ void audit_arg_upath2(struct thread *td, int dirfd, char *upath);
void audit_arg_upath2_canon(char *upath);
void audit_arg_vnode1(struct vnode *vp);
void audit_arg_vnode2(struct vnode *vp);
-void audit_arg_text(char *text);
+void audit_arg_text(const char *text);
void audit_arg_cmd(int cmd);
void audit_arg_svipc_cmd(int cmd);
void audit_arg_svipc_perm(struct ipc_perm *perm);
diff --git a/freebsd/sys/sys/_domainset.h b/freebsd/sys/sys/_domainset.h
index 34d8f61c..5685d532 100644
--- a/freebsd/sys/sys/_domainset.h
+++ b/freebsd/sys/sys/_domainset.h
@@ -54,7 +54,7 @@ typedef struct _domainset domainset_t;
struct domainset;
struct domainset_ref {
struct domainset * volatile dr_policy;
- unsigned int dr_iterator;
+ unsigned int dr_iter;
};
#endif /* !_SYS__DOMAINSET_H_ */
diff --git a/freebsd/sys/sys/blist.h b/freebsd/sys/sys/blist.h
index 22d834f7..595d3477 100644
--- a/freebsd/sys/sys/blist.h
+++ b/freebsd/sys/sys/blist.h
@@ -73,22 +73,20 @@ typedef uint64_t u_daddr_t; /* unsigned disk address */
*/
typedef struct blmeta {
- union {
- daddr_t bmu_avail; /* space available under us */
- u_daddr_t bmu_bitmap; /* bitmap if we are a leaf */
- } u;
+ u_daddr_t bm_bitmap; /* bitmap if we are a leaf */
daddr_t bm_bighint; /* biggest contiguous block hint*/
} blmeta_t;
typedef struct blist {
daddr_t bl_blocks; /* area of coverage */
+ daddr_t bl_avail; /* # available blocks */
u_daddr_t bl_radix; /* coverage radix */
daddr_t bl_cursor; /* next-fit search starts at */
blmeta_t bl_root[1]; /* root of radix tree */
} *blist_t;
-#define BLIST_META_RADIX 16
#define BLIST_BMAP_RADIX (sizeof(u_daddr_t)*8)
+#define BLIST_META_RADIX BLIST_BMAP_RADIX
#define BLIST_MAX_ALLOC BLIST_BMAP_RADIX
diff --git a/freebsd/sys/sys/capability.h b/freebsd/sys/sys/capability.h
index 4b07c090..39195e03 100644
--- a/freebsd/sys/sys/capability.h
+++ b/freebsd/sys/sys/capability.h
@@ -35,7 +35,8 @@
* Historically, the key userspace and kernel Capsicum definitions were found
* in this file. However, it conflicted with POSIX.1e's capability.h, so has
* been renamed capsicum.h. The file remains for backwards compatibility
- * reasons as a nested include.
+ * reasons as a nested include. It is expected to be removed before
+ * FreeBSD 13.
*/
#ifndef _SYS_CAPABILITY_H_
#define _SYS_CAPABILITY_H_
diff --git a/freebsd/sys/sys/domainset.h b/freebsd/sys/sys/domainset.h
index 32b35ac5..5a00347f 100644
--- a/freebsd/sys/sys/domainset.h
+++ b/freebsd/sys/sys/domainset.h
@@ -96,7 +96,8 @@ struct domainset {
domainid_t ds_order[MAXMEMDOM]; /* nth domain table. */
};
-extern struct domainset domainset_prefer[MAXMEMDOM];
+extern struct domainset domainset_fixed[MAXMEMDOM], domainset_prefer[MAXMEMDOM];
+#define DOMAINSET_FIXED(domain) (&domainset_fixed[(domain)])
#define DOMAINSET_PREF(domain) (&domainset_prefer[(domain)])
extern struct domainset domainset_roundrobin;
#define DOMAINSET_RR() (&domainset_roundrobin)
diff --git a/freebsd/sys/sys/gtaskqueue.h b/freebsd/sys/sys/gtaskqueue.h
index c06ef503..a36c770a 100644
--- a/freebsd/sys/sys/gtaskqueue.h
+++ b/freebsd/sys/sys/gtaskqueue.h
@@ -52,7 +52,9 @@ int gtaskqueue_cancel(struct gtaskqueue *queue, struct gtask *gtask);
void gtaskqueue_drain(struct gtaskqueue *queue, struct gtask *task);
void gtaskqueue_drain_all(struct gtaskqueue *queue);
-int grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *task);
+void grouptask_block(struct grouptask *grouptask);
+void grouptask_unblock(struct grouptask *grouptask);
+int grouptaskqueue_enqueue(struct gtaskqueue *queue, struct gtask *task);
void taskqgroup_attach(struct taskqgroup *qgroup, struct grouptask *grptask,
void *uniq, int irq, const char *name);
int taskqgroup_attach_cpu(struct taskqgroup *qgroup, struct grouptask *grptask,
@@ -67,6 +69,7 @@ void taskqgroup_config_gtask_deinit(struct grouptask *gtask);
#define TASK_ENQUEUED 0x1
#define TASK_SKIP_WAKEUP 0x2
+#define TASK_NOENQUEUE 0x4
#define GTASK_INIT(task, flags, priority, func, context) do { \
diff --git a/freebsd/sys/sys/malloc.h b/freebsd/sys/sys/malloc.h
index 4e7a8df3..ca81a198 100644
--- a/freebsd/sys/sys/malloc.h
+++ b/freebsd/sys/sys/malloc.h
@@ -166,6 +166,7 @@ MALLOC_DECLARE(M_TEMP);
*/
MALLOC_DECLARE(M_IOV);
+struct domainset;
extern struct mtx malloc_mtx;
/*
@@ -178,8 +179,8 @@ void *contigmalloc(unsigned long size, struct malloc_type *type, int flags,
vm_paddr_t low, vm_paddr_t high, unsigned long alignment,
vm_paddr_t boundary) __malloc_like __result_use_check
__alloc_size(1) __alloc_align(6);
-void *contigmalloc_domain(unsigned long size, struct malloc_type *type,
- int domain, int flags, vm_paddr_t low, vm_paddr_t high,
+void *contigmalloc_domainset(unsigned long size, struct malloc_type *type,
+ struct domainset *ds, int flags, vm_paddr_t low, vm_paddr_t high,
unsigned long alignment, vm_paddr_t boundary)
__malloc_like __result_use_check __alloc_size(1) __alloc_align(6);
void free(void *addr, struct malloc_type *type);
@@ -248,8 +249,9 @@ void *_bsd_malloc(size_t size, struct malloc_type *type, int flags)
_malloc_item; \
})
-void *malloc_domain(size_t size, struct malloc_type *type, int domain,
- int flags) __malloc_like __result_use_check __alloc_size(1);
+void *malloc_domainset(size_t size, struct malloc_type *type,
+ struct domainset *ds, int flags) __malloc_like __result_use_check
+ __alloc_size(1);
void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type,
int flags) __malloc_like __result_use_check
__alloc_size2(1, 2);
diff --git a/freebsd/sys/sys/mount.h b/freebsd/sys/sys/mount.h
index c4f4bebf..ac1c215b 100644
--- a/freebsd/sys/sys/mount.h
+++ b/freebsd/sys/sys/mount.h
@@ -513,6 +513,7 @@ struct vfsconf {
u_int vfc_version; /* ABI version number */
char vfc_name[MFSNAMELEN]; /* filesystem type name */
struct vfsops *vfc_vfsops; /* filesystem operations vector */
+ struct vfsops *vfc_vfsops_sd; /* ... signal-deferred */
int vfc_typenum; /* historic filesystem type number */
int vfc_refcount; /* number mounted of this type */
int vfc_flags; /* permanent flags */
@@ -553,7 +554,8 @@ struct ovfsconf {
#define VFCF_UNICODE 0x00200000 /* stores file names as Unicode */
#define VFCF_JAIL 0x00400000 /* can be mounted from within a jail */
#define VFCF_DELEGADMIN 0x00800000 /* supports delegated administration */
-#define VFCF_SBDRY 0x01000000 /* defer stop requests */
+#define VFCF_SBDRY 0x01000000 /* Stop at Boundary: defer stop requests
+ to kernel->user (AST) transition */
typedef uint32_t fsctlop_t;
@@ -694,139 +696,96 @@ struct vfsops {
vfs_statfs_t __vfs_statfs;
-#define VFS_PROLOGUE(MP) do { \
- struct mount *mp__; \
- int _prev_stops; \
- \
- mp__ = (MP); \
- _prev_stops = sigdeferstop((mp__ != NULL && \
- (mp__->mnt_vfc->vfc_flags & VFCF_SBDRY) != 0) ? \
- SIGDEFERSTOP_SILENT : SIGDEFERSTOP_NOP);
-
-#define VFS_EPILOGUE(MP) \
- sigallowstop(_prev_stops); \
-} while (0)
-
#define VFS_MOUNT(MP) ({ \
int _rc; \
\
TSRAW(curthread, TS_ENTER, "VFS_MOUNT", (MP)->mnt_vfc->vfc_name);\
- VFS_PROLOGUE(MP); \
_rc = (*(MP)->mnt_op->vfs_mount)(MP); \
- VFS_EPILOGUE(MP); \
TSRAW(curthread, TS_EXIT, "VFS_MOUNT", (MP)->mnt_vfc->vfc_name);\
_rc; })
#define VFS_UNMOUNT(MP, FORCE) ({ \
int _rc; \
\
- VFS_PROLOGUE(MP); \
_rc = (*(MP)->mnt_op->vfs_unmount)(MP, FORCE); \
- VFS_EPILOGUE(MP); \
_rc; })
#define VFS_ROOT(MP, FLAGS, VPP) ({ \
int _rc; \
\
- VFS_PROLOGUE(MP); \
_rc = (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP); \
- VFS_EPILOGUE(MP); \
_rc; })
#define VFS_QUOTACTL(MP, C, U, A) ({ \
int _rc; \
\
- VFS_PROLOGUE(MP); \
_rc = (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A); \
- VFS_EPILOGUE(MP); \
_rc; })
#define VFS_STATFS(MP, SBP) ({ \
int _rc; \
\
- VFS_PROLOGUE(MP); \
_rc = __vfs_statfs((MP), (SBP)); \
- VFS_EPILOGUE(MP); \
_rc; })
#define VFS_SYNC(MP, WAIT) ({ \
int _rc; \
\
- VFS_PROLOGUE(MP); \
_rc = (*(MP)->mnt_op->vfs_sync)(MP, WAIT); \
- VFS_EPILOGUE(MP); \
_rc; })
#define VFS_VGET(MP, INO, FLAGS, VPP) ({ \
int _rc; \
\
- VFS_PROLOGUE(MP); \
_rc = (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP); \
- VFS_EPILOGUE(MP); \
_rc; })
#define VFS_FHTOVP(MP, FIDP, FLAGS, VPP) ({ \
int _rc; \
\
- VFS_PROLOGUE(MP); \
_rc = (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, FLAGS, VPP); \
- VFS_EPILOGUE(MP); \
_rc; })
#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) ({ \
int _rc; \
\
- VFS_PROLOGUE(MP); \
_rc = (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC,\
SEC); \
- VFS_EPILOGUE(MP); \
_rc; })
#define VFS_EXTATTRCTL(MP, C, FN, NS, N) ({ \
int _rc; \
\
- VFS_PROLOGUE(MP); \
_rc = (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N); \
- VFS_EPILOGUE(MP); \
_rc; })
#define VFS_SYSCTL(MP, OP, REQ) ({ \
int _rc; \
\
- VFS_PROLOGUE(MP); \
_rc = (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ); \
- VFS_EPILOGUE(MP); \
_rc; })
#define VFS_SUSP_CLEAN(MP) do { \
if (*(MP)->mnt_op->vfs_susp_clean != NULL) { \
- VFS_PROLOGUE(MP); \
(*(MP)->mnt_op->vfs_susp_clean)(MP); \
- VFS_EPILOGUE(MP); \
} \
} while (0)
#define VFS_RECLAIM_LOWERVP(MP, VP) do { \
if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) { \
- VFS_PROLOGUE(MP); \
(*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); \
- VFS_EPILOGUE(MP); \
} \
} while (0)
#define VFS_UNLINK_LOWERVP(MP, VP) do { \
if (*(MP)->mnt_op->vfs_unlink_lowervp != NULL) { \
- VFS_PROLOGUE(MP); \
(*(MP)->mnt_op->vfs_unlink_lowervp)((MP), (VP)); \
- VFS_EPILOGUE(MP); \
} \
} while (0)
#define VFS_PURGE(MP) do { \
if (*(MP)->mnt_op->vfs_purge != NULL) { \
- VFS_PROLOGUE(MP); \
(*(MP)->mnt_op->vfs_purge)(MP); \
- VFS_EPILOGUE(MP); \
} \
} while (0)
diff --git a/freebsd/sys/sys/mouse.h b/freebsd/sys/sys/mouse.h
index 3bb65d5c..e6ea68bc 100644
--- a/freebsd/sys/sys/mouse.h
+++ b/freebsd/sys/sys/mouse.h
@@ -190,7 +190,7 @@ typedef struct mousemode {
* GlidePoint, IntelliMouse, Thinking Mouse, MouseRemote, Kidspad,
* VersaPad
* Bus mouse protocols:
- * bus, InPort
+ * bus, InPort -- both of these are now obsolete and will be remvoed soon.
* PS/2 mouse protocol:
* PS/2
*/
@@ -200,8 +200,8 @@ typedef struct mousemode {
#define MOUSE_PROTO_LOGI 2 /* Logitech, 3 bytes */
#define MOUSE_PROTO_MM 3 /* MM series, 3 bytes */
#define MOUSE_PROTO_LOGIMOUSEMAN 4 /* Logitech MouseMan 3/4 bytes */
-/* 5 was bus mouse */
-/* 6 was inport mosue */
+#define MOUSE_PROTO_BUS 5 /* bus mouse -- obsolete */
+#define MOUSE_PROTO_INPORT 6 /* inport mosue -- obsolete */
#define MOUSE_PROTO_PS2 7 /* PS/2 mouse, 3 bytes */
#define MOUSE_PROTO_HITTAB 8 /* Hitachi Tablet 3 bytes */
#define MOUSE_PROTO_GLIDEPOINT 9 /* ALPS GlidePoint, 3/4 bytes */
diff --git a/freebsd/sys/sys/proc.h b/freebsd/sys/sys/proc.h
index 9372b3a0..9868f9cf 100644
--- a/freebsd/sys/sys/proc.h
+++ b/freebsd/sys/sys/proc.h
@@ -73,6 +73,9 @@
#ifdef _KERNEL
#include <machine/cpu.h>
#endif
+#ifdef __rtems__
+#include <sys/epoch.h>
+#endif /* __rtems__ */
/*
* One structure allocated per session.
@@ -193,6 +196,7 @@ struct trapframe;
struct turnstile;
struct vm_map;
struct vm_map_entry;
+struct epoch_tracker;
/*
* XXX: Does this belong in resource.h or resourcevar.h instead?
@@ -236,6 +240,7 @@ struct thread {
#ifdef __rtems__
Thread_Control *td_thread;
struct rtems_bsd_program_control *td_prog_ctrl;
+ struct epoch_tracker td_et[1]; /* (k) compat KPI spare tracker */
#endif /* __rtems__ */
#ifndef __rtems__
struct mtx *volatile td_lock; /* replaces sched lock */
@@ -395,6 +400,7 @@ struct thread {
int td_lastcpu; /* (t) Last cpu we were on. */
int td_oncpu; /* (t) Which cpu we are on. */
void *td_lkpi_task; /* LinuxKPI task struct pointer */
+ struct epoch_tracker *td_et; /* (k) compat KPI spare tracker */
int td_pmcpend;
#endif /* __rtems__ */
};
diff --git a/freebsd/sys/sys/random.h b/freebsd/sys/sys/random.h
index 2543bfec..aa6f6458 100644
--- a/freebsd/sys/sys/random.h
+++ b/freebsd/sys/sys/random.h
@@ -102,9 +102,6 @@ enum random_entropy_source {
_Static_assert(ENTROPYSOURCE <= 32,
"hardcoded assumption that values fit in a typical word-sized bitset");
-#define RANDOM_HARVEST_EVERYTHING_MASK ((1 << (RANDOM_ENVIRONMENTAL_END + 1)) - 1)
-#define RANDOM_HARVEST_PURE_MASK (((1 << ENTROPYSOURCE) - 1) & (-1UL << RANDOM_PURE_START))
-
#define RANDOM_LEGACY_BOOT_ENTROPY_MODULE "/boot/entropy"
#define RANDOM_CACHED_BOOT_ENTROPY_MODULE "boot_entropy_cache"
#define RANDOM_CACHED_SKIP_START 256
diff --git a/freebsd/sys/sys/socketvar.h b/freebsd/sys/sys/socketvar.h
index 96ba4a01..af85aa05 100644
--- a/freebsd/sys/sys/socketvar.h
+++ b/freebsd/sys/sys/socketvar.h
@@ -380,7 +380,8 @@ struct uio;
* From uipc_socket and friends
*/
#ifndef __rtems__
-int getsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len);
+int getsockaddr(struct sockaddr **namp, const struct sockaddr *uaddr,
+ size_t len);
#endif /* __rtems__ */
int getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp,
struct file **fpp, u_int *fflagp, struct filecaps *havecaps);
diff --git a/freebsd/sys/sys/sysctl.h b/freebsd/sys/sys/sysctl.h
index 995baf64..e270a4b2 100644
--- a/freebsd/sys/sys/sysctl.h
+++ b/freebsd/sys/sys/sysctl.h
@@ -220,6 +220,9 @@ int sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARGS);
int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS);
int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS);
+int sysctl_msec_to_sbintime(SYSCTL_HANDLER_ARGS);
+int sysctl_usec_to_sbintime(SYSCTL_HANDLER_ARGS);
+
int sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS);
int sysctl_dpcpu_long(SYSCTL_HANDLER_ARGS);
int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS);
@@ -840,6 +843,42 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
NULL); \
})
+/* OID expressing a sbintime_t as microseconds */
+#define SYSCTL_SBINTIME_USEC(parent, nbr, name, access, ptr, descr) \
+ SYSCTL_OID(parent, nbr, name, \
+ CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \
+ (ptr), 0, sysctl_usec_to_sbintime, "Q", descr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64)
+#define SYSCTL_ADD_SBINTIME_USEC(ctx, parent, nbr, name, access, ptr, descr) \
+({ \
+ sbintime_t *__ptr = (ptr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64); \
+ sysctl_add_oid(ctx, parent, nbr, name, \
+ CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \
+ __ptr, 0, sysctl_usec_to_sbintime, "Q", __DESCR(descr), \
+ NULL); \
+})
+
+/* OID expressing a sbintime_t as milliseconds */
+#define SYSCTL_SBINTIME_MSEC(parent, nbr, name, access, ptr, descr) \
+ SYSCTL_OID(parent, nbr, name, \
+ CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \
+ (ptr), 0, sysctl_msec_to_sbintime, "Q", descr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64)
+#define SYSCTL_ADD_SBINTIME_MSEC(ctx, parent, nbr, name, access, ptr, descr) \
+({ \
+ sbintime_t *__ptr = (ptr); \
+ CTASSERT(((access) & CTLTYPE) == 0 || \
+ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_S64); \
+ sysctl_add_oid(ctx, parent, nbr, name, \
+ CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access), \
+ __ptr, 0, sysctl_msec_to_sbintime, "Q", __DESCR(descr), \
+ NULL); \
+})
+
/*
* A macro to generate a read-only sysctl to indicate the presence of optional
* kernel features.
diff --git a/freebsd/sys/sys/sysproto.h b/freebsd/sys/sys/sysproto.h
index 8317e586..a39f5cd3 100644
--- a/freebsd/sys/sys/sysproto.h
+++ b/freebsd/sys/sys/sysproto.h
@@ -55,9 +55,9 @@ struct write_args {
char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
};
struct open_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
- char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
+ char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
};
struct close_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
@@ -69,24 +69,24 @@ struct wait4_args {
char rusage_l_[PADL_(struct rusage *)]; struct rusage * rusage; char rusage_r_[PADR_(struct rusage *)];
};
struct link_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
- char link_l_[PADL_(char *)]; char * link; char link_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+ char link_l_[PADL_(const char *)]; const char * link; char link_r_[PADR_(const char *)];
};
struct unlink_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
};
struct chdir_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
};
struct fchdir_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
};
struct chmod_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
- char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+ char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
};
struct chown_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)];
char gid_l_[PADL_(int)]; int gid; char gid_r_[PADR_(int)];
};
@@ -97,13 +97,13 @@ struct getpid_args {
register_t dummy;
};
struct mount_args {
- char type_l_[PADL_(char *)]; char * type; char type_r_[PADR_(char *)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char type_l_[PADL_(const char *)]; const char * type; char type_r_[PADR_(const char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
- char data_l_[PADL_(caddr_t)]; caddr_t data; char data_r_[PADR_(caddr_t)];
+ char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)];
};
struct unmount_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
};
struct setuid_args {
@@ -138,7 +138,7 @@ struct sendmsg_args {
};
struct recvfrom_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
- char buf_l_[PADL_(caddr_t)]; caddr_t buf; char buf_r_[PADR_(caddr_t)];
+ char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
char from_l_[PADL_(struct sockaddr *)]; struct sockaddr * from; char from_r_[PADR_(struct sockaddr *)];
@@ -161,7 +161,7 @@ struct getsockname_args {
};
#ifndef __rtems__
struct access_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char amode_l_[PADL_(int)]; int amode; char amode_r_[PADR_(int)];
};
struct chflags_args {
@@ -192,7 +192,7 @@ struct getegid_args {
register_t dummy;
};
struct profil_args {
- char samples_l_[PADL_(caddr_t)]; caddr_t samples; char samples_r_[PADR_(caddr_t)];
+ char samples_l_[PADL_(char *)]; char * samples; char samples_r_[PADR_(char *)];
char size_l_[PADL_(size_t)]; size_t size; char size_r_[PADR_(size_t)];
char offset_l_[PADL_(size_t)]; size_t offset; char offset_r_[PADR_(size_t)];
char scale_l_[PADL_(u_int)]; u_int scale; char scale_r_[PADR_(u_int)];
@@ -211,10 +211,10 @@ struct getlogin_args {
char namelen_l_[PADL_(u_int)]; u_int namelen; char namelen_r_[PADR_(u_int)];
};
struct setlogin_args {
- char namebuf_l_[PADL_(char *)]; char * namebuf; char namebuf_r_[PADR_(char *)];
+ char namebuf_l_[PADL_(const char *)]; const char * namebuf; char namebuf_r_[PADR_(const char *)];
};
struct acct_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
};
struct osigpending_args {
register_t dummy;
@@ -226,33 +226,33 @@ struct sigaltstack_args {
struct ioctl_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char com_l_[PADL_(u_long)]; u_long com; char com_r_[PADR_(u_long)];
- char data_l_[PADL_(caddr_t)]; caddr_t data; char data_r_[PADR_(caddr_t)];
+ char data_l_[PADL_(char *)]; char * data; char data_r_[PADR_(char *)];
};
struct reboot_args {
char opt_l_[PADL_(int)]; int opt; char opt_r_[PADR_(int)];
};
struct revoke_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
};
struct symlink_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
- char link_l_[PADL_(char *)]; char * link; char link_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+ char link_l_[PADL_(const char *)]; const char * link; char link_r_[PADR_(const char *)];
};
struct readlink_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
char count_l_[PADL_(size_t)]; size_t count; char count_r_[PADR_(size_t)];
};
struct execve_args {
- char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)];
+ char fname_l_[PADL_(const char *)]; const char * fname; char fname_r_[PADR_(const char *)];
char argv_l_[PADL_(char **)]; char ** argv; char argv_r_[PADR_(char **)];
char envv_l_[PADL_(char **)]; char ** envv; char envv_r_[PADR_(char **)];
};
struct umask_args {
- char newmask_l_[PADL_(int)]; int newmask; char newmask_r_[PADR_(int)];
+ char newmask_l_[PADL_(mode_t)]; mode_t newmask; char newmask_r_[PADR_(mode_t)];
};
struct chroot_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
};
struct getpagesize_args {
register_t dummy;
@@ -314,7 +314,7 @@ struct owait_args {
register_t dummy;
};
struct swapon_args {
- char name_l_[PADL_(char *)]; char * name; char name_r_[PADR_(char *)];
+ char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)];
};
struct getitimer_args {
char which_l_[PADL_(u_int)]; u_int which; char which_r_[PADR_(u_int)];
@@ -355,7 +355,7 @@ struct socket_args {
};
struct connect_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
- char name_l_[PADL_(caddr_t)]; caddr_t name; char name_r_[PADR_(caddr_t)];
+ char name_l_[PADL_(const struct sockaddr *)]; const struct sockaddr * name; char name_r_[PADR_(const struct sockaddr *)];
#ifndef __rtems__
char namelen_l_[PADL_(int)]; int namelen; char namelen_r_[PADR_(int)];
#else /* __rtems__ */
@@ -370,7 +370,7 @@ struct getpriority_args {
#endif /* __rtems__ */
struct bind_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
- char name_l_[PADL_(caddr_t)]; caddr_t name; char name_r_[PADR_(caddr_t)];
+ char name_l_[PADL_(const struct sockaddr *)]; const struct sockaddr * name; char name_r_[PADR_(const struct sockaddr *)];
#ifndef __rtems__
char namelen_l_[PADL_(int)]; int namelen; char namelen_r_[PADR_(int)];
#else /* __rtems__ */
@@ -381,7 +381,7 @@ struct setsockopt_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
char level_l_[PADL_(int)]; int level; char level_r_[PADR_(int)];
char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)];
- char val_l_[PADL_(caddr_t)]; caddr_t val; char val_r_[PADR_(caddr_t)];
+ char val_l_[PADL_(const void *)]; const void * val; char val_r_[PADR_(const void *)];
#ifndef __rtems__
char valsize_l_[PADL_(int)]; int valsize; char valsize_r_[PADR_(int)];
#else /* __rtems__ */
@@ -406,7 +406,7 @@ struct getsockopt_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
char level_l_[PADL_(int)]; int level; char level_r_[PADR_(int)];
char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)];
- char val_l_[PADL_(caddr_t)]; caddr_t val; char val_r_[PADR_(caddr_t)];
+ char val_l_[PADL_(void *)]; void * val; char val_r_[PADR_(void *)];
#ifndef __rtems__
char avalsize_l_[PADL_(int *)]; int * avalsize; char avalsize_r_[PADR_(int *)];
#else /* __rtems__ */
@@ -435,7 +435,7 @@ struct fchown_args {
};
struct fchmod_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
+ char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
};
struct setreuid_args {
char ruid_l_[PADL_(int)]; int ruid; char ruid_r_[PADR_(int)];
@@ -446,24 +446,24 @@ struct setregid_args {
char egid_l_[PADL_(int)]; int egid; char egid_r_[PADR_(int)];
};
struct rename_args {
- char from_l_[PADL_(char *)]; char * from; char from_r_[PADR_(char *)];
- char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)];
+ char from_l_[PADL_(const char *)]; const char * from; char from_r_[PADR_(const char *)];
+ char to_l_[PADL_(const char *)]; const char * to; char to_r_[PADR_(const char *)];
};
struct flock_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char how_l_[PADL_(int)]; int how; char how_r_[PADR_(int)];
};
struct mkfifo_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
- char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+ char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
};
#endif /* __rtems__ */
struct sendto_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
- char buf_l_[PADL_(caddr_t)]; caddr_t buf; char buf_r_[PADR_(caddr_t)];
+ char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)];
char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
- char to_l_[PADL_(caddr_t)]; caddr_t to; char to_r_[PADR_(caddr_t)];
+ char to_l_[PADL_(const struct sockaddr *)]; const struct sockaddr * to; char to_r_[PADR_(const struct sockaddr *)];
#ifndef __rtems__
char tolen_l_[PADL_(int)]; int tolen; char tolen_r_[PADR_(int)];
#else /* __rtems__ */
@@ -482,14 +482,14 @@ struct socketpair_args {
};
#ifndef __rtems__
struct mkdir_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
- char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+ char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
};
struct rmdir_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
};
struct utimes_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char tptr_l_[PADL_(struct timeval *)]; struct timeval * tptr; char tptr_r_[PADR_(struct timeval *)];
};
struct adjtime_args {
@@ -503,10 +503,10 @@ struct setsid_args {
register_t dummy;
};
struct quotactl_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char cmd_l_[PADL_(int)]; int cmd; char cmd_r_[PADR_(int)];
char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)];
- char arg_l_[PADL_(caddr_t)]; caddr_t arg; char arg_r_[PADR_(caddr_t)];
+ char arg_l_[PADL_(void *)]; void * arg; char arg_r_[PADR_(void *)];
};
struct oquota_args {
register_t dummy;
@@ -519,14 +519,14 @@ struct nlm_syscall_args {
};
struct nfssvc_args {
char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
- char argp_l_[PADL_(caddr_t)]; caddr_t argp; char argp_r_[PADR_(caddr_t)];
+ char argp_l_[PADL_(void *)]; void * argp; char argp_r_[PADR_(void *)];
};
struct lgetfh_args {
- char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)];
+ char fname_l_[PADL_(const char *)]; const char * fname; char fname_r_[PADR_(const char *)];
char fhp_l_[PADL_(struct fhandle *)]; struct fhandle * fhp; char fhp_r_[PADR_(struct fhandle *)];
};
struct getfh_args {
- char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)];
+ char fname_l_[PADL_(const char *)]; const char * fname; char fname_r_[PADR_(const char *)];
char fhp_l_[PADL_(struct fhandle *)]; struct fhandle * fhp; char fhp_r_[PADR_(struct fhandle *)];
};
struct sysarch_args {
@@ -577,7 +577,7 @@ struct seteuid_args {
char euid_l_[PADL_(uid_t)]; uid_t euid; char euid_r_[PADR_(uid_t)];
};
struct pathconf_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)];
};
struct fpathconf_args {
@@ -609,7 +609,7 @@ struct munlock_args {
char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
};
struct undelete_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
};
struct futimes_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
@@ -737,7 +737,7 @@ struct issetugid_args {
register_t dummy;
};
struct lchown_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char uid_l_[PADL_(int)]; int uid; char uid_r_[PADR_(int)];
char gid_l_[PADL_(int)]; int gid; char gid_r_[PADR_(int)];
};
@@ -754,11 +754,11 @@ struct lio_listio_args {
char sig_l_[PADL_(struct sigevent *)]; struct sigevent * sig; char sig_r_[PADR_(struct sigevent *)];
};
struct lchmod_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
};
struct lutimes_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char tptr_l_[PADL_(struct timeval *)]; struct timeval * tptr; char tptr_r_[PADR_(struct timeval *)];
};
struct preadv_args {
@@ -1024,7 +1024,7 @@ struct __setugid_args {
char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
};
struct eaccess_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char amode_l_[PADL_(int)]; int amode; char amode_r_[PADR_(int)];
};
struct afs3_syscall_args {
@@ -1156,7 +1156,7 @@ struct extattr_delete_link_args {
char attrname_l_[PADL_(const char *)]; const char * attrname; char attrname_r_[PADR_(const char *)];
};
struct __mac_execve_args {
- char fname_l_[PADL_(char *)]; char * fname; char fname_r_[PADR_(char *)];
+ char fname_l_[PADL_(const char *)]; const char * fname; char fname_r_[PADR_(const char *)];
char argv_l_[PADL_(char **)]; char ** argv; char argv_r_[PADR_(char **)];
char envv_l_[PADL_(char **)]; char ** envv; char envv_r_[PADR_(char **)];
char mac_p_l_[PADL_(struct mac *)]; struct mac * mac_p; char mac_p_r_[PADR_(struct mac *)];
@@ -1285,7 +1285,7 @@ struct setaudit_addr_args {
char length_l_[PADL_(u_int)]; u_int length; char length_r_[PADR_(u_int)];
};
struct auditctl_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
};
struct _umtx_op_args {
char obj_l_[PADL_(void *)]; void * obj; char obj_r_[PADR_(void *)];
@@ -1359,9 +1359,9 @@ struct sctp_peeloff_args {
};
struct sctp_generic_sendmsg_args {
char sd_l_[PADL_(int)]; int sd; char sd_r_[PADR_(int)];
- char msg_l_[PADL_(caddr_t)]; caddr_t msg; char msg_r_[PADR_(caddr_t)];
+ char msg_l_[PADL_(void *)]; void * msg; char msg_r_[PADR_(void *)];
char mlen_l_[PADL_(int)]; int mlen; char mlen_r_[PADR_(int)];
- char to_l_[PADL_(caddr_t)]; caddr_t to; char to_r_[PADR_(caddr_t)];
+ char to_l_[PADL_(struct sockaddr *)]; struct sockaddr * to; char to_r_[PADR_(struct sockaddr *)];
char tolen_l_[PADL_(__socklen_t)]; __socklen_t tolen; char tolen_r_[PADR_(__socklen_t)];
char sinfo_l_[PADL_(struct sctp_sndrcvinfo *)]; struct sctp_sndrcvinfo * sinfo; char sinfo_r_[PADR_(struct sctp_sndrcvinfo *)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
@@ -1370,7 +1370,7 @@ struct sctp_generic_sendmsg_iov_args {
char sd_l_[PADL_(int)]; int sd; char sd_r_[PADR_(int)];
char iov_l_[PADL_(struct iovec *)]; struct iovec * iov; char iov_r_[PADR_(struct iovec *)];
char iovlen_l_[PADL_(int)]; int iovlen; char iovlen_r_[PADR_(int)];
- char to_l_[PADL_(caddr_t)]; caddr_t to; char to_r_[PADR_(caddr_t)];
+ char to_l_[PADL_(struct sockaddr *)]; struct sockaddr * to; char to_r_[PADR_(struct sockaddr *)];
char tolen_l_[PADL_(__socklen_t)]; __socklen_t tolen; char tolen_r_[PADR_(__socklen_t)];
char sinfo_l_[PADL_(struct sctp_sndrcvinfo *)]; struct sctp_sndrcvinfo * sinfo; char sinfo_r_[PADR_(struct sctp_sndrcvinfo *)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
@@ -1397,7 +1397,7 @@ struct pwrite_args {
char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)];
};
struct mmap_args {
- char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)];
+ char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
@@ -1410,7 +1410,7 @@ struct lseek_args {
char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
};
struct truncate_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char length_l_[PADL_(off_t)]; off_t length; char length_r_[PADR_(off_t)];
};
struct ftruncate_args {
@@ -1460,19 +1460,19 @@ struct cpuset_setaffinity_args {
};
struct faccessat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char amode_l_[PADL_(int)]; int amode; char amode_r_[PADR_(int)];
char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
};
struct fchmodat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
};
struct fchownat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char uid_l_[PADL_(uid_t)]; uid_t uid; char uid_r_[PADR_(uid_t)];
char gid_l_[PADL_(gid_t)]; gid_t gid; char gid_r_[PADR_(gid_t)];
char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
@@ -1484,59 +1484,59 @@ struct fexecve_args {
};
struct futimesat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char times_l_[PADL_(struct timeval *)]; struct timeval * times; char times_r_[PADR_(struct timeval *)];
};
struct linkat_args {
char fd1_l_[PADL_(int)]; int fd1; char fd1_r_[PADR_(int)];
- char path1_l_[PADL_(char *)]; char * path1; char path1_r_[PADR_(char *)];
+ char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)];
char fd2_l_[PADL_(int)]; int fd2; char fd2_r_[PADR_(int)];
- char path2_l_[PADL_(char *)]; char * path2; char path2_r_[PADR_(char *)];
+ char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)];
char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
};
struct mkdirat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
};
struct mkfifoat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
};
struct openat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
};
struct readlinkat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)];
};
struct renameat_args {
char oldfd_l_[PADL_(int)]; int oldfd; char oldfd_r_[PADR_(int)];
- char old_l_[PADL_(char *)]; char * old; char old_r_[PADR_(char *)];
+ char old_l_[PADL_(const char *)]; const char * old; char old_r_[PADR_(const char *)];
char newfd_l_[PADL_(int)]; int newfd; char newfd_r_[PADR_(int)];
- char new_l_[PADL_(char *)]; char * new; char new_r_[PADR_(char *)];
+ char new_l_[PADL_(const char *)]; const char * new; char new_r_[PADR_(const char *)];
};
struct symlinkat_args {
- char path1_l_[PADL_(char *)]; char * path1; char path1_r_[PADR_(char *)];
+ char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)];
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path2_l_[PADL_(char *)]; char * path2; char path2_r_[PADR_(char *)];
+ char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)];
};
struct unlinkat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
};
struct posix_openpt_args {
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
};
struct gssd_syscall_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
};
struct jail_get_args {
char iovp_l_[PADL_(struct iovec *)]; struct iovec * iovp; char iovp_r_[PADR_(struct iovec *)];
@@ -1571,7 +1571,7 @@ struct shmctl_args {
char buf_l_[PADL_(struct shmid_ds *)]; struct shmid_ds * buf; char buf_r_[PADR_(struct shmid_ds *)];
};
struct lpathconf_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char name_l_[PADL_(int)]; int name; char name_r_[PADR_(int)];
};
struct __cap_rights_get_args {
@@ -1686,13 +1686,13 @@ struct cap_fcntls_get_args {
struct bindat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
- char name_l_[PADL_(caddr_t)]; caddr_t name; char name_r_[PADR_(caddr_t)];
+ char name_l_[PADL_(const struct sockaddr *)]; const struct sockaddr * name; char name_r_[PADR_(const struct sockaddr *)];
char namelen_l_[PADL_(int)]; int namelen; char namelen_r_[PADR_(int)];
};
struct connectat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
- char name_l_[PADL_(caddr_t)]; caddr_t name; char name_r_[PADR_(caddr_t)];
+ char name_l_[PADL_(const struct sockaddr *)]; const struct sockaddr * name; char name_r_[PADR_(const struct sockaddr *)];
char namelen_l_[PADL_(int)]; int namelen; char namelen_r_[PADR_(int)];
};
struct chflagsat_args {
@@ -1732,7 +1732,7 @@ struct futimens_args {
};
struct utimensat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char times_l_[PADL_(struct timespec *)]; struct timespec * times; char times_r_[PADR_(struct timespec *)];
char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
};
@@ -1745,7 +1745,7 @@ struct fstat_args {
};
struct fstatat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char buf_l_[PADL_(struct stat *)]; struct stat * buf; char buf_r_[PADR_(struct stat *)];
char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
};
@@ -1760,7 +1760,7 @@ struct getdirentries_args {
char basep_l_[PADL_(off_t *)]; off_t * basep; char basep_r_[PADR_(off_t *)];
};
struct statfs_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char buf_l_[PADL_(struct statfs *)]; struct statfs * buf; char buf_r_[PADR_(struct statfs *)];
};
struct fstatfs_args {
@@ -1778,7 +1778,7 @@ struct fhstatfs_args {
};
struct mknodat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
char dev_l_[PADL_(dev_t)]; dev_t dev; char dev_r_[PADR_(dev_t)];
};
@@ -2201,7 +2201,7 @@ int sys_getrandom(struct thread *, struct getrandom_args *);
#ifdef COMPAT_43
struct ocreat_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
};
struct olseek_args {
@@ -2210,11 +2210,11 @@ struct olseek_args {
char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
};
struct ostat_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char ub_l_[PADL_(struct ostat *)]; struct ostat * ub; char ub_r_[PADR_(struct ostat *)];
};
struct olstat_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char ub_l_[PADL_(struct ostat *)]; struct ostat * ub; char ub_r_[PADR_(struct ostat *)];
};
struct osigaction_args {
@@ -2254,13 +2254,13 @@ struct sethostname_args {
};
struct osend_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
- char buf_l_[PADL_(caddr_t)]; caddr_t buf; char buf_r_[PADR_(caddr_t)];
+ char buf_l_[PADL_(const void *)]; const void * buf; char buf_r_[PADR_(const void *)];
char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
};
struct orecv_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
- char buf_l_[PADL_(caddr_t)]; caddr_t buf; char buf_r_[PADR_(caddr_t)];
+ char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
char len_l_[PADL_(int)]; int len; char len_r_[PADR_(int)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
};
@@ -2292,11 +2292,11 @@ struct orecvmsg_args {
};
struct osendmsg_args {
char s_l_[PADL_(int)]; int s; char s_r_[PADR_(int)];
- char msg_l_[PADL_(caddr_t)]; caddr_t msg; char msg_r_[PADR_(caddr_t)];
+ char msg_l_[PADL_(const void *)]; const void * msg; char msg_r_[PADR_(const void *)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
};
struct otruncate_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char length_l_[PADL_(long)]; long length; char length_r_[PADR_(long)];
};
struct oftruncate_args {
@@ -2305,7 +2305,7 @@ struct oftruncate_args {
};
struct ogetpeername_args {
char fdes_l_[PADL_(int)]; int fdes; char fdes_r_[PADR_(int)];
- char asa_l_[PADL_(caddr_t)]; caddr_t asa; char asa_r_[PADR_(caddr_t)];
+ char asa_l_[PADL_(struct sockaddr *)]; struct sockaddr * asa; char asa_r_[PADR_(struct sockaddr *)];
char alen_l_[PADL_(int *)]; int * alen; char alen_r_[PADR_(int *)];
};
struct osethostid_args {
@@ -2378,7 +2378,7 @@ struct freebsd4_getfsstat_args {
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
};
struct freebsd4_statfs_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char buf_l_[PADL_(struct ostatfs *)]; struct ostatfs * buf; char buf_r_[PADR_(struct ostatfs *)];
};
struct freebsd4_fstatfs_args {
@@ -2448,7 +2448,7 @@ struct freebsd6_pwrite_args {
char offset_l_[PADL_(off_t)]; off_t offset; char offset_r_[PADR_(off_t)];
};
struct freebsd6_mmap_args {
- char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)];
+ char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
char prot_l_[PADL_(int)]; int prot; char prot_r_[PADR_(int)];
char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)];
@@ -2463,7 +2463,7 @@ struct freebsd6_lseek_args {
char whence_l_[PADL_(int)]; int whence; char whence_r_[PADR_(int)];
};
struct freebsd6_truncate_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)];
char length_l_[PADL_(off_t)]; off_t length; char length_r_[PADR_(off_t)];
};
@@ -2532,15 +2532,15 @@ int freebsd10_pipe(struct thread *, struct freebsd10_pipe_args *);
#ifdef COMPAT_FREEBSD11
struct freebsd11_mknod_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
- char dev_l_[PADL_(int)]; int dev; char dev_r_[PADR_(int)];
+ char dev_l_[PADL_(uint32_t)]; uint32_t dev; char dev_r_[PADR_(uint32_t)];
};
struct freebsd11_vadvise_args {
char anom_l_[PADL_(int)]; int anom; char anom_r_[PADR_(int)];
};
struct freebsd11_stat_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char ub_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * ub; char ub_r_[PADR_(struct freebsd11_stat *)];
};
struct freebsd11_fstat_args {
@@ -2548,7 +2548,7 @@ struct freebsd11_fstat_args {
char sb_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * sb; char sb_r_[PADR_(struct freebsd11_stat *)];
};
struct freebsd11_lstat_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char ub_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * ub; char ub_r_[PADR_(struct freebsd11_stat *)];
};
struct freebsd11_getdirentries_args {
@@ -2563,7 +2563,7 @@ struct freebsd11_getdents_args {
char count_l_[PADL_(size_t)]; size_t count; char count_r_[PADR_(size_t)];
};
struct freebsd11_nstat_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char ub_l_[PADL_(struct nstat *)]; struct nstat * ub; char ub_r_[PADR_(struct nstat *)];
};
struct freebsd11_nfstat_args {
@@ -2571,7 +2571,7 @@ struct freebsd11_nfstat_args {
char sb_l_[PADL_(struct nstat *)]; struct nstat * sb; char sb_r_[PADR_(struct nstat *)];
};
struct freebsd11_nlstat_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char ub_l_[PADL_(struct nstat *)]; struct nstat * ub; char ub_r_[PADR_(struct nstat *)];
};
struct freebsd11_fhstat_args {
@@ -2592,7 +2592,7 @@ struct freebsd11_getfsstat_args {
char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)];
};
struct freebsd11_statfs_args {
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char buf_l_[PADL_(struct freebsd11_statfs *)]; struct freebsd11_statfs * buf; char buf_r_[PADR_(struct freebsd11_statfs *)];
};
struct freebsd11_fstatfs_args {
@@ -2605,13 +2605,13 @@ struct freebsd11_fhstatfs_args {
};
struct freebsd11_fstatat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char buf_l_[PADL_(struct freebsd11_stat *)]; struct freebsd11_stat * buf; char buf_r_[PADR_(struct freebsd11_stat *)];
char flag_l_[PADL_(int)]; int flag; char flag_r_[PADR_(int)];
};
struct freebsd11_mknodat_args {
char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)];
- char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)];
+ char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
char mode_l_[PADL_(mode_t)]; mode_t mode; char mode_r_[PADR_(mode_t)];
char dev_l_[PADL_(uint32_t)]; uint32_t dev; char dev_r_[PADR_(uint32_t)];
};
diff --git a/freebsd/sys/sys/systm.h b/freebsd/sys/sys/systm.h
index 9f9b00bd..d74a1e4b 100644
--- a/freebsd/sys/sys/systm.h
+++ b/freebsd/sys/sys/systm.h
@@ -673,6 +673,9 @@ void _gone_in_dev(struct device *dev, int major, const char *msg);
#endif
#define gone_in(major, msg) __gone_ok(major, msg) _gone_in(major, msg)
#define gone_in_dev(dev, major, msg) __gone_ok(major, msg) _gone_in_dev(dev, major, msg)
+#define gone_by_fcp101_dev(dev) \
+ gone_in_dev((dev), 13, \
+ "see https://github.com/freebsd/fcp/blob/master/fcp-0101.md")
__NULLABILITY_PRAGMA_POP
diff --git a/freebsd/sys/sys/tty.h b/freebsd/sys/sys/tty.h
index c85ca559..8b458cf1 100644
--- a/freebsd/sys/sys/tty.h
+++ b/freebsd/sys/sys/tty.h
@@ -133,12 +133,8 @@ struct tty {
void *t_hooksoftc; /* (t) Soft config, for hooks. */
struct cdev *t_dev; /* (c) Primary character device. */
-#ifndef PRINTF_BUFR_SIZE
-#define TTY_PRINTF_SIZE 256
-#else
-#define TTY_PRINTF_SIZE PRINTF_BUFR_SIZE
-#endif
- char t_prbuf[TTY_PRINTF_SIZE]; /* (t) */
+ size_t t_prbufsz; /* (t) SIGINFO buffer size. */
+ char t_prbuf[]; /* (t) SIGINFO buffer. */
};
/*
diff --git a/freebsd/sys/sys/vnode.h b/freebsd/sys/sys/vnode.h
index ac6f4f4e..81f90bde 100644
--- a/freebsd/sys/sys/vnode.h
+++ b/freebsd/sys/sys/vnode.h
@@ -485,6 +485,7 @@ typedef int vop_bypass_t(struct vop_generic_args *);
struct vnodeop_desc {
char *vdesc_name; /* a readable name for debugging */
int vdesc_flags; /* VDESC_* flags */
+ int vdesc_vop_offset;
vop_bypass_t *vdesc_call; /* Function to call */
/*
@@ -786,6 +787,7 @@ void vop_rmdir_post(void *a, int rc);
void vop_setattr_post(void *a, int rc);
void vop_setextattr_post(void *a, int rc);
void vop_symlink_post(void *a, int rc);
+int vop_sigdefer(struct vop_vector *vop, struct vop_generic_args *a);
#ifdef DEBUG_VFS_LOCKS
void vop_strategy_pre(void *a);
diff --git a/freebsd/sys/vm/uma_core.c b/freebsd/sys/vm/uma_core.c
index f1ea87e8..db624654 100644
--- a/freebsd/sys/vm/uma_core.c
+++ b/freebsd/sys/vm/uma_core.c
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bitset.h>
+#include <sys/domainset.h>
#include <sys/eventhandler.h>
#include <sys/kernel.h>
#include <sys/types.h>
@@ -81,6 +82,7 @@ __FBSDID("$FreeBSD$");
#include <sys/vmmeter.h>
#include <vm/vm.h>
+#include <vm/vm_domainset.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_pageout.h>
@@ -517,6 +519,36 @@ bucket_zone_drain(void)
zone_drain(ubz->ubz_zone);
}
+static uma_bucket_t
+zone_try_fetch_bucket(uma_zone_t zone, uma_zone_domain_t zdom, const bool ws)
+{
+ uma_bucket_t bucket;
+
+ ZONE_LOCK_ASSERT(zone);
+
+ if ((bucket = LIST_FIRST(&zdom->uzd_buckets)) != NULL) {
+ MPASS(zdom->uzd_nitems >= bucket->ub_cnt);
+ LIST_REMOVE(bucket, ub_link);
+ zdom->uzd_nitems -= bucket->ub_cnt;
+ if (ws && zdom->uzd_imin > zdom->uzd_nitems)
+ zdom->uzd_imin = zdom->uzd_nitems;
+ }
+ return (bucket);
+}
+
+static void
+zone_put_bucket(uma_zone_t zone, uma_zone_domain_t zdom, uma_bucket_t bucket,
+ const bool ws)
+{
+
+ ZONE_LOCK_ASSERT(zone);
+
+ LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link);
+ zdom->uzd_nitems += bucket->ub_cnt;
+ if (ws && zdom->uzd_imax < zdom->uzd_nitems)
+ zdom->uzd_imax = zdom->uzd_nitems;
+}
+
static void
zone_log_warning(uma_zone_t zone)
{
@@ -567,6 +599,23 @@ uma_timeout(void *unused)
}
/*
+ * Update the working set size estimate for the zone's bucket cache.
+ * The constants chosen here are somewhat arbitrary. With an update period of
+ * 20s (UMA_TIMEOUT), this estimate is dominated by zone activity over the
+ * last 100s.
+ */
+static void
+zone_domain_update_wss(uma_zone_domain_t zdom)
+{
+ long wss;
+
+ MPASS(zdom->uzd_imax >= zdom->uzd_imin);
+ wss = zdom->uzd_imax - zdom->uzd_imin;
+ zdom->uzd_imax = zdom->uzd_imin = zdom->uzd_nitems;
+ zdom->uzd_wss = (3 * wss + 2 * zdom->uzd_wss) / 5;
+}
+
+/*
* Routine to perform timeout driven calculations. This expands the
* hashes and does per cpu statistics aggregation.
*
@@ -618,8 +667,14 @@ keg_timeout(uma_keg_t keg)
static void
zone_timeout(uma_zone_t zone)
{
+ int i;
zone_foreach_keg(zone, &keg_timeout);
+
+ ZONE_LOCK(zone);
+ for (i = 0; i < vm_ndomains; i++)
+ zone_domain_update_wss(&zone->uz_domain[i]);
+ ZONE_UNLOCK(zone);
}
/*
@@ -833,16 +888,16 @@ cache_drain_safe_cpu(uma_zone_t zone)
cache = &zone->uz_cpu[curcpu];
if (cache->uc_allocbucket) {
if (cache->uc_allocbucket->ub_cnt != 0)
- LIST_INSERT_HEAD(&zone->uz_domain[domain].uzd_buckets,
- cache->uc_allocbucket, ub_link);
+ zone_put_bucket(zone, &zone->uz_domain[domain],
+ cache->uc_allocbucket, false);
else
b1 = cache->uc_allocbucket;
cache->uc_allocbucket = NULL;
}
if (cache->uc_freebucket) {
if (cache->uc_freebucket->ub_cnt != 0)
- LIST_INSERT_HEAD(&zone->uz_domain[domain].uzd_buckets,
- cache->uc_freebucket, ub_link);
+ zone_put_bucket(zone, &zone->uz_domain[domain],
+ cache->uc_freebucket, false);
else
b2 = cache->uc_freebucket;
cache->uc_freebucket = NULL;
@@ -906,8 +961,8 @@ bucket_cache_drain(uma_zone_t zone)
*/
for (i = 0; i < vm_ndomains; i++) {
zdom = &zone->uz_domain[i];
- while ((bucket = LIST_FIRST(&zdom->uzd_buckets)) != NULL) {
- LIST_REMOVE(bucket, ub_link);
+ while ((bucket = zone_try_fetch_bucket(zone, zdom, false)) !=
+ NULL) {
ZONE_UNLOCK(zone);
bucket_drain(zone, bucket);
bucket_free(zone, bucket, NULL);
@@ -1057,6 +1112,8 @@ zone_drain(uma_zone_t zone)
/*
* Allocate a new slab for a keg. This does not insert the slab onto a list.
+ * If the allocation was successful, the keg lock will be held upon return,
+ * otherwise the keg will be left unlocked.
*
* Arguments:
* wait Shall we wait?
@@ -1078,13 +1135,12 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int wait)
KASSERT(domain >= 0 && domain < vm_ndomains,
("keg_alloc_slab: domain %d out of range", domain));
mtx_assert(&keg->uk_lock, MA_OWNED);
- slab = NULL;
- mem = NULL;
allocf = keg->uk_allocf;
KEG_UNLOCK(keg);
- size = keg->uk_ppera * PAGE_SIZE;
+ slab = NULL;
+ mem = NULL;
if (keg->uk_flags & UMA_ZONE_OFFPAGE) {
slab = zone_alloc_item(keg->uk_slabzone, NULL, domain, wait);
if (slab == NULL)
@@ -1107,6 +1163,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int wait)
wait |= M_NODUMP;
/* zone is passed for legacy reasons. */
+ size = keg->uk_ppera * PAGE_SIZE;
mem = allocf(zone, size, domain, &flags, wait);
if (mem == NULL) {
if (keg->uk_flags & UMA_ZONE_OFFPAGE)
@@ -1145,20 +1202,18 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int wait)
goto out;
}
}
-out:
KEG_LOCK(keg);
CTR3(KTR_UMA, "keg_alloc_slab: allocated slab %p for %s(%p)",
slab, keg->uk_name, keg);
- if (slab != NULL) {
- if (keg->uk_flags & UMA_ZONE_HASH)
- UMA_HASH_INSERT(&keg->uk_hash, slab, mem);
+ if (keg->uk_flags & UMA_ZONE_HASH)
+ UMA_HASH_INSERT(&keg->uk_hash, slab, mem);
- keg->uk_pages += keg->uk_ppera;
- keg->uk_free += keg->uk_ipers;
- }
+ keg->uk_pages += keg->uk_ppera;
+ keg->uk_free += keg->uk_ipers;
+out:
return (slab);
}
@@ -1239,7 +1294,7 @@ page_alloc(uma_zone_t zone, vm_size_t bytes, int domain, uint8_t *pflag,
#ifndef __rtems__
*pflag = UMA_SLAB_KERNEL;
- p = (void *) kmem_malloc_domain(domain, bytes, wait);
+ p = (void *)kmem_malloc_domainset(DOMAINSET_FIXED(domain), bytes, wait);
#else /* __rtems__ */
*pflag = 0;
p = rtems_bsd_page_alloc(bytes, wait);
@@ -1643,13 +1698,22 @@ keg_ctor(void *mem, int size, void *udata, int flags)
keg->uk_init = arg->uminit;
keg->uk_fini = arg->fini;
keg->uk_align = arg->align;
- keg->uk_cursor = 0;
keg->uk_free = 0;
keg->uk_reserve = 0;
keg->uk_pages = 0;
keg->uk_flags = arg->flags;
keg->uk_slabzone = NULL;
+#ifndef __rtems__
+ /*
+ * We use a global round-robin policy by default. Zones with
+ * UMA_ZONE_NUMA set will use first-touch instead, in which case the
+ * iterator is never run.
+ */
+ keg->uk_dr.dr_policy = DOMAINSET_RR();
+ keg->uk_dr.dr_iter = 0;
+#endif /* __rtems__ */
+
/*
* The master zone is passed to us at keg-creation time.
*/
@@ -2657,11 +2721,9 @@ zalloc_start:
zdom = &zone->uz_domain[0];
else
zdom = &zone->uz_domain[domain];
- if ((bucket = LIST_FIRST(&zdom->uzd_buckets)) != NULL) {
+ if ((bucket = zone_try_fetch_bucket(zone, zdom, true)) != NULL) {
KASSERT(bucket->ub_cnt != 0,
("uma_zalloc_arg: Returning an empty bucket."));
-
- LIST_REMOVE(bucket, ub_link);
cache->uc_allocbucket = bucket;
ZONE_UNLOCK(zone);
goto zalloc_start;
@@ -2690,6 +2752,7 @@ zalloc_start:
critical_enter();
cpu = curcpu;
cache = &zone->uz_cpu[cpu];
+
/*
* See if we lost the race or were migrated. Cache the
* initialized bucket to make this less likely or claim
@@ -2703,6 +2766,7 @@ zalloc_start:
if (cache->uc_allocbucket == NULL) {
#endif /* __rtems__ */
cache->uc_allocbucket = bucket;
+ zdom->uzd_imax += bucket->ub_cnt;
} else if ((zone->uz_flags & UMA_ZONE_NOBUCKETCACHE) != 0) {
critical_exit();
ZONE_UNLOCK(zone);
@@ -2710,7 +2774,7 @@ zalloc_start:
bucket_free(zone, bucket, udata);
goto zalloc_restart;
} else
- LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link);
+ zone_put_bucket(zone, zdom, bucket, false);
ZONE_UNLOCK(zone);
goto zalloc_start;
}
@@ -2754,7 +2818,7 @@ uma_zalloc_domain(uma_zone_t zone, void *udata, int domain, int flags)
* only 'domain'.
*/
static uma_slab_t
-keg_first_slab(uma_keg_t keg, int domain, int rr)
+keg_first_slab(uma_keg_t keg, int domain, bool rr)
{
uma_domain_t dom;
uma_slab_t slab;
@@ -2785,48 +2849,61 @@ keg_first_slab(uma_keg_t keg, int domain, int rr)
}
static uma_slab_t
-keg_fetch_slab(uma_keg_t keg, uma_zone_t zone, int rdomain, int flags)
+keg_fetch_free_slab(uma_keg_t keg, int domain, bool rr, int flags)
{
+ uint32_t reserve;
+
+ mtx_assert(&keg->uk_lock, MA_OWNED);
+
+ reserve = (flags & M_USE_RESERVE) != 0 ? 0 : keg->uk_reserve;
+ if (keg->uk_free <= reserve)
+ return (NULL);
+ return (keg_first_slab(keg, domain, rr));
+}
+
+static uma_slab_t
+keg_fetch_slab(uma_keg_t keg, uma_zone_t zone, int rdomain, const int flags)
+{
+#ifndef __rtems__
+ struct vm_domainset_iter di;
+#endif /* __rtems__ */
uma_domain_t dom;
uma_slab_t slab;
- int allocflags, domain, reserve, rr, start;
+ int aflags, domain;
+ bool rr;
+#ifndef __rtems__
+restart:
+#endif /* __rtems__ */
mtx_assert(&keg->uk_lock, MA_OWNED);
- slab = NULL;
- reserve = 0;
- allocflags = flags;
- if ((flags & M_USE_RESERVE) == 0)
- reserve = keg->uk_reserve;
/*
- * Round-robin for non first-touch zones when there is more than one
- * domain.
+ * Use the keg's policy if upper layers haven't already specified a
+ * domain (as happens with first-touch zones).
+ *
+ * To avoid races we run the iterator with the keg lock held, but that
+ * means that we cannot allow the vm_domainset layer to sleep. Thus,
+ * clear M_WAITOK and handle low memory conditions locally.
*/
#ifndef __rtems__
- if (vm_ndomains == 1)
- rdomain = 0;
rr = rdomain == UMA_ANYDOMAIN;
if (rr) {
- start = keg->uk_cursor;
- do {
- keg->uk_cursor = (keg->uk_cursor + 1) % vm_ndomains;
- domain = keg->uk_cursor;
- } while (VM_DOMAIN_EMPTY(domain) && domain != start);
- domain = start = keg->uk_cursor;
- /* Only block on the second pass. */
- if ((flags & (M_WAITOK | M_NOVM)) == M_WAITOK)
- allocflags = (allocflags & ~M_WAITOK) | M_NOWAIT;
- } else
- domain = start = rdomain;
+ aflags = (flags & ~M_WAITOK) | M_NOWAIT;
+ vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain,
+ &aflags);
+ } else {
+ aflags = flags;
+ domain = rdomain;
+ }
#else /* __rtems__ */
- rr = 1;
- domain = start = keg->uk_cursor;
+ rr = true;
+ aflags = flags;
+ domain = 0;
#endif /* __rtems__ */
-again:
- do {
- if (keg->uk_free > reserve &&
- (slab = keg_first_slab(keg, domain, rr)) != NULL) {
+ for (;;) {
+ slab = keg_fetch_free_slab(keg, domain, rr, flags);
+ if (slab != NULL) {
MPASS(slab->us_keg == keg);
return (slab);
}
@@ -2854,7 +2931,7 @@ again:
msleep(keg, &keg->uk_lock, PVM, "keglimit", 0);
continue;
}
- slab = keg_alloc_slab(keg, zone, domain, allocflags);
+ slab = keg_alloc_slab(keg, zone, domain, aflags);
/*
* If we got a slab here it's safe to mark it partially used
* and return. We assume that the caller is going to remove
@@ -2866,19 +2943,20 @@ again:
LIST_INSERT_HEAD(&dom->ud_part_slab, slab, us_link);
return (slab);
}
+ KEG_LOCK(keg);
#ifndef __rtems__
- if (rr) {
- do {
- domain = (domain + 1) % vm_ndomains;
- } while (VM_DOMAIN_EMPTY(domain) && domain != start);
+ if (rr && vm_domainset_iter_policy(&di, &domain) != 0) {
+ if ((flags & M_WAITOK) != 0) {
+ KEG_UNLOCK(keg);
+ vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask);
+ KEG_LOCK(keg);
+ goto restart;
+ }
+ break;
}
+#else /* __rtems__ */
+ return (NULL);
#endif /* __rtems__ */
- } while (domain != start);
-
- /* Retry domain scan with blocking. */
- if (allocflags != flags) {
- allocflags = flags;
- goto again;
}
/*
@@ -2886,8 +2964,7 @@ again:
* could have while we were unlocked. Check again before we
* fail.
*/
- if (keg->uk_free > reserve &&
- (slab = keg_first_slab(keg, domain, rr)) != NULL) {
+ if ((slab = keg_fetch_free_slab(keg, domain, rr, flags)) != NULL) {
MPASS(slab->us_keg == keg);
return (slab);
}
@@ -3353,7 +3430,7 @@ zfree_start:
bucket_free(zone, bucket, udata);
goto zfree_restart;
} else
- LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link);
+ zone_put_bucket(zone, zdom, bucket, true);
}
/*
@@ -3775,30 +3852,30 @@ uma_zone_reserve_kva(uma_zone_t zone, int count)
void
uma_prealloc(uma_zone_t zone, int items)
{
+ struct vm_domainset_iter di;
uma_domain_t dom;
uma_slab_t slab;
uma_keg_t keg;
- int domain, slabs;
+ int domain, flags, slabs;
keg = zone_first_keg(zone);
if (keg == NULL)
return;
KEG_LOCK(keg);
slabs = items / keg->uk_ipers;
- domain = 0;
if (slabs * keg->uk_ipers < items)
slabs++;
- while (slabs > 0) {
- slab = keg_alloc_slab(keg, zone, domain, M_WAITOK);
+ flags = M_WAITOK;
+ vm_domainset_iter_policy_ref_init(&di, &keg->uk_dr, &domain, &flags);
+ while (slabs-- > 0) {
+ slab = keg_alloc_slab(keg, zone, domain, flags);
if (slab == NULL)
- break;
+ return;
MPASS(slab->us_keg == keg);
dom = &keg->uk_domain[slab->us_domain];
LIST_INSERT_HEAD(&dom->ud_free_slab, slab, us_link);
- slabs--;
- do {
- domain = (domain + 1) % vm_ndomains;
- } while (VM_DOMAIN_EMPTY(domain));
+ if (vm_domainset_iter_policy(&di, &domain) != 0)
+ break;
}
KEG_UNLOCK(keg);
}
@@ -3819,6 +3896,7 @@ uma_reclaim_locked(bool kmem_danger)
zone_foreach(zone_drain);
}
#endif /* __rtems__ */
+
/*
* Some slabs may have been freed but this zone will be visited early
* we visit again so that we can free pages that are empty once other
@@ -3891,6 +3969,7 @@ uma_zone_exhausted_nolock(uma_zone_t zone)
void *
uma_large_malloc_domain(vm_size_t size, int domain, int wait)
{
+ struct domainset *policy;
vm_offset_t addr;
uma_slab_t slab;
@@ -3902,10 +3981,9 @@ uma_large_malloc_domain(vm_size_t size, int domain, int wait)
slab = zone_alloc_item(slabzone, NULL, domain, wait);
if (slab == NULL)
return (NULL);
- if (domain == UMA_ANYDOMAIN)
- addr = kmem_malloc(size, wait);
- else
- addr = kmem_malloc_domain(domain, size, wait);
+ policy = (domain == UMA_ANYDOMAIN) ? DOMAINSET_RR() :
+ DOMAINSET_FIXED(domain);
+ addr = kmem_malloc_domainset(policy, size, wait);
if (addr != 0) {
vsetslab(addr, slab);
slab->us_data = (void *)addr;
@@ -4057,7 +4135,7 @@ uma_print_zone(uma_zone_t zone)
* directly so that we don't have to.
*/
static void
-uma_zone_sumstat(uma_zone_t z, int *cachefreep, uint64_t *allocsp,
+uma_zone_sumstat(uma_zone_t z, long *cachefreep, uint64_t *allocsp,
uint64_t *freesp, uint64_t *sleepsp)
{
uma_cache_t cache;
@@ -4113,7 +4191,6 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS)
struct uma_stream_header ush;
struct uma_type_header uth;
struct uma_percpu_stat *ups;
- uma_bucket_t bucket;
uma_zone_domain_t zdom;
struct sbuf sbuf;
uma_cache_t cache;
@@ -4173,9 +4250,7 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS)
for (i = 0; i < vm_ndomains; i++) {
zdom = &z->uz_domain[i];
- LIST_FOREACH(bucket, &zdom->uzd_buckets,
- ub_link)
- uth.uth_zone_free += bucket->ub_cnt;
+ uth.uth_zone_free += zdom->uzd_nitems;
}
uth.uth_allocs = z->uz_allocs;
uth.uth_frees = z->uz_frees;
@@ -4376,12 +4451,11 @@ uma_dbg_free(uma_zone_t zone, uma_slab_t slab, void *item)
#ifdef DDB
DB_SHOW_COMMAND(uma, db_show_uma)
{
- uma_bucket_t bucket;
uma_keg_t kz;
uma_zone_t z;
- uma_zone_domain_t zdom;
uint64_t allocs, frees, sleeps;
- int cachefree, i;
+ long cachefree;
+ int i;
db_printf("%18s %8s %8s %8s %12s %8s %8s\n", "Zone", "Size", "Used",
"Free", "Requests", "Sleeps", "Bucket");
@@ -4398,13 +4472,10 @@ DB_SHOW_COMMAND(uma, db_show_uma)
if (!((z->uz_flags & UMA_ZONE_SECONDARY) &&
(LIST_FIRST(&kz->uk_zones) != z)))
cachefree += kz->uk_free;
- for (i = 0; i < vm_ndomains; i++) {
- zdom = &z->uz_domain[i];
- LIST_FOREACH(bucket, &zdom->uzd_buckets,
- ub_link)
- cachefree += bucket->ub_cnt;
- }
- db_printf("%18s %8ju %8jd %8d %12ju %8ju %8u\n",
+ for (i = 0; i < vm_ndomains; i++)
+ cachefree += z->uz_domain[i].uzd_nitems;
+
+ db_printf("%18s %8ju %8jd %8ld %12ju %8ju %8u\n",
z->uz_name, (uintmax_t)kz->uk_size,
(intmax_t)(allocs - frees), cachefree,
(uintmax_t)allocs, sleeps, z->uz_count);
@@ -4416,22 +4487,18 @@ DB_SHOW_COMMAND(uma, db_show_uma)
DB_SHOW_COMMAND(umacache, db_show_umacache)
{
- uma_bucket_t bucket;
uma_zone_t z;
- uma_zone_domain_t zdom;
uint64_t allocs, frees;
- int cachefree, i;
+ long cachefree;
+ int i;
db_printf("%18s %8s %8s %8s %12s %8s\n", "Zone", "Size", "Used", "Free",
"Requests", "Bucket");
LIST_FOREACH(z, &uma_cachezones, uz_link) {
uma_zone_sumstat(z, &cachefree, &allocs, &frees, NULL);
- for (i = 0; i < vm_ndomains; i++) {
- zdom = &z->uz_domain[i];
- LIST_FOREACH(bucket, &zdom->uzd_buckets, ub_link)
- cachefree += bucket->ub_cnt;
- }
- db_printf("%18s %8ju %8jd %8d %12ju %8u\n",
+ for (i = 0; i < vm_ndomains; i++)
+ cachefree += z->uz_domain[i].uzd_nitems;
+ db_printf("%18s %8ju %8jd %8ld %12ju %8u\n",
z->uz_name, (uintmax_t)z->uz_size,
(intmax_t)(allocs - frees), cachefree,
(uintmax_t)allocs, z->uz_count);
diff --git a/freebsd/sys/vm/uma_int.h b/freebsd/sys/vm/uma_int.h
index ff638095..0fbc0512 100644
--- a/freebsd/sys/vm/uma_int.h
+++ b/freebsd/sys/vm/uma_int.h
@@ -31,6 +31,7 @@
*/
#include <sys/_bitset.h>
+#include <sys/_domainset.h>
#include <sys/_task.h>
/*
@@ -226,7 +227,9 @@ struct uma_keg {
struct uma_hash uk_hash;
LIST_HEAD(,uma_zone) uk_zones; /* Keg's zones */
- uint32_t uk_cursor; /* Domain alloc cursor. */
+#ifndef __rtems__
+ struct domainset_ref uk_dr; /* Domain selection policy. */
+#endif /* __rtems__ */
uint32_t uk_align; /* Alignment mask */
uint32_t uk_pages; /* Total page count */
uint32_t uk_free; /* Count of items free in slabs */
@@ -307,6 +310,10 @@ typedef struct uma_klink *uma_klink_t;
struct uma_zone_domain {
LIST_HEAD(,uma_bucket) uzd_buckets; /* full buckets */
+ long uzd_nitems; /* total item count */
+ long uzd_imax; /* maximum item count this period */
+ long uzd_imin; /* minimum item count this period */
+ long uzd_wss; /* working set size estimate */
};
typedef struct uma_zone_domain * uma_zone_domain_t;
@@ -430,11 +437,12 @@ void uma_large_free(uma_slab_t slab);
mtx_init(&(z)->uz_lock, (z)->uz_name, \
"UMA zone", MTX_DEF | MTX_DUPOK); \
} while (0)
-
+
#define ZONE_LOCK(z) mtx_lock((z)->uz_lockptr)
#define ZONE_TRYLOCK(z) mtx_trylock((z)->uz_lockptr)
#define ZONE_UNLOCK(z) mtx_unlock((z)->uz_lockptr)
#define ZONE_LOCK_FINI(z) mtx_destroy(&(z)->uz_lock)
+#define ZONE_LOCK_ASSERT(z) mtx_assert((z)->uz_lockptr, MA_OWNED)
/*
* Find a slab within a hash table. This is used for OFFPAGE zones to lookup
diff --git a/freebsd/sys/vm/vm_extern.h b/freebsd/sys/vm/vm_extern.h
index b2f1d726..52884357 100644
--- a/freebsd/sys/vm/vm_extern.h
+++ b/freebsd/sys/vm/vm_extern.h
@@ -44,6 +44,7 @@ struct vmem;
#ifdef _KERNEL
struct cdev;
struct cdevsw;
+struct domainset;
/* These operate on kernel virtual addresses only. */
vm_offset_t kva_alloc(vm_size_t);
@@ -56,16 +57,17 @@ void kmap_free_wakeup(vm_map_t, vm_offset_t, vm_size_t);
/* These operate on virtual addresses backed by memory. */
vm_offset_t kmem_alloc_attr(vm_size_t size, int flags,
vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr);
-vm_offset_t kmem_alloc_attr_domain(int domain, vm_size_t size, int flags,
- vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr);
+vm_offset_t kmem_alloc_attr_domainset(struct domainset *ds, vm_size_t size,
+ int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr);
vm_offset_t kmem_alloc_contig(vm_size_t size, int flags,
vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary,
vm_memattr_t memattr);
-vm_offset_t kmem_alloc_contig_domain(int domain, vm_size_t size, int flags,
- vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary,
- vm_memattr_t memattr);
+vm_offset_t kmem_alloc_contig_domainset(struct domainset *ds, vm_size_t size,
+ int flags, vm_paddr_t low, vm_paddr_t high, u_long alignment,
+ vm_paddr_t boundary, vm_memattr_t memattr);
vm_offset_t kmem_malloc(vm_size_t size, int flags);
-vm_offset_t kmem_malloc_domain(int domain, vm_size_t size, int flags);
+vm_offset_t kmem_malloc_domainset(struct domainset *ds, vm_size_t size,
+ int flags);
void kmem_free(vm_offset_t addr, vm_size_t size);
/* This provides memory for previously allocated address space. */
diff --git a/libbsd.py b/libbsd.py
index f6fbaeff..ca90f76d 100644
--- a/libbsd.py
+++ b/libbsd.py
@@ -3950,7 +3950,7 @@ class contrib_expat(builder.Module):
def generate(self):
mm = self.manager
- cflags = ['-DHAVE_MEMMOVE=1']
+ cflags = ['-DHAVE_MEMMOVE=1', '-DHAVE_ARC4RANDOM_BUF=1']
self.addRTEMSHeaderFiles(
[
'include/bsdxml.h',
@@ -3966,6 +3966,7 @@ class contrib_expat(builder.Module):
'contrib/expat/lib/internal.h',
'contrib/expat/lib/latin1tab.h',
'contrib/expat/lib/nametab.h',
+ 'contrib/expat/lib/siphash.h',
'contrib/expat/lib/utf8tab.h',
'contrib/expat/lib/xmlrole.h',
'contrib/expat/lib/xmltok.h',
diff --git a/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h b/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
index 32dd7a78..28c8a349 100644
--- a/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
+++ b/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
@@ -563,6 +563,7 @@
#define comp_algorithm_lookup _bsd_comp_algorithm_lookup
#define config_intrhook_disestablish _bsd_config_intrhook_disestablish
#define config_intrhook_establish _bsd_config_intrhook_establish
+#define config_intrhook_oneshot _bsd_config_intrhook_oneshot
#define copyiniov _bsd_copyiniov
#define counter_ratecheck _bsd_counter_ratecheck
#define counter_u64_alloc _bsd_counter_u64_alloc
@@ -1162,6 +1163,7 @@
#define evdev_register_client _bsd_evdev_register_client
#define evdev_register_mtx _bsd_evdev_register_mtx
#define evdev_release_client _bsd_evdev_release_client
+#define evdev_restore_after_kdb _bsd_evdev_restore_after_kdb
#define evdev_revoke_client _bsd_evdev_revoke_client
#define evdev_scancode2key _bsd_evdev_scancode2key
#define evdev_send_event _bsd_evdev_send_event
@@ -1313,7 +1315,9 @@
#define gre_hashinit _bsd_gre_hashinit
#define gre_input _bsd_gre_input
#define gre_updatehdr _bsd_gre_updatehdr
+#define grouptask_block _bsd_grouptask_block
#define grouptaskqueue_enqueue _bsd_grouptaskqueue_enqueue
+#define grouptask_unblock _bsd_grouptask_unblock
#define gtaskqueue_block _bsd_gtaskqueue_block
#define gtaskqueue_cancel _bsd_gtaskqueue_cancel
#define gtaskqueue_drain _bsd_gtaskqueue_drain
@@ -1880,6 +1884,7 @@
#define if_getvtag _bsd_if_getvtag
#define ifg_head _bsd_ifg_head
#define if_handoff _bsd_if_handoff
+#define ifhwioctl _bsd_ifhwioctl
#define if_hw_tsomax_common _bsd_if_hw_tsomax_common
#define if_hw_tsomax_update _bsd_if_hw_tsomax_update
#define if_inc_counter _bsd_if_inc_counter
@@ -2228,6 +2233,8 @@
#define ip6_ecn_ingress _bsd_ip6_ecn_ingress
#define ip6_encap_attach _bsd_ip6_encap_attach
#define ip6_encap_detach _bsd_ip6_encap_detach
+#define ip6_encap_register_srcaddr _bsd_ip6_encap_register_srcaddr
+#define ip6_encap_unregister_srcaddr _bsd_ip6_encap_unregister_srcaddr
#define ip6_esp_net_deflev _bsd_ip6_esp_net_deflev
#define ip6_esp_trans_deflev _bsd_ip6_esp_trans_deflev
#define ip6_forward _bsd_ip6_forward
@@ -2312,6 +2319,8 @@
#define ip_ecn_ingress _bsd_ip_ecn_ingress
#define ip_encap_attach _bsd_ip_encap_attach
#define ip_encap_detach _bsd_ip_encap_detach
+#define ip_encap_register_srcaddr _bsd_ip_encap_register_srcaddr
+#define ip_encap_unregister_srcaddr _bsd_ip_encap_unregister_srcaddr
#define ip_fillid _bsd_ip_fillid
#define ip_forward _bsd_ip_forward
#define ipforwarding _bsd_ipforwarding
@@ -2467,6 +2476,7 @@
#define key_allocsp _bsd_key_allocsp
#define key_bumpspgen _bsd_key_bumpspgen
#define key_debug_level _bsd_key_debug_level
+#define key_delete_xform _bsd_key_delete_xform
#define keydomain _bsd_keydomain
#define key_freereg _bsd_key_freereg
#define key_freesav _bsd_key_freesav
@@ -3199,6 +3209,8 @@
#define pf_free_rule _bsd_pf_free_rule
#define pf_free_src_nodes _bsd_pf_free_src_nodes
#define pf_free_state _bsd_pf_free_state
+#define pf_frent_previous _bsd_pf_frent_previous
+#define pf_frent_remove _bsd_pf_frent_remove
#define pf_get_mtag _bsd_pf_get_mtag
#define pf_get_ruleset_number _bsd_pf_get_ruleset_number
#define pf_get_translation _bsd_pf_get_translation
@@ -3361,6 +3373,7 @@
#define pfsync_cloner _bsd_pfsync_cloner
#define pfsync_defer_ptr _bsd_pfsync_defer_ptr
#define pfsync_delete_state_ptr _bsd_pfsync_delete_state_ptr
+#define pfsync_detach_ifnet_ptr _bsd_pfsync_detach_ifnet_ptr
#define pfsync_insert_state_ptr _bsd_pfsync_insert_state_ptr
#define pfsync_state_export _bsd_pfsync_state_export
#define pfsync_state_import_ptr _bsd_pfsync_state_import_ptr
@@ -4371,7 +4384,6 @@
#define sctp_v4src_match_nexthop _bsd_sctp_v4src_match_nexthop
#define sctp_v6src_match_nexthop _bsd_sctp_v6src_match_nexthop
#define sctp_validate_init_auth_params _bsd_sctp_validate_init_auth_params
-#define sctp_verify_hmac _bsd_sctp_verify_hmac
#define sctp_verify_hmac_param _bsd_sctp_verify_hmac_param
#define sctp_wakeup_iterator _bsd_sctp_wakeup_iterator
#define sctp_wakeup_log _bsd_sctp_wakeup_log
@@ -4690,6 +4702,7 @@
#define sysctl___kern_features _bsd_sysctl___kern_features
#define sysctl___kern_ipc _bsd_sysctl___kern_ipc
#define sysctl_move_oid _bsd_sysctl_move_oid
+#define sysctl_msec_to_sbintime _bsd_sysctl_msec_to_sbintime
#define sysctl_msec_to_ticks _bsd_sysctl_msec_to_ticks
#define sysctl___net _bsd_sysctl___net
#define sysctl___net_accf _bsd_sysctl___net_accf
@@ -5003,6 +5016,7 @@
#define ttyoutq_write _bsd_ttyoutq_write
#define ttyoutq_write_nofrag _bsd_ttyoutq_write_nofrag
#define tty_putchar _bsd_tty_putchar
+#define tty_putstrn _bsd_tty_putstrn
#define tty_rel_gone _bsd_tty_rel_gone
#define tty_rel_pgrp _bsd_tty_rel_pgrp
#define tty_rel_sess _bsd_tty_rel_sess
@@ -5426,6 +5440,7 @@
#define xform_ah_authsize _bsd_xform_ah_authsize
#define xform_attach _bsd_xform_attach
#define xform_detach _bsd_xform_detach
+#define xform_init _bsd_xform_init
#define X_ip6_mforward _bsd_X_ip6_mforward
#define X_ip6_mrouter_done _bsd_X_ip6_mrouter_done
#define X_ip6_mrouter_get _bsd_X_ip6_mrouter_get
diff --git a/rtemsbsd/include/vm/vm_domainset.h b/rtemsbsd/include/vm/vm_domainset.h
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/rtemsbsd/include/vm/vm_domainset.h
diff --git a/rtemsbsd/rtems/rtems-bsd-regdomain.c b/rtemsbsd/rtems/rtems-bsd-regdomain.c
index 64c89539..5aceb387 100644
--- a/rtemsbsd/rtems/rtems-bsd-regdomain.c
+++ b/rtemsbsd/rtems/rtems-bsd-regdomain.c
@@ -3518,263 +3518,278 @@ const unsigned char regdomain_xml[] = {
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22,
0x52, 0x55, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63,
0x63, 0x3e, 0x36, 0x34, 0x33, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63,
- 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x52, 0x75, 0x73, 0x69,
- 0x61, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64,
- 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f,
- 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e,
- 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64,
- 0x3d, 0x22, 0x53, 0x41, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73,
- 0x6f, 0x63, 0x63, 0x3e, 0x36, 0x38, 0x32, 0x3c, 0x2f, 0x69, 0x73, 0x6f,
- 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x61,
- 0x75, 0x64, 0x69, 0x20, 0x41, 0x72, 0x61, 0x62, 0x69, 0x61, 0x3c, 0x2f,
- 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65,
- 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c,
- 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63,
- 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53,
- 0x47, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63,
- 0x3e, 0x37, 0x30, 0x32, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
- 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x69, 0x6e, 0x67, 0x61,
- 0x70, 0x6f, 0x72, 0x65, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20,
- 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x61, 0x70, 0x61,
- 0x63, 0x32, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e,
- 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72,
- 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x4b, 0x22, 0x3e, 0x0a, 0x20,
- 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x30, 0x33, 0x3c,
- 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d,
- 0x65, 0x3e, 0x53, 0x6c, 0x6f, 0x76, 0x61, 0x6b, 0x20, 0x52, 0x65, 0x70,
- 0x75, 0x62, 0x6c, 0x69, 0x63, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e,
- 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x65, 0x74,
- 0x73, 0x69, 0x32, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75,
- 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74,
- 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x49, 0x22, 0x3e, 0x0a,
- 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x30, 0x35,
- 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61,
- 0x6d, 0x65, 0x3e, 0x53, 0x6c, 0x6f, 0x76, 0x65, 0x6e, 0x69, 0x61, 0x3c,
+ 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x52, 0x75, 0x73, 0x73,
+ 0x69, 0x61, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72,
+ 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22,
+ 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79,
+ 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69,
+ 0x64, 0x3d, 0x22, 0x53, 0x41, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69,
+ 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x36, 0x38, 0x32, 0x3c, 0x2f, 0x69, 0x73,
+ 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x53,
+ 0x61, 0x75, 0x64, 0x69, 0x20, 0x41, 0x72, 0x61, 0x62, 0x69, 0x61, 0x3c,
0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72,
- 0x65, 0x66, 0x3d, 0x22, 0x65, 0x74, 0x73, 0x69, 0x22, 0x2f, 0x3e, 0x0a,
- 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c,
- 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22,
- 0x5a, 0x41, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63,
- 0x63, 0x3e, 0x37, 0x31, 0x30, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63,
- 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x6f, 0x75, 0x74,
- 0x68, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x3c, 0x2f, 0x6e, 0x61,
- 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d,
- 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63,
- 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75,
- 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x45, 0x53, 0x22,
- 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37,
- 0x32, 0x34, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c,
- 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x70, 0x61, 0x69, 0x6e, 0x3c, 0x2f,
- 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65,
- 0x66, 0x3d, 0x22, 0x65, 0x74, 0x73, 0x69, 0x32, 0x22, 0x2f, 0x3e, 0x0a,
+ 0x65, 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a,
0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22,
- 0x4c, 0x4b, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63,
- 0x63, 0x3e, 0x31, 0x34, 0x34, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63,
- 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x72, 0x69, 0x20,
- 0x4c, 0x61, 0x6e, 0x6b, 0x61, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e,
+ 0x53, 0x47, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63,
+ 0x63, 0x3e, 0x37, 0x30, 0x32, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63,
+ 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x69, 0x6e, 0x67,
+ 0x61, 0x70, 0x6f, 0x72, 0x65, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e,
0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x61, 0x70,
0x61, 0x63, 0x32, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74,
- 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x45, 0x22, 0x3e, 0x0a,
- 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x35, 0x32,
+ 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x4b, 0x22, 0x3e, 0x0a,
+ 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x30, 0x33,
0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61,
- 0x6d, 0x65, 0x3e, 0x53, 0x77, 0x65, 0x64, 0x65, 0x6e, 0x3c, 0x2f, 0x6e,
- 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66,
- 0x3d, 0x22, 0x65, 0x74, 0x73, 0x69, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f,
- 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f,
- 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x43, 0x48,
- 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
- 0x37, 0x35, 0x36, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20,
- 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x77, 0x69, 0x74, 0x7a, 0x65,
- 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e,
- 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x65, 0x74,
- 0x73, 0x69, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e,
- 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72,
- 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x59, 0x22, 0x3e, 0x0a, 0x20,
- 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x36, 0x30, 0x3c,
- 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d,
- 0x65, 0x3e, 0x53, 0x79, 0x72, 0x69, 0x61, 0x3c, 0x2f, 0x6e, 0x61, 0x6d,
- 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22,
- 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f,
+ 0x6d, 0x65, 0x3e, 0x53, 0x6c, 0x6f, 0x76, 0x61, 0x6b, 0x20, 0x52, 0x65,
+ 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x65,
+ 0x74, 0x73, 0x69, 0x32, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e,
- 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x54, 0x57, 0x22, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x31, 0x35,
- 0x38, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e,
- 0x61, 0x6d, 0x65, 0x3e, 0x54, 0x61, 0x69, 0x77, 0x61, 0x6e, 0x3c, 0x2f,
- 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65,
- 0x66, 0x3d, 0x22, 0x72, 0x6f, 0x77, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f,
- 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f,
- 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x54, 0x48,
- 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
- 0x37, 0x36, 0x34, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20,
- 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x54, 0x68, 0x61, 0x69, 0x6c, 0x61,
- 0x6e, 0x64, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72,
- 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22,
- 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79,
- 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69,
- 0x64, 0x3d, 0x22, 0x54, 0x54, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69,
- 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x38, 0x30, 0x3c, 0x2f, 0x69, 0x73,
- 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x54,
- 0x6f, 0x62, 0x61, 0x67, 0x6f, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e,
- 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6e, 0x6f,
- 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e,
- 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72,
- 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x54, 0x4e, 0x22, 0x3e, 0x0a, 0x20,
- 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x38, 0x38, 0x3c,
- 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d,
- 0x65, 0x3e, 0x54, 0x75, 0x6e, 0x69, 0x73, 0x69, 0x61, 0x3c, 0x2f, 0x6e,
- 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66,
- 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f,
- 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f,
- 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x54, 0x52,
- 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
- 0x37, 0x39, 0x32, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20,
- 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x54, 0x75, 0x72, 0x6b, 0x65, 0x79,
+ 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x49, 0x22, 0x3e,
+ 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x30,
+ 0x35, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x6c, 0x6f, 0x76, 0x65, 0x6e, 0x69, 0x61,
0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20,
0x72, 0x65, 0x66, 0x3d, 0x22, 0x65, 0x74, 0x73, 0x69, 0x22, 0x2f, 0x3e,
0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a,
0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d,
- 0x22, 0x55, 0x41, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f,
- 0x63, 0x63, 0x3e, 0x38, 0x30, 0x34, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63,
- 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x55, 0x6b, 0x72,
- 0x61, 0x69, 0x6e, 0x65, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20,
- 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e,
- 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74,
- 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79,
- 0x20, 0x69, 0x64, 0x3d, 0x22, 0x41, 0x45, 0x22, 0x3e, 0x0a, 0x20, 0x20,
- 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x38, 0x34, 0x3c, 0x2f,
- 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65,
- 0x3e, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x41, 0x72, 0x61, 0x62,
- 0x20, 0x45, 0x6d, 0x69, 0x72, 0x61, 0x74, 0x65, 0x73, 0x3c, 0x2f, 0x6e,
+ 0x22, 0x5a, 0x41, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f,
+ 0x63, 0x63, 0x3e, 0x37, 0x31, 0x30, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63,
+ 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x6f, 0x75,
+ 0x74, 0x68, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x3c, 0x2f, 0x6e,
0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66,
0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f,
- 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x47, 0x42,
+ 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x45, 0x53,
0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
- 0x38, 0x32, 0x36, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20,
- 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64,
- 0x20, 0x4b, 0x69, 0x6e, 0x67, 0x64, 0x6f, 0x6d, 0x3c, 0x2f, 0x6e, 0x61,
+ 0x37, 0x32, 0x34, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20,
+ 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x70, 0x61, 0x69, 0x6e, 0x3c,
+ 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72,
+ 0x65, 0x66, 0x3d, 0x22, 0x65, 0x74, 0x73, 0x69, 0x32, 0x22, 0x2f, 0x3e,
+ 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a,
+ 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d,
+ 0x22, 0x4c, 0x4b, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f,
+ 0x63, 0x63, 0x3e, 0x31, 0x34, 0x34, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63,
+ 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x72, 0x69,
+ 0x20, 0x4c, 0x61, 0x6e, 0x6b, 0x61, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x61,
+ 0x70, 0x61, 0x63, 0x32, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f,
+ 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e,
+ 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x45, 0x22, 0x3e,
+ 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x35,
+ 0x32, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x77, 0x65, 0x64, 0x65, 0x6e, 0x3c, 0x2f,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65,
+ 0x66, 0x3d, 0x22, 0x65, 0x74, 0x73, 0x69, 0x22, 0x2f, 0x3e, 0x0a, 0x3c,
+ 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63,
+ 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x43,
+ 0x48, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63,
+ 0x3e, 0x37, 0x35, 0x36, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
+ 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x53, 0x77, 0x69, 0x74, 0x7a,
+ 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x65,
+ 0x74, 0x73, 0x69, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75,
+ 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+ 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x59, 0x22, 0x3e, 0x0a,
+ 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x36, 0x30,
+ 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3e, 0x53, 0x79, 0x72, 0x69, 0x61, 0x3c, 0x2f, 0x6e, 0x61,
0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d,
- 0x22, 0x65, 0x74, 0x73, 0x69, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63,
+ 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75,
- 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x55, 0x53, 0x22,
- 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x38,
- 0x34, 0x30, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c,
- 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20,
- 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65,
- 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x66,
- 0x63, 0x63, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e,
+ 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x54, 0x57, 0x22,
+ 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x31,
+ 0x35, 0x38, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x54, 0x61, 0x69, 0x77, 0x61, 0x6e, 0x3c,
+ 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72,
+ 0x65, 0x66, 0x3d, 0x22, 0x72, 0x6f, 0x77, 0x22, 0x2f, 0x3e, 0x0a, 0x3c,
+ 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63,
+ 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x54,
+ 0x48, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63,
+ 0x3e, 0x37, 0x36, 0x34, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
+ 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x54, 0x68, 0x61, 0x69, 0x6c,
+ 0x61, 0x6e, 0x64, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c,
+ 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65,
+ 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72,
+ 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20,
+ 0x69, 0x64, 0x3d, 0x22, 0x54, 0x54, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
+ 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x38, 0x30, 0x3c, 0x2f, 0x69,
+ 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e,
+ 0x54, 0x6f, 0x62, 0x61, 0x67, 0x6f, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6e,
+ 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75,
+ 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+ 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x54, 0x4e, 0x22, 0x3e, 0x0a,
+ 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x38, 0x38,
+ 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3e, 0x54, 0x75, 0x6e, 0x69, 0x73, 0x69, 0x61, 0x3c, 0x2f,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65,
+ 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c,
+ 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63,
+ 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x54,
+ 0x52, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63,
+ 0x3e, 0x37, 0x39, 0x32, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
+ 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x54, 0x75, 0x72, 0x6b, 0x65,
+ 0x79, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64,
+ 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x65, 0x74, 0x73, 0x69, 0x22, 0x2f,
+ 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e,
+ 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64,
+ 0x3d, 0x22, 0x55, 0x41, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73,
+ 0x6f, 0x63, 0x63, 0x3e, 0x38, 0x30, 0x34, 0x3c, 0x2f, 0x69, 0x73, 0x6f,
+ 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x55, 0x6b,
+ 0x72, 0x61, 0x69, 0x6e, 0x65, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e,
+ 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6e, 0x6f,
+ 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72,
- 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x55, 0x59, 0x22, 0x3e, 0x0a, 0x20,
- 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x38, 0x35, 0x38, 0x3c,
+ 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x41, 0x45, 0x22, 0x3e, 0x0a, 0x20,
+ 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x38, 0x34, 0x3c,
0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d,
- 0x65, 0x3e, 0x55, 0x72, 0x75, 0x67, 0x75, 0x61, 0x79, 0x3c, 0x2f, 0x6e,
+ 0x65, 0x3e, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x41, 0x72, 0x61,
+ 0x62, 0x20, 0x45, 0x6d, 0x69, 0x72, 0x61, 0x74, 0x65, 0x73, 0x3c, 0x2f,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65,
+ 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c,
+ 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63,
+ 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x47,
+ 0x42, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63,
+ 0x3e, 0x38, 0x32, 0x36, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
+ 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x55, 0x6e, 0x69, 0x74, 0x65,
+ 0x64, 0x20, 0x4b, 0x69, 0x6e, 0x67, 0x64, 0x6f, 0x6d, 0x3c, 0x2f, 0x6e,
0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66,
- 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f,
+ 0x3d, 0x22, 0x65, 0x74, 0x73, 0x69, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f,
- 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x55, 0x5a,
+ 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x55, 0x53,
0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
- 0x38, 0x36, 0x30, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20,
- 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x55, 0x7a, 0x62, 0x65, 0x6b, 0x69,
- 0x73, 0x74, 0x61, 0x6e, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20,
- 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e,
- 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74,
- 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79,
- 0x20, 0x69, 0x64, 0x3d, 0x22, 0x56, 0x45, 0x22, 0x3e, 0x0a, 0x20, 0x20,
- 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x38, 0x36, 0x32, 0x3c, 0x2f,
- 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65,
- 0x3e, 0x56, 0x65, 0x6e, 0x65, 0x7a, 0x75, 0x65, 0x6c, 0x61, 0x3c, 0x2f,
+ 0x38, 0x34, 0x30, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20,
+ 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64,
+ 0x20, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x3c, 0x2f, 0x6e, 0x61, 0x6d,
+ 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22,
+ 0x66, 0x63, 0x63, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75,
+ 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+ 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x55, 0x59, 0x22, 0x3e, 0x0a,
+ 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x38, 0x35, 0x38,
+ 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3e, 0x55, 0x72, 0x75, 0x67, 0x75, 0x61, 0x79, 0x3c, 0x2f,
0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65,
- 0x66, 0x3d, 0x22, 0x66, 0x63, 0x63, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f,
- 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f,
- 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x56, 0x4e,
- 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
- 0x37, 0x30, 0x34, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20,
- 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x56, 0x69, 0x65, 0x74, 0x20, 0x4e,
- 0x61, 0x6d, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72,
- 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x61, 0x70, 0x61, 0x63, 0x32,
- 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72,
- 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20,
- 0x69, 0x64, 0x3d, 0x22, 0x59, 0x45, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
- 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x38, 0x38, 0x37, 0x3c, 0x2f, 0x69,
- 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e,
- 0x59, 0x65, 0x6d, 0x65, 0x6e, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e,
+ 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c,
+ 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63,
+ 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x55,
+ 0x5a, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63,
+ 0x3e, 0x38, 0x36, 0x30, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
+ 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x55, 0x7a, 0x62, 0x65, 0x6b,
+ 0x69, 0x73, 0x74, 0x61, 0x6e, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e,
0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6e, 0x6f,
0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e,
0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72,
- 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x5a, 0x57, 0x22, 0x3e, 0x0a, 0x20,
- 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x31, 0x36, 0x3c,
+ 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x56, 0x45, 0x22, 0x3e, 0x0a, 0x20,
+ 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x38, 0x36, 0x32, 0x3c,
0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d,
- 0x65, 0x3e, 0x5a, 0x69, 0x6d, 0x62, 0x61, 0x62, 0x77, 0x65, 0x3c, 0x2f,
- 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65,
- 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c,
- 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x0a, 0x3c,
- 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22,
- 0x44, 0x45, 0x42, 0x55, 0x47, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69,
- 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63,
- 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x44, 0x65, 0x62,
- 0x75, 0x67, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72,
- 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x64, 0x65, 0x62, 0x75, 0x67,
- 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72,
- 0x79, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79,
- 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x3e, 0x0a, 0x0a, 0x3c, 0x21, 0x2d,
- 0x2d, 0x0a, 0x20, 0x20, 0x42, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x70, 0x65,
- 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,
- 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x20, 0x61,
- 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x4e, 0x42, 0x3a, 0x20,
- 0x6b, 0x65, 0x65, 0x70, 0x20, 0x73, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20,
- 0x62, 0x79, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x20,
- 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x2c, 0x20, 0x6c,
- 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65,
- 0x20, 0x48, 0x54, 0x0a, 0x2d, 0x2d, 0x3e, 0x0a, 0x3c, 0x73, 0x68, 0x61,
- 0x72, 0x65, 0x64, 0x2d, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63,
- 0x79, 0x2d, 0x62, 0x61, 0x6e, 0x64, 0x73, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46,
- 0x31, 0x5f, 0x34, 0x39, 0x34, 0x32, 0x5f, 0x34, 0x39, 0x38, 0x37, 0x5f,
- 0x35, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73,
- 0x74, 0x61, 0x72, 0x74, 0x3e, 0x34, 0x39, 0x34, 0x32, 0x3c, 0x2f, 0x66,
- 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66,
- 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x34, 0x39, 0x38, 0x37, 0x3c,
- 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20,
- 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x35,
- 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e,
- 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c,
- 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20,
- 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38,
- 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c,
- 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66,
- 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32,
- 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x51, 0x55, 0x41, 0x52,
- 0x54, 0x45, 0x52, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a,
- 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a,
- 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64,
- 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x34, 0x39, 0x34, 0x35, 0x5f, 0x34, 0x39,
- 0x38, 0x35, 0x5f, 0x31, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66,
- 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x34, 0x39, 0x34,
- 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74,
+ 0x65, 0x3e, 0x56, 0x65, 0x6e, 0x65, 0x7a, 0x75, 0x65, 0x6c, 0x61, 0x3c,
+ 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72,
+ 0x65, 0x66, 0x3d, 0x22, 0x66, 0x63, 0x63, 0x22, 0x2f, 0x3e, 0x0a, 0x3c,
+ 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63,
+ 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x56,
+ 0x4e, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63,
+ 0x3e, 0x37, 0x30, 0x34, 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e,
+ 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x56, 0x69, 0x65, 0x74, 0x20,
+ 0x4e, 0x61, 0x6d, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c,
+ 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x61, 0x70, 0x61, 0x63,
+ 0x32, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+ 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79,
+ 0x20, 0x69, 0x64, 0x3d, 0x22, 0x59, 0x45, 0x22, 0x3e, 0x0a, 0x20, 0x20,
+ 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x38, 0x38, 0x37, 0x3c, 0x2f,
+ 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3e, 0x59, 0x65, 0x6d, 0x65, 0x6e, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6e,
+ 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75,
+ 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+ 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x5a, 0x57, 0x22, 0x3e, 0x0a,
+ 0x20, 0x20, 0x3c, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x37, 0x31, 0x36,
+ 0x3c, 0x2f, 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3e, 0x5a, 0x69, 0x6d, 0x62, 0x61, 0x62, 0x77, 0x65, 0x3c,
+ 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c, 0x72, 0x64, 0x20, 0x72,
+ 0x65, 0x66, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x2f, 0x3e, 0x0a,
+ 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x3e, 0x0a, 0x0a,
+ 0x3c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x69, 0x64, 0x3d,
+ 0x22, 0x44, 0x45, 0x42, 0x55, 0x47, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
+ 0x69, 0x73, 0x6f, 0x63, 0x63, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x73, 0x6f,
+ 0x63, 0x63, 0x3e, 0x20, 0x3c, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x44, 0x65,
+ 0x62, 0x75, 0x67, 0x3c, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x3e, 0x20, 0x3c,
+ 0x72, 0x64, 0x20, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x64, 0x65, 0x62, 0x75,
+ 0x67, 0x22, 0x2f, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+ 0x72, 0x79, 0x3e, 0x0a, 0x3c, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72,
+ 0x79, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x3e, 0x0a, 0x0a, 0x3c, 0x21,
+ 0x2d, 0x2d, 0x0a, 0x20, 0x20, 0x42, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x70,
+ 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
+ 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x20,
+ 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x4e, 0x42, 0x3a,
+ 0x20, 0x6b, 0x65, 0x65, 0x70, 0x20, 0x73, 0x6f, 0x72, 0x74, 0x65, 0x64,
+ 0x20, 0x62, 0x79, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x67,
+ 0x20, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x2c, 0x20,
+ 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72,
+ 0x65, 0x20, 0x48, 0x54, 0x0a, 0x2d, 0x2d, 0x3e, 0x0a, 0x3c, 0x73, 0x68,
+ 0x61, 0x72, 0x65, 0x64, 0x2d, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e,
+ 0x63, 0x79, 0x2d, 0x62, 0x61, 0x6e, 0x64, 0x73, 0x3e, 0x0a, 0x3c, 0x66,
+ 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22,
+ 0x46, 0x31, 0x5f, 0x34, 0x39, 0x34, 0x32, 0x5f, 0x34, 0x39, 0x38, 0x37,
+ 0x5f, 0x35, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
+ 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x34, 0x39, 0x34, 0x32, 0x3c, 0x2f,
+ 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c,
+ 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x34, 0x39, 0x38, 0x37,
+ 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20,
+ 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e,
+ 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68,
+ 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35,
+ 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20,
+ 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45,
+ 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41,
+ 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
+ 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30,
+ 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x51, 0x55, 0x41,
+ 0x52, 0x54, 0x45, 0x52, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e,
+ 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e,
+ 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69,
+ 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x34, 0x39, 0x34, 0x35, 0x5f, 0x34,
+ 0x39, 0x38, 0x35, 0x5f, 0x31, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
+ 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x34, 0x39,
+ 0x34, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
+ 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e,
+ 0x34, 0x39, 0x38, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e,
+ 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69,
+ 0x64, 0x74, 0x68, 0x3e, 0x31, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e,
+ 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73,
+ 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73,
+ 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43,
+ 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73,
+ 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49,
+ 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41,
+ 0x4e, 0x5f, 0x48, 0x41, 0x4c, 0x46, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67,
+ 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e,
+ 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64,
+ 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x34, 0x39, 0x32, 0x30,
+ 0x5f, 0x34, 0x39, 0x38, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66,
+ 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x34, 0x39, 0x32,
+ 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74,
0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x34,
- 0x39, 0x38, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64,
+ 0x39, 0x38, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64,
0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64,
- 0x74, 0x68, 0x3e, 0x31, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77,
+ 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77,
0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73,
- 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65,
- 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e,
- 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48,
- 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45,
- 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e,
- 0x5f, 0x48, 0x41, 0x4c, 0x46, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73,
+ 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73,
+ 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73,
+ 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43,
+ 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73,
0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64,
0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20,
- 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x34, 0x39, 0x32, 0x30, 0x5f,
+ 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x34, 0x39, 0x32, 0x30, 0x5f,
0x34, 0x39, 0x38, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72,
0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x34, 0x39, 0x32, 0x30,
0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e,
0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x34, 0x39,
0x38, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e,
0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74,
- 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69,
+ 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69,
0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65,
0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65,
0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e,
@@ -3782,43 +3797,43 @@ const unsigned char regdomain_xml[] = {
0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e,
0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e,
0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69,
- 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x34, 0x39, 0x32, 0x30, 0x5f, 0x34,
+ 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x34, 0x39, 0x35, 0x30, 0x5f, 0x34,
0x39, 0x38, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x34, 0x39, 0x32, 0x30, 0x3c,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x34, 0x39, 0x35, 0x30, 0x3c,
0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20,
0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x34, 0x39, 0x38,
0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a,
0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68,
- 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64,
+ 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64,
0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70,
- 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70,
- 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49,
- 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41,
- 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a,
- 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a,
- 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64,
- 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x34, 0x39, 0x35, 0x30, 0x5f, 0x34, 0x39,
- 0x38, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x34, 0x39, 0x35, 0x30, 0x3c, 0x2f,
- 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c,
- 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x34, 0x39, 0x38, 0x30,
- 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20,
- 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e,
- 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74,
- 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e,
- 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a,
+ 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e,
+ 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45,
+ 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e,
+ 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c,
+ 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c,
+ 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d,
+ 0x22, 0x46, 0x31, 0x5f, 0x35, 0x30, 0x34, 0x30, 0x5f, 0x35, 0x30, 0x38,
+ 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73,
+ 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x30, 0x34, 0x30, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66,
+ 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x30, 0x38, 0x30, 0x3c,
+ 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20,
+ 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32,
+ 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68,
+ 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32,
+ 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a,
0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45,
0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f,
0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f,
0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66,
0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22,
- 0x46, 0x31, 0x5f, 0x35, 0x30, 0x34, 0x30, 0x5f, 0x35, 0x30, 0x38, 0x30,
+ 0x48, 0x34, 0x5f, 0x35, 0x30, 0x34, 0x30, 0x5f, 0x35, 0x30, 0x38, 0x30,
0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74,
0x61, 0x72, 0x74, 0x3e, 0x35, 0x30, 0x34, 0x30, 0x3c, 0x2f, 0x66, 0x72,
0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72,
0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x30, 0x38, 0x30, 0x3c, 0x2f,
0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30,
+ 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30,
0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e,
0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30,
0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20,
@@ -3826,14 +3841,14 @@ const unsigned char regdomain_xml[] = {
0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41,
0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48,
- 0x34, 0x5f, 0x35, 0x30, 0x34, 0x30, 0x5f, 0x35, 0x30, 0x38, 0x30, 0x22,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46,
+ 0x31, 0x5f, 0x35, 0x31, 0x32, 0x30, 0x5f, 0x35, 0x32, 0x34, 0x30, 0x22,
0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
- 0x72, 0x74, 0x3e, 0x35, 0x30, 0x34, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x72, 0x74, 0x3e, 0x35, 0x31, 0x32, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65,
0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x30, 0x38, 0x30, 0x3c, 0x2f, 0x66,
+ 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x32, 0x34, 0x30, 0x3c, 0x2f, 0x66,
0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
- 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c,
0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20,
0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c,
0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20,
@@ -3841,14 +3856,14 @@ const unsigned char regdomain_xml[] = {
0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c,
0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31,
+ 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34,
0x5f, 0x35, 0x31, 0x32, 0x30, 0x5f, 0x35, 0x32, 0x34, 0x30, 0x22, 0x3e,
0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
0x74, 0x3e, 0x35, 0x31, 0x32, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
0x65, 0x6e, 0x64, 0x3e, 0x35, 0x32, 0x34, 0x30, 0x3c, 0x2f, 0x66, 0x72,
0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f,
+ 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f,
0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f,
0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
@@ -3856,14 +3871,14 @@ const unsigned char regdomain_xml[] = {
0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f,
0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65,
0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f,
- 0x35, 0x31, 0x32, 0x30, 0x5f, 0x35, 0x32, 0x34, 0x30, 0x22, 0x3e, 0x0a,
+ 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f,
+ 0x35, 0x31, 0x38, 0x30, 0x5f, 0x35, 0x32, 0x34, 0x30, 0x22, 0x3e, 0x0a,
0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74,
- 0x3e, 0x35, 0x31, 0x32, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73,
+ 0x3e, 0x35, 0x31, 0x38, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73,
0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65,
0x6e, 0x64, 0x3e, 0x35, 0x32, 0x34, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65,
0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61,
- 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63,
+ 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63,
0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63,
0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63,
0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66,
@@ -3871,14 +3886,14 @@ const unsigned char regdomain_xml[] = {
0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66,
0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62,
- 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35,
+ 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35,
0x31, 0x38, 0x30, 0x5f, 0x35, 0x32, 0x34, 0x30, 0x22, 0x3e, 0x0a, 0x20,
0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e,
0x35, 0x31, 0x38, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74,
0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e,
0x64, 0x3e, 0x35, 0x32, 0x34, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e,
- 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68,
0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68,
0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68,
0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c,
@@ -3886,14 +3901,14 @@ const unsigned char regdomain_xml[] = {
0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c,
0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62,
0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61,
- 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35, 0x31,
- 0x38, 0x30, 0x5f, 0x35, 0x32, 0x34, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20,
+ 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x32,
+ 0x30, 0x30, 0x5f, 0x35, 0x32, 0x34, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20,
0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35,
- 0x31, 0x38, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
+ 0x32, 0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64,
0x3e, 0x35, 0x32, 0x34, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65,
0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77,
- 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61,
+ 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61,
0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61,
0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61,
0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61,
@@ -3901,14 +3916,14 @@ const unsigned char regdomain_xml[] = {
0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61,
0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61,
0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e,
- 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x32, 0x30,
+ 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35, 0x32, 0x30,
0x30, 0x5f, 0x35, 0x32, 0x34, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x32,
0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e,
0x35, 0x32, 0x34, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e,
0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69,
- 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e,
+ 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e,
0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e,
0x73, 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e,
0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67,
@@ -3916,14 +3931,14 @@ const unsigned char regdomain_xml[] = {
0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67,
0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e,
0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64,
- 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35, 0x32, 0x30, 0x30,
- 0x5f, 0x35, 0x32, 0x34, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66,
- 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x32, 0x30,
+ 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x32, 0x36, 0x30,
+ 0x5f, 0x35, 0x33, 0x32, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66,
+ 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x32, 0x36,
0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74,
0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35,
- 0x32, 0x34, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64,
+ 0x33, 0x32, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64,
0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64,
- 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77,
+ 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77,
0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73,
0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73,
0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73,
@@ -3931,14 +3946,14 @@ const unsigned char regdomain_xml[] = {
0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73,
0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64,
0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20,
- 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x32, 0x36, 0x30, 0x5f,
+ 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35, 0x32, 0x36, 0x30, 0x5f,
0x35, 0x33, 0x32, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72,
0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x32, 0x36, 0x30,
0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e,
0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x33,
0x32, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e,
0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74,
- 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69,
+ 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69,
0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65,
0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65,
0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e,
@@ -3946,14 +3961,14 @@ const unsigned char regdomain_xml[] = {
0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e,
0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e,
0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69,
- 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35, 0x32, 0x36, 0x30, 0x5f, 0x35,
- 0x33, 0x32, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x32, 0x36, 0x30, 0x5f, 0x35,
+ 0x37, 0x30, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65,
0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x32, 0x36, 0x30, 0x3c,
0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20,
- 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x33, 0x32,
+ 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x37, 0x30,
0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a,
0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68,
- 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64,
+ 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64,
0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70,
0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70,
0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49,
@@ -3961,11 +3976,11 @@ const unsigned char regdomain_xml[] = {
0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a,
0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a,
0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64,
- 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x32, 0x36, 0x30, 0x5f, 0x35, 0x37,
- 0x30, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x32, 0x36, 0x30, 0x3c, 0x2f,
+ 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x32, 0x38, 0x30, 0x5f, 0x35, 0x33,
+ 0x32, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
+ 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x32, 0x38, 0x30, 0x3c, 0x2f,
0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c,
- 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x37, 0x30, 0x30,
+ 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x33, 0x32, 0x30,
0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20,
0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e,
0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74,
@@ -3976,13 +3991,13 @@ const unsigned char regdomain_xml[] = {
0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c,
0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c,
0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d,
- 0x22, 0x46, 0x31, 0x5f, 0x35, 0x32, 0x38, 0x30, 0x5f, 0x35, 0x33, 0x32,
+ 0x22, 0x48, 0x34, 0x5f, 0x35, 0x32, 0x38, 0x30, 0x5f, 0x35, 0x33, 0x32,
0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73,
0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x32, 0x38, 0x30, 0x3c, 0x2f, 0x66,
0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66,
0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x33, 0x32, 0x30, 0x3c,
0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20,
- 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32,
+ 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34,
0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68,
0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32,
0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a,
@@ -3991,13 +4006,13 @@ const unsigned char regdomain_xml[] = {
0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f,
0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66,
0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22,
- 0x48, 0x34, 0x5f, 0x35, 0x32, 0x38, 0x30, 0x5f, 0x35, 0x33, 0x32, 0x30,
+ 0x46, 0x31, 0x5f, 0x35, 0x35, 0x30, 0x30, 0x5f, 0x35, 0x35, 0x38, 0x30,
0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74,
- 0x61, 0x72, 0x74, 0x3e, 0x35, 0x32, 0x38, 0x30, 0x3c, 0x2f, 0x66, 0x72,
+ 0x61, 0x72, 0x74, 0x3e, 0x35, 0x35, 0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72,
0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72,
- 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x33, 0x32, 0x30, 0x3c, 0x2f,
+ 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x35, 0x38, 0x30, 0x3c, 0x2f,
0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30,
+ 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30,
0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e,
0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30,
0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20,
@@ -4005,14 +4020,14 @@ const unsigned char regdomain_xml[] = {
0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41,
0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46,
- 0x31, 0x5f, 0x35, 0x35, 0x30, 0x30, 0x5f, 0x35, 0x35, 0x38, 0x30, 0x22,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48,
+ 0x34, 0x5f, 0x35, 0x35, 0x30, 0x30, 0x5f, 0x35, 0x35, 0x38, 0x30, 0x22,
0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
0x72, 0x74, 0x3e, 0x35, 0x35, 0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65,
0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x35, 0x38, 0x30, 0x3c, 0x2f, 0x66,
0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
- 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c,
0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20,
0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c,
0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20,
@@ -4020,14 +4035,14 @@ const unsigned char regdomain_xml[] = {
0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c,
0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34,
- 0x5f, 0x35, 0x35, 0x30, 0x30, 0x5f, 0x35, 0x35, 0x38, 0x30, 0x22, 0x3e,
+ 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31,
+ 0x5f, 0x35, 0x35, 0x30, 0x30, 0x5f, 0x35, 0x36, 0x32, 0x30, 0x22, 0x3e,
0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
0x74, 0x3e, 0x35, 0x35, 0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x35, 0x38, 0x30, 0x3c, 0x2f, 0x66, 0x72,
+ 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x36, 0x32, 0x30, 0x3c, 0x2f, 0x66, 0x72,
0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f,
+ 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f,
0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f,
0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
@@ -4035,14 +4050,14 @@ const unsigned char regdomain_xml[] = {
0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f,
0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65,
0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f,
+ 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f,
0x35, 0x35, 0x30, 0x30, 0x5f, 0x35, 0x36, 0x32, 0x30, 0x22, 0x3e, 0x0a,
0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74,
0x3e, 0x35, 0x35, 0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73,
0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65,
0x6e, 0x64, 0x3e, 0x35, 0x36, 0x32, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65,
0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61,
- 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63,
+ 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63,
0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63,
0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63,
0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66,
@@ -4051,11 +4066,11 @@ const unsigned char regdomain_xml[] = {
0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62,
0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35,
- 0x35, 0x30, 0x30, 0x5f, 0x35, 0x36, 0x32, 0x30, 0x22, 0x3e, 0x0a, 0x20,
+ 0x35, 0x30, 0x30, 0x5f, 0x35, 0x36, 0x38, 0x30, 0x22, 0x3e, 0x0a, 0x20,
0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e,
0x35, 0x35, 0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74,
0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e,
- 0x64, 0x3e, 0x35, 0x36, 0x32, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
+ 0x64, 0x3e, 0x35, 0x36, 0x38, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e,
0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68,
0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68,
@@ -4065,14 +4080,14 @@ const unsigned char regdomain_xml[] = {
0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c,
0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62,
0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61,
- 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35, 0x35,
- 0x30, 0x30, 0x5f, 0x35, 0x36, 0x38, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20,
+ 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x35,
+ 0x30, 0x30, 0x5f, 0x35, 0x37, 0x30, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20,
0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35,
0x35, 0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64,
- 0x3e, 0x35, 0x36, 0x38, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65,
+ 0x3e, 0x35, 0x37, 0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65,
0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77,
- 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61,
+ 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61,
0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61,
0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61,
0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61,
@@ -4080,10 +4095,10 @@ const unsigned char regdomain_xml[] = {
0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61,
0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61,
0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e,
- 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x35, 0x30,
+ 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x36, 0x36,
0x30, 0x5f, 0x35, 0x37, 0x30, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
- 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x35,
- 0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
+ 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x36,
+ 0x36, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e,
0x35, 0x37, 0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e,
0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69,
@@ -4095,14 +4110,14 @@ const unsigned char regdomain_xml[] = {
0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67,
0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e,
0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64,
- 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x36, 0x36, 0x30,
+ 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35, 0x36, 0x36, 0x30,
0x5f, 0x35, 0x37, 0x30, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66,
0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x36, 0x36,
0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74,
0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35,
0x37, 0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64,
0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64,
- 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77,
+ 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77,
0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73,
0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73,
0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73,
@@ -4110,12 +4125,12 @@ const unsigned char regdomain_xml[] = {
0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73,
0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64,
0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20,
- 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35, 0x36, 0x36, 0x30, 0x5f,
- 0x35, 0x37, 0x30, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72,
- 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x36, 0x36, 0x30,
+ 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35, 0x37, 0x32, 0x35, 0x5f,
+ 0x35, 0x38, 0x32, 0x35, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72,
+ 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x37, 0x32, 0x35,
0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e,
- 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x37,
- 0x30, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e,
+ 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x38,
+ 0x32, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e,
0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74,
0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69,
0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65,
@@ -4125,14 +4140,14 @@ const unsigned char regdomain_xml[] = {
0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e,
0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e,
0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69,
- 0x64, 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35, 0x37, 0x32, 0x35, 0x5f, 0x35,
- 0x38, 0x32, 0x35, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x37, 0x32, 0x35, 0x3c,
+ 0x64, 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x37, 0x34, 0x35, 0x5f, 0x35,
+ 0x38, 0x30, 0x35, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x37, 0x34, 0x35, 0x3c,
0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20,
- 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x38, 0x32,
+ 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x38, 0x30,
0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a,
0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68,
- 0x3e, 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64,
+ 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64,
0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70,
0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70,
0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49,
@@ -4140,14 +4155,14 @@ const unsigned char regdomain_xml[] = {
0x4e, 0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a,
0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a,
0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64,
- 0x3d, 0x22, 0x46, 0x31, 0x5f, 0x35, 0x37, 0x34, 0x35, 0x5f, 0x35, 0x38,
+ 0x3d, 0x22, 0x48, 0x34, 0x5f, 0x35, 0x37, 0x34, 0x35, 0x5f, 0x35, 0x38,
0x30, 0x35, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x37, 0x34, 0x35, 0x3c, 0x2f,
0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c,
0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x38, 0x30, 0x35,
0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20,
0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e,
- 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74,
+ 0x34, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74,
0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e,
0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e,
0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45,
@@ -4155,11 +4170,11 @@ const unsigned char regdomain_xml[] = {
0x5f, 0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c,
0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c,
0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d,
- 0x22, 0x48, 0x34, 0x5f, 0x35, 0x37, 0x34, 0x35, 0x5f, 0x35, 0x38, 0x30,
+ 0x22, 0x48, 0x34, 0x5f, 0x35, 0x37, 0x34, 0x35, 0x5f, 0x35, 0x38, 0x32,
0x35, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73,
0x74, 0x61, 0x72, 0x74, 0x3e, 0x35, 0x37, 0x34, 0x35, 0x3c, 0x2f, 0x66,
0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66,
- 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x38, 0x30, 0x35, 0x3c,
+ 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x38, 0x32, 0x35, 0x3c,
0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20,
0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34,
0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68,
@@ -4170,13 +4185,13 @@ const unsigned char regdomain_xml[] = {
0x41, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f,
0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66,
0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22,
- 0x48, 0x34, 0x5f, 0x35, 0x37, 0x34, 0x35, 0x5f, 0x35, 0x38, 0x32, 0x35,
+ 0x46, 0x31, 0x5f, 0x35, 0x38, 0x32, 0x35, 0x5f, 0x35, 0x38, 0x32, 0x35,
0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74,
- 0x61, 0x72, 0x74, 0x3e, 0x35, 0x37, 0x34, 0x35, 0x3c, 0x2f, 0x66, 0x72,
+ 0x61, 0x72, 0x74, 0x3e, 0x35, 0x38, 0x32, 0x35, 0x3c, 0x2f, 0x66, 0x72,
0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72,
0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x38, 0x32, 0x35, 0x3c, 0x2f,
0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30,
+ 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30,
0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e,
0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30,
0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20,
@@ -4184,301 +4199,286 @@ const unsigned char regdomain_xml[] = {
0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41,
0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46,
- 0x31, 0x5f, 0x35, 0x38, 0x32, 0x35, 0x5f, 0x35, 0x38, 0x32, 0x35, 0x22,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48,
+ 0x34, 0x5f, 0x35, 0x38, 0x32, 0x35, 0x5f, 0x35, 0x38, 0x32, 0x35, 0x22,
0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
0x72, 0x74, 0x3e, 0x35, 0x38, 0x32, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65,
0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
0x71, 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x38, 0x32, 0x35, 0x3c, 0x2f, 0x66,
0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
- 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c,
0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20,
0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c,
0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20,
0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38,
0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c,
0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34,
- 0x5f, 0x35, 0x38, 0x32, 0x35, 0x5f, 0x35, 0x38, 0x32, 0x35, 0x22, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x3e, 0x35, 0x38, 0x32, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x35, 0x38, 0x32, 0x35, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x32, 0x30, 0x3c, 0x2f,
- 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
- 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30,
- 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x3c, 0x2f,
- 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31,
- 0x5f, 0x32, 0x33, 0x31, 0x32, 0x5f, 0x32, 0x33, 0x37, 0x32, 0x22, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x3e, 0x32, 0x33, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x33, 0x37, 0x32, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63,
- 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31,
- 0x5f, 0x32, 0x34, 0x31, 0x32, 0x5f, 0x32, 0x34, 0x36, 0x32, 0x22, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x3e, 0x32, 0x34, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x36, 0x32, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63,
- 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34,
- 0x5f, 0x32, 0x34, 0x31, 0x32, 0x5f, 0x32, 0x34, 0x36, 0x32, 0x22, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x3e, 0x32, 0x34, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x36, 0x32, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63,
- 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31,
- 0x5f, 0x32, 0x34, 0x31, 0x32, 0x5f, 0x32, 0x34, 0x37, 0x32, 0x22, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x3e, 0x32, 0x34, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x37, 0x32, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63,
- 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34,
- 0x5f, 0x32, 0x34, 0x31, 0x32, 0x5f, 0x32, 0x34, 0x37, 0x32, 0x22, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x3e, 0x32, 0x34, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x37, 0x32, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63,
- 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31,
- 0x5f, 0x32, 0x34, 0x36, 0x37, 0x5f, 0x32, 0x34, 0x37, 0x32, 0x22, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x3e, 0x32, 0x34, 0x36, 0x37, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x37, 0x32, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63,
- 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48, 0x34,
- 0x5f, 0x32, 0x34, 0x36, 0x37, 0x5f, 0x32, 0x34, 0x37, 0x32, 0x22, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x3e, 0x32, 0x34, 0x36, 0x37, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x37, 0x32, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c, 0x2f,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63,
- 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31,
- 0x5f, 0x32, 0x34, 0x38, 0x34, 0x5f, 0x32, 0x34, 0x38, 0x34, 0x22, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x3e, 0x32, 0x34, 0x38, 0x34, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x38, 0x34, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63,
- 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46, 0x31,
- 0x5f, 0x32, 0x35, 0x31, 0x32, 0x5f, 0x32, 0x37, 0x33, 0x32, 0x22, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x3e, 0x32, 0x35, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x37, 0x33, 0x32, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f,
- 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
- 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63,
- 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x0a, 0x3c, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53,
- 0x31, 0x5f, 0x39, 0x30, 0x37, 0x5f, 0x39, 0x32, 0x32, 0x5f, 0x35, 0x22,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46,
+ 0x31, 0x5f, 0x32, 0x33, 0x31, 0x32, 0x5f, 0x32, 0x33, 0x37, 0x32, 0x22,
0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
- 0x72, 0x74, 0x3e, 0x39, 0x30, 0x37, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x39, 0x32, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65,
- 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61,
- 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61,
- 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61,
- 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31,
- 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f, 0x66,
- 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61,
- 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31,
- 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x51, 0x55, 0x41, 0x52, 0x54, 0x45,
- 0x52, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f,
- 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66,
- 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22,
- 0x53, 0x31, 0x5f, 0x39, 0x30, 0x37, 0x5f, 0x39, 0x32, 0x32, 0x5f, 0x31,
- 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73,
- 0x74, 0x61, 0x72, 0x74, 0x3e, 0x39, 0x30, 0x37, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72,
- 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x39, 0x32, 0x32, 0x3c, 0x2f, 0x66,
+ 0x72, 0x74, 0x3e, 0x32, 0x33, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x33, 0x37, 0x32, 0x3c, 0x2f, 0x66,
0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
- 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x31, 0x30, 0x3c,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c,
0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20,
0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f,
- 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
- 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30,
- 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d,
- 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
- 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30,
- 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x48, 0x41, 0x4c,
- 0x46, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f,
- 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66,
+ 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46,
+ 0x31, 0x5f, 0x32, 0x34, 0x31, 0x32, 0x5f, 0x32, 0x34, 0x36, 0x32, 0x22,
+ 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x3e, 0x32, 0x34, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x36, 0x32, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c,
+ 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20,
+ 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f,
+ 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48,
+ 0x34, 0x5f, 0x32, 0x34, 0x31, 0x32, 0x5f, 0x32, 0x34, 0x36, 0x32, 0x22,
+ 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x3e, 0x32, 0x34, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x36, 0x32, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c,
+ 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20,
+ 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f,
+ 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46,
+ 0x31, 0x5f, 0x32, 0x34, 0x31, 0x32, 0x5f, 0x32, 0x34, 0x37, 0x32, 0x22,
+ 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x3e, 0x32, 0x34, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x37, 0x32, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c,
+ 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20,
+ 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f,
+ 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48,
+ 0x34, 0x5f, 0x32, 0x34, 0x31, 0x32, 0x5f, 0x32, 0x34, 0x37, 0x32, 0x22,
+ 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x3e, 0x32, 0x34, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x37, 0x32, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c,
+ 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20,
+ 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f,
+ 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46,
+ 0x31, 0x5f, 0x32, 0x34, 0x36, 0x37, 0x5f, 0x32, 0x34, 0x37, 0x32, 0x22,
+ 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x3e, 0x32, 0x34, 0x36, 0x37, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x37, 0x32, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c,
+ 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20,
+ 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f,
+ 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x48,
+ 0x34, 0x5f, 0x32, 0x34, 0x36, 0x37, 0x5f, 0x32, 0x34, 0x37, 0x32, 0x22,
+ 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x3e, 0x32, 0x34, 0x36, 0x37, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x37, 0x32, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x34, 0x30, 0x3c,
+ 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20,
+ 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f,
+ 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46,
+ 0x31, 0x5f, 0x32, 0x34, 0x38, 0x34, 0x5f, 0x32, 0x34, 0x38, 0x34, 0x22,
+ 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x3e, 0x32, 0x34, 0x38, 0x34, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x34, 0x38, 0x34, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c,
+ 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20,
+ 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f,
+ 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x46,
+ 0x31, 0x5f, 0x32, 0x35, 0x31, 0x32, 0x5f, 0x32, 0x37, 0x33, 0x32, 0x22,
+ 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x3e, 0x32, 0x35, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x32, 0x37, 0x33, 0x32, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c,
+ 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20,
+ 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f,
+ 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x0a, 0x3c, 0x66,
0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22,
- 0x53, 0x31, 0x5f, 0x39, 0x31, 0x32, 0x5f, 0x39, 0x31, 0x37, 0x22, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x3e, 0x39, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73,
- 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65,
- 0x6e, 0x64, 0x3e, 0x39, 0x31, 0x37, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e,
- 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68,
- 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68,
- 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61,
- 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61,
- 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31,
- 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f, 0x66,
- 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x31, 0x5f,
- 0x39, 0x30, 0x38, 0x5f, 0x39, 0x32, 0x33, 0x5f, 0x35, 0x22, 0x3e, 0x0a,
- 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74,
- 0x3e, 0x39, 0x30, 0x38, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74,
- 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e,
- 0x64, 0x3e, 0x39, 0x32, 0x33, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65,
- 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77,
- 0x69, 0x64, 0x74, 0x68, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e,
- 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e,
- 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73,
- 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73,
- 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43,
- 0x48, 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f, 0x66, 0x6c, 0x61,
- 0x67, 0x73, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73,
- 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43,
- 0x48, 0x41, 0x4e, 0x5f, 0x51, 0x55, 0x41, 0x52, 0x54, 0x45, 0x52, 0x3c,
- 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
- 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x31,
- 0x5f, 0x39, 0x31, 0x33, 0x5f, 0x39, 0x31, 0x38, 0x5f, 0x31, 0x30, 0x22,
+ 0x53, 0x31, 0x5f, 0x39, 0x30, 0x37, 0x5f, 0x39, 0x32, 0x32, 0x5f, 0x35,
+ 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74,
+ 0x61, 0x72, 0x74, 0x3e, 0x39, 0x30, 0x37, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x39, 0x32, 0x32, 0x3c, 0x2f, 0x66, 0x72,
+ 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
+ 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x35, 0x3c, 0x2f, 0x63,
+ 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63,
+ 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68,
+ 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c,
+ 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31,
+ 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f,
+ 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c,
+ 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31,
+ 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x51, 0x55, 0x41, 0x52, 0x54,
+ 0x45, 0x52, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c,
+ 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c,
+ 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d,
+ 0x22, 0x53, 0x31, 0x5f, 0x39, 0x30, 0x37, 0x5f, 0x39, 0x32, 0x32, 0x5f,
+ 0x31, 0x30, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
+ 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x39, 0x30, 0x37, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66,
+ 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x39, 0x32, 0x32, 0x3c, 0x2f,
+ 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
+ 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x31, 0x30,
+ 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e,
+ 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c,
+ 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20,
+ 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38,
+ 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x47, 0x53,
+ 0x4d, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x20, 0x20,
+ 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38,
+ 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x48, 0x41,
+ 0x4c, 0x46, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c,
+ 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c,
+ 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d,
+ 0x22, 0x53, 0x31, 0x5f, 0x39, 0x31, 0x32, 0x5f, 0x39, 0x31, 0x37, 0x22,
0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
- 0x72, 0x74, 0x3e, 0x39, 0x31, 0x33, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
+ 0x72, 0x74, 0x3e, 0x39, 0x31, 0x32, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71,
- 0x65, 0x6e, 0x64, 0x3e, 0x39, 0x31, 0x38, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x65, 0x6e, 0x64, 0x3e, 0x39, 0x31, 0x37, 0x3c, 0x2f, 0x66, 0x72, 0x65,
0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61,
- 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x31, 0x30, 0x3c, 0x2f, 0x63,
+ 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63,
0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63,
0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68,
0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c,
0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31,
0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f,
- 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c,
- 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31,
- 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x48, 0x41, 0x4c, 0x46, 0x3c,
- 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72,
- 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65,
+ 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x0a, 0x3c, 0x66, 0x72, 0x65,
0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x31,
- 0x5f, 0x39, 0x31, 0x33, 0x5f, 0x39, 0x31, 0x38, 0x22, 0x3e, 0x0a, 0x20,
- 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e,
- 0x39, 0x31, 0x33, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
- 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64,
- 0x3e, 0x39, 0x31, 0x38, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e,
- 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69,
- 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e,
- 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e,
- 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73,
- 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73,
- 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43,
- 0x48, 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f, 0x66, 0x6c, 0x61,
- 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61,
- 0x6e, 0x64, 0x3e, 0x0a, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61,
- 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x31, 0x5f, 0x39, 0x30,
- 0x35, 0x5f, 0x39, 0x32, 0x35, 0x5f, 0x35, 0x22, 0x3e, 0x0a, 0x20, 0x20,
- 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x39,
- 0x30, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
- 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e,
- 0x39, 0x32, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64,
- 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64,
- 0x74, 0x68, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69,
- 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65,
- 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70,
- 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49,
- 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41,
- 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73,
- 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49,
- 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41,
- 0x4e, 0x5f, 0x51, 0x55, 0x41, 0x52, 0x54, 0x45, 0x52, 0x3c, 0x2f, 0x66,
- 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62,
- 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x31, 0x5f, 0x39,
- 0x31, 0x30, 0x5f, 0x39, 0x32, 0x30, 0x5f, 0x31, 0x30, 0x22, 0x3e, 0x0a,
+ 0x5f, 0x39, 0x30, 0x38, 0x5f, 0x39, 0x32, 0x33, 0x5f, 0x35, 0x22, 0x3e,
+ 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
+ 0x74, 0x3e, 0x39, 0x30, 0x38, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73,
+ 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65,
+ 0x6e, 0x64, 0x3e, 0x39, 0x32, 0x33, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
+ 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61,
+ 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61,
+ 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e,
+ 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67,
+ 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f,
+ 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f, 0x66, 0x6c,
+ 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67,
+ 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f,
+ 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x51, 0x55, 0x41, 0x52, 0x54, 0x45, 0x52,
+ 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53,
+ 0x31, 0x5f, 0x39, 0x31, 0x33, 0x5f, 0x39, 0x31, 0x38, 0x5f, 0x31, 0x30,
+ 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74,
+ 0x61, 0x72, 0x74, 0x3e, 0x39, 0x31, 0x33, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65,
+ 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x39, 0x31, 0x38, 0x3c, 0x2f, 0x66, 0x72,
+ 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68,
+ 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x31, 0x30, 0x3c, 0x2f,
+ 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c,
+ 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63,
+ 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66,
+ 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32,
+ 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c,
+ 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66,
+ 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32,
+ 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x48, 0x41, 0x4c, 0x46,
+ 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66,
+ 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72,
+ 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53,
+ 0x31, 0x5f, 0x39, 0x31, 0x33, 0x5f, 0x39, 0x31, 0x38, 0x22, 0x3e, 0x0a,
0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74,
- 0x3e, 0x39, 0x31, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74,
+ 0x3e, 0x39, 0x31, 0x33, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74,
0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e,
- 0x64, 0x3e, 0x39, 0x32, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65,
+ 0x64, 0x3e, 0x39, 0x31, 0x38, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65,
0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77,
- 0x69, 0x64, 0x74, 0x68, 0x3e, 0x31, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61,
+ 0x69, 0x64, 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61,
0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61,
0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e,
0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67,
0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f,
0x43, 0x48, 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f, 0x66, 0x6c,
- 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67,
- 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f,
- 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x48, 0x41, 0x4c, 0x46, 0x3c, 0x2f, 0x66,
- 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
- 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62,
+ 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62,
+ 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x62,
0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x31, 0x5f, 0x39,
- 0x31, 0x35, 0x5f, 0x39, 0x31, 0x35, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
- 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x39, 0x31,
- 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74,
- 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e, 0x39,
- 0x31, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e,
- 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74,
- 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69,
- 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65,
- 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65, 0x70,
- 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x49,
- 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48, 0x41,
- 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67, 0x73,
- 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e, 0x64,
- 0x3e, 0x0a, 0x0a, 0x0a, 0x3c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64,
- 0x2d, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x2d, 0x62,
- 0x61, 0x6e, 0x64, 0x73, 0x3e, 0x0a, 0x0a, 0x3c, 0x2f, 0x72, 0x65, 0x67,
- 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2d, 0x64, 0x61, 0x74, 0x61,
- 0x3e, 0x0a,
+ 0x30, 0x35, 0x5f, 0x39, 0x32, 0x35, 0x5f, 0x35, 0x22, 0x3e, 0x0a, 0x20,
+ 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e,
+ 0x39, 0x30, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64,
+ 0x3e, 0x39, 0x32, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e,
+ 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69,
+ 0x64, 0x74, 0x68, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73,
+ 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65,
+ 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e,
+ 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48,
+ 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67,
+ 0x73, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e,
+ 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48,
+ 0x41, 0x4e, 0x5f, 0x51, 0x55, 0x41, 0x52, 0x54, 0x45, 0x52, 0x3c, 0x2f,
+ 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71,
+ 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x31, 0x5f,
+ 0x39, 0x31, 0x30, 0x5f, 0x39, 0x32, 0x30, 0x5f, 0x31, 0x30, 0x22, 0x3e,
+ 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
+ 0x74, 0x3e, 0x39, 0x31, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73,
+ 0x74, 0x61, 0x72, 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65,
+ 0x6e, 0x64, 0x3e, 0x39, 0x32, 0x30, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71,
+ 0x65, 0x6e, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x31, 0x30, 0x3c, 0x2f, 0x63, 0x68,
+ 0x61, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68,
+ 0x61, 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61,
+ 0x6e, 0x73, 0x65, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61,
+ 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31,
+ 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f, 0x66,
+ 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61,
+ 0x67, 0x73, 0x3e, 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31,
+ 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x48, 0x41, 0x4c, 0x46, 0x3c, 0x2f,
+ 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65,
+ 0x71, 0x62, 0x61, 0x6e, 0x64, 0x3e, 0x0a, 0x3c, 0x66, 0x72, 0x65, 0x71,
+ 0x62, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x53, 0x31, 0x5f,
+ 0x39, 0x31, 0x35, 0x5f, 0x39, 0x31, 0x35, 0x22, 0x3e, 0x0a, 0x20, 0x20,
+ 0x3c, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x39,
+ 0x31, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x73, 0x74, 0x61, 0x72,
+ 0x74, 0x3e, 0x20, 0x3c, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64, 0x3e,
+ 0x39, 0x31, 0x35, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x65, 0x6e, 0x64,
+ 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x77, 0x69, 0x64,
+ 0x74, 0x68, 0x3e, 0x32, 0x30, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x3e, 0x20, 0x3c, 0x63, 0x68, 0x61, 0x6e, 0x73,
+ 0x65, 0x70, 0x3e, 0x35, 0x3c, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x73, 0x65,
+ 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x3e,
+ 0x49, 0x45, 0x45, 0x45, 0x38, 0x30, 0x32, 0x31, 0x31, 0x5f, 0x43, 0x48,
+ 0x41, 0x4e, 0x5f, 0x47, 0x53, 0x4d, 0x3c, 0x2f, 0x66, 0x6c, 0x61, 0x67,
+ 0x73, 0x3e, 0x0a, 0x3c, 0x2f, 0x66, 0x72, 0x65, 0x71, 0x62, 0x61, 0x6e,
+ 0x64, 0x3e, 0x0a, 0x0a, 0x0a, 0x3c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65,
+ 0x64, 0x2d, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x2d,
+ 0x62, 0x61, 0x6e, 0x64, 0x73, 0x3e, 0x0a, 0x0a, 0x3c, 0x2f, 0x72, 0x65,
+ 0x67, 0x75, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2d, 0x64, 0x61, 0x74,
+ 0x61, 0x3e, 0x0a,
};
const size_t regdomain_xml_size = sizeof(regdomain_xml);