spi,
scopes,
FALSE,
- dir_agent)))
+ dir_agent,
+ 0 // Service type, we are not SA.
+ )))
{
- if (addr != NULL && inet_addr(addr) == inet_addr("127.0.0.1"))
+ if (slp_is_loop_back_addr(addr))
{
client->local_attr_req(client, url, scopes, tags);
}
}
else
{
- SOCKADDR_IN address;
- address.sin_port = htons(port);
- address.sin_family = AF_INET;
- if (addr != NULL)
+ if (!addr)
{
- address.sin_addr.s_addr = inet_addr(addr);
- client->unicast_attr_req(client, url, scopes, tags, &address);
+ client->converge_attr_req(client, url, scopes, tags);
}
else
{
- address.sin_addr.s_addr = _LSLP_MCAST;
- client->converge_attr_req(client, url, scopes, tags);
+#ifdef PEGASUS_ENABLE_IPV6
+ SOCKADDR_IN6 ip6;
+#endif
+ SOCKADDR_IN ip4;
+ void *target = 0;
+
+ if (slp_is_valid_ip4_addr(addr))
+ {
+ ip4.sin_port = htons(port);
+ ip4.sin_family = AF_INET;
+ ip4.sin_addr.s_addr = inet_addr(addr);
+ target = &ip4;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ memset(&ip6, 0, sizeof(ip6));
+ ip6.sin6_port = htons(port);
+ ip6.sin6_family = AF_INET6;
+ slp_pton(AF_INET6, addr, &ip6.sin6_addr);
+ target = &ip6;
+ }
+#endif
+ if(target)
+ {
+ client->unicast_attr_req(
+ client,
+ url,
+ scopes,
+ tags,
+ (SOCKADDR*)target);
+ }
}
- } /* end of request */
+ }
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
const char *predicate; // = NULL;
int16 port; // = 427;
BOOL dir_agent; // = FALSE;
+ int converge = 0; // Converge cycles.
if ((SLPClientOptions*)NULL == options)
{
spi, // spi
scopes, // scopes
FALSE, // should_listen
- dir_agent // use_das
+ dir_agent,// use_das
+ 0 // Service type , we are not SA.
)))
{
- if (addr != NULL && inet_addr(addr) == inet_addr("127.0.0.1"))
+ if (slp_is_loop_back_addr(addr))
{
client->local_srv_req(client, type, predicate, scopes);
}
+ else if (converge)
+ {
+ client->_convergence = converge ;
+ client->converge_srv_req(client, type, predicate, scopes);
+ }
else
{
- SOCKADDR_IN address;
- address.sin_port = htons(port);
- address.sin_family = AF_INET;
- if (addr != NULL)
+ if (!addr)
{
- address.sin_addr.s_addr = inet_addr(addr);
+ client->converge_srv_req(client, type, predicate, scopes);
}
else
{
- address.sin_addr.s_addr = _LSLP_MCAST;
+#ifdef PEGASUS_ENABLE_IPV6
+ SOCKADDR_IN6 ip6;
+#endif
+ SOCKADDR_IN ip4;
+ void *target = 0;
+
+ if (slp_is_valid_ip4_addr(addr))
+ {
+ ip4.sin_port = htons(port);
+ ip4.sin_family = AF_INET;
+ ip4.sin_addr.s_addr = inet_addr(addr);
+ target = &ip4;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ memset(&ip6, 0, sizeof(ip6));
+ ip6.sin6_port = htons(port);
+ ip6.sin6_family = AF_INET6;
+ slp_pton(AF_INET6, addr, &ip6.sin6_addr);
+ target = &ip6;
+ }
+#endif
+ if(target)
+ {
+ client->unicast_srv_req(
+ client,
+ type,
+ predicate,
+ scopes,
+ (SOCKADDR*)target);
+ }
}
- client->unicast_srv_req(client, type, predicate, scopes, &address);
}
responses.isHead = TRUE;
#include "WBEMSLPTemplate.h"
#include <slp/slp_client/src/cmd-utils/slp_client/slp_client.h>
+#include <slp/slp_client/src/cmd-utils/slp_client/slp_utils.h>
#endif /* PegasusSLPWrapper_h */
# endif
#endif
+#ifdef PEGASUS_ENABLE_IPV6
+# ifdef PEGASUS_HAS_GETIFADDRS
+# include <ifaddrs.h>
+# endif
+#endif
+
//------------------------------------------------------------------------------
//
// PEGASUS_OS_TYPE_UNIX or PEGASUS_OS_VMS network system header files.
//------------------------------------------------------------------------------
#if defined(PEGASUS_OS_TYPE_UNIX) || defined (PEGASUS_OS_VMS)
+
# include <errno.h>
# include <sys/types.h>
# include <fcntl.h>
//
//------------------------------------------------------------------------------
-#ifdef PEGASUS_ENABLE_IPV6
# ifdef PEGASUS_OS_TYPE_WINDOWS
# define PEGASUS_INVALID_ADDRESS_FAMILY WSAEAFNOSUPPORT
# else
# define PEGASUS_INVALID_ADDRESS_FAMILY EAFNOSUPPORT
# endif
-#endif
//------------------------------------------------------------------------------
//
#define PEGASUS_HAS_SIGNALS
+/* getifaddrs() avilable in gcc version >= 3.4 */
+#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
+# define PEGASUS_HAS_GETIFADDRS
+#endif
+
#endif /* Pegasus_Platform_LINUX_IA64_GNU_h */
#define PEGASUS_HAS_SIGNALS
+/* getifaddrs() avilable in gcc version >= 3.4 */
+#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
+# define PEGASUS_HAS_GETIFADDRS
+#endif
+
#endif /* Pegasus_Platform_LINUX_IX86_GNU_h */
#define PEGASUS_HAS_SIGNALS
+
+/* getifaddrs() avilable in gcc version >=3.4 */
+#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
+# define PEGASUS_HAS_GETIFADDRS
+#endif
+
#endif /* Pegasus_Platform_LINUX_PPC_GNU_h */
#define PEGASUS_HAS_SIGNALS
+/* getifaddrs() avilable in gcc version > 3.4 */
+#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
+# define PEGASUS_HAS_GETIFADDRS
+#endif
+
#endif /* Pegasus_Platform_LINUX_PPC_GNU_h */
#define PEGASUS_HAS_SIGNALS
+/* getifaddrs() avilable in gcc version >= 3.4 */
+#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
+# define PEGASUS_HAS_GETIFADDRS
+#endif
+
#endif /* Pegasus_Platform_LINUX_X86_64_GNU_h */
#define PEGASUS_HAS_SIGNALS
+/* getifaddrs() avilable in gcc version >= 3.4 */
+#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
+# define PEGASUS_HAS_GETIFADDRS
+#endif
+
#endif /* Pegasus_Platform_LINUX_XSCALE_GNU_h */
#define PEGASUS_HAS_SIGNALS
+/* getifaddrs() avilable in gcc version >= 3.4 */
+#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
+# define PEGASUS_HAS_GETIFADDRS
+#endif
+
#endif /* Pegasus_Platform_LINUX_ZSERIES_GNU_h */
#define PEGASUS_HAS_SIGNALS
+/* getifaddrs() avilable in gcc version >= 3.4 */
+#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4))
+# define PEGASUS_HAS_GETIFADDRS
+#endif
+
#endif /* Pegasus_Platform_LINUX_ZSERIES_GNU_h */
#include <Pegasus/Common/Config.h>
#include <Pegasus/Common/String.h>
+#include <Pegasus/Common/Array.h>
#include <Pegasus/Common/Linkage.h>
#include <Pegasus/Common/Logger.h>
#include <Pegasus/Common/Network.h>
static Boolean isIPv6StackActive();
#endif
+ /**
+ Returns all interface addresses. Both ip4 and ip6 interface addresses
+ will be returned.
+ */
+ static Array<String> getInterfaceAddrs();
+
static Uint32 lookupPort(
const char * serviceName,
Uint32 defaultPort);
#endif /* PEGASUS_OS_AIX */
+Array<String> System::getInterfaceAddrs()
+{
+ Array<String> ips;
+
+#ifdef PEGASUS_ENABLE_IPV6
+
+#if defined(PEGASUS_HAS_GETIFADDRS)
+ struct ifaddrs *array, *addrs;
+ char buff[PEGASUS_INET6_ADDRSTR_LEN];
+
+ if (0 > getifaddrs(&array))
+ {
+ return ips;
+ }
+
+ for( addrs = array; addrs != NULL; addrs = addrs->ifa_next)
+ {
+ switch(addrs->ifa_addr->sa_family)
+ {
+ case AF_INET :
+ // Don't gather loop back addrs.
+ if (System::isLoopBack(AF_INET,
+ &((struct sockaddr_in *)addrs->ifa_addr)->sin_addr))
+ {
+ continue;
+ }
+ HostAddress::convertBinaryToText(AF_INET,
+ &((struct sockaddr_in *)addrs->ifa_addr)->sin_addr,
+ buff, sizeof(buff));
+ ips.append(buff);
+ break;
+ case AF_INET6 :
+ if (System::isLoopBack(AF_INET6,
+ &((struct sockaddr_in6 *)addrs->ifa_addr)->sin6_addr))
+ {
+ continue;
+ }
+ HostAddress::convertBinaryToText(AF_INET6,
+ &((struct sockaddr_in6 *)addrs->ifa_addr)->sin6_addr,
+ buff, sizeof(buff));
+ ips.append(buff);
+ break;
+ }
+ }
+ if(array)
+ {
+ freeifaddrs(array);
+ }
+#elif defined(PEGASUS_OS_AIX)
+//ATTN: implement for AIX
+#elif defined(PEGASUS_OS_ZOS)
+//ATTN: implement for ZOS
+#elif defined(PEGASUS_OS_HPUX)
+//ATTN: implement for HPUX
+#elif defined(PEGASUS_OS_VMS)
+//ATTN: implement for VMS
+#else
+//ATTN: implement for rest of UNIX flavors.
+#endif
+
+#endif // PEGASUS_ENABLE_IPV6
+
+ return ips;
+}
+
PEGASUS_NAMESPACE_END
// 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
wchar_t wcGroupName[UNLEN+1];
//Convert user name to unicode
- if (!MultiByteToWideChar(CP_ACP,0,userName, -1, wcUserName,
+ if (!MultiByteToWideChar(CP_ACP,0,userName, -1, wcUserName,
strlen(userName)+1))
{
return false;
}
-
+
//Convert group name to unicode
- if (!MultiByteToWideChar(CP_ACP, 0, groupName, -1, wcGroupName,
+ if (!MultiByteToWideChar(CP_ACP, 0, groupName, -1, wcGroupName,
strlen(groupName)+1))
{
return false;
// groups in which the user is indirectly a member.
//
nStatus = NetUserGetLocalGroups(
- NULL,
+ NULL,
(LPCWSTR)wcUserName,
dwLevel,
dwFlags,
(LPBYTE*)&pBuf,
dwPrefMaxLen,
&dwEntriesRead,
- &dwTotalEntries);
+ &dwTotalEntries);
//
// If the call succeeds,
// Not implemented
}
+#ifdef PEGASUS_ENABLE_IPV6
+void _getInterfaceAddrs(Array<String> &ips, int af)
+{
+ SOCKET sock;
+
+ if (INVALID_SOCKET != (sock = WSASocket(af, SOCK_RAW,
+ 0, NULL, 0, 0)))
+ {
+ DWORD bytesReturned;
+ char buf[2048];
+ int interfaces = 0;
+ char str[PEGASUS_INET6_ADDRSTR_LEN];
+ void *p;
+ if (0 == WSAIoctl(sock, SIO_ADDRESS_LIST_QUERY, NULL, 0,
+ buf, 2048, &bytesReturned, NULL,
+ NULL))
+ {
+
+ SOCKET_ADDRESS_LIST *addr_list;
+ SOCKET_ADDRESS *addr;
+ struct sockaddr *sin;
+ addr_list = (SOCKET_ADDRESS_LIST *)buf;
+ addr = addr_list->Address;
+ for (sin = (struct sockaddr *) addr->lpSockaddr ;
+ interfaces < addr_list->iAddressCount;
+ interfaces++)
+ {
+ if (af == AF_INET)
+ {
+ p = &((struct sockaddr_in*)sin)->sin_addr;
+ }
+ else
+ {
+ p = &((struct sockaddr_in6*)sin)->sin6_addr;
+ }
+ // Don't gather loopback addrs
+ if (!System::isLoopBack(af, p))
+ {
+ HostAddress::convertBinaryToText(af, p, str, sizeof(str));
+ ips.append(str);
+ }
+ addr++;
+ sin = (struct sockaddr*)addr->lpSockaddr;
+ }
+ }
+ }
+}
+#endif
+
+Array<String> System::getInterfaceAddrs()
+{
+ Array<String> ips;
+
+#ifdef PEGASUS_ENABLE_IPV6
+ _getInterfaceAddrs(ips, AF_INET);
+ _getInterfaceAddrs(ips, AF_INET6);
+#endif
+
+ return ips;
+}
// System ID constants for Logger::put and Logger::trace
#include <Pegasus/Common/Config.h>
+#include <Pegasus/Common/HostAddress.h>
#include <Pegasus/Common/PegasusVersion.h>
#include <cctype>
sprintf(buffer, "%u", portNumberHttp);
httpPort.assign(buffer);
}
- CIMInstance instance =
- buildCIMXMLCommunicationMechanismInstance(
+ CIMInstance instance;
+ Array<String> ips;
+#ifdef PEGASUS_ENABLE_IPV6
+ ips = System::getInterfaceAddrs();
+ for (Uint32 i = 0; i < ips.size() ; ++i)
+ {
+ String addr = ips[i];
+ if (HostAddress::isValidIPV6Address(ips[i]))
+ {
+ addr = "[" + addr + "]";
+ }
+ addr.append(":");
+ addr.append(httpPort);
+
+ instance =
+ buildCIMXMLCommunicationMechanismInstance(
+ namespaceType,
+ namespaceAccessProtocol,
+ addr,
+ commMechClass);
+ instances.append(instance);
+ }
+#endif
+ // If System::getInterfaceAddrs() fails add ip4 addr here.
+ if (!ips.size())
+ {
+ instance = buildCIMXMLCommunicationMechanismInstance(
namespaceType,
namespaceAccessProtocol,
getHostAddress(hostName, namespaceAccessProtocol, httpPort),
commMechClass);
- instances.append(instance);
+ instances.append(instance);
+ }
}
if (enableHttpsConnection)
sprintf(buffer, "%u", portNumberHttps);
httpsPort.assign(buffer);
}
- CIMInstance instance =
- buildCIMXMLCommunicationMechanismInstance(
+ CIMInstance instance;
+ Array<String> ips;
+#ifdef PEGASUS_ENABLE_IPV6
+ ips = System::getInterfaceAddrs();
+ for (Uint32 i = 0; i < ips.size() ; ++i)
+ {
+ String addr = ips[i];
+ if (HostAddress::isValidIPV6Address(ips[i]))
+ {
+ addr = "[" + addr + "]";
+ }
+ addr.append(":");
+ addr.append(httpsPort);
+ instance =
+ buildCIMXMLCommunicationMechanismInstance(
+ namespaceType,
+ namespaceAccessProtocol,
+ addr,
+ commMechClass);
+ instances.append(instance);
+ }
+#endif
+ // If System::getInterfaceAddrs() fails add ip4 addr here.
+ if (!ips.size())
+ {
+ instance = buildCIMXMLCommunicationMechanismInstance(
namespaceType,
namespaceAccessProtocol,
getHostAddress(hostName, namespaceAccessProtocol, httpsPort),
commMechClass);
-
- instances.append(instance);
+ instances.append(instance);
+ }
}
PEG_METHOD_EXIT();
#include <Pegasus/Common/Exception.h>
#include <Pegasus/Common/XmlWriter.h>
#include <Pegasus/Config/ConfigManager.h>
+#include <Pegasus/Common/HostLocator.h>
#include <Pegasus/Common/Tracer.h>
/* This is a test program for the Interop Control Provider.
// connecting to the cim server and then
// disconnecting.
CIMClient testClient;
- Uint32 ipAddressBreak = IPAddress.find(':');
- Uint32 portNumber = 5988;
- String ipaddress = IPAddress.subString(0,ipAddressBreak);
- String portString = IPAddress.subString(
- (ipAddressBreak + 1),
- (IPAddress.size() - ipAddressBreak));
-
- char* end = 0;
- CString portCString = portString.getCString();
- portNumber = strtol(portCString, &end, 10);
- if(!(end != 0 && *end == '\0'))
- {
- TERMINATE(
- "Invalid http port value in CIMXML Comm object " +
- portString);
- }
-
+ HostLocator locator(IPAddress);
+ Uint32 portNumber = locator.getPort();
+ String ipaddress = locator.getHost();
// Try to connect to the server.
try{
testClient.connect(ipaddress, portNumber,
catch(CIMException& e)
{
- TERMINATE(
+ // If node is not in real ip6 network it may fail.
+ // Failsafe for ip6 addrs.
+ if (locator.getAddressType() != HostAddress::AT_IPV6)
+ {
+ TERMINATE(
" Cim Exception Error Comm class IP Address: "
<< IPAddress << " " << e.getMessage());
+ }
}
catch(Exception& e)
{
- TERMINATE("Exception Error Comm class IP Address: "
+ // If node is not in real ip6 network it may fail.
+ // Failsafe for ip6 addrs.
+ if (locator.getAddressType() != HostAddress::AT_IPV6)
+ {
+ TERMINATE("Exception Error Comm class IP Address: "
<< IPAddress << " " << e.getMessage());
+ }
}
}
"DSA",
scopes,
FALSE,
- FALSE)))
+ FALSE,
+ 0)))
{
if (foundHttpProtocol &&
(!client->srv_reg_local(client,
"DSA",
scopes,
FALSE,
- FALSE)))
+ FALSE,
+ 0)))
{
if (foundHttpProtocol)
{
if(_initialized.get() && _library.isLoaded() && _create_client)
{
_rep = _create_client(
- "239.255.255.253",
+ 0,
0,
427,
"DSA",
"DEFAULT",
TRUE,
- FALSE);
+ FALSE,
+ "service:wbem");
}
}
unsigned short target_port,
const char *scopes,
Boolean listen,
- Boolean use_da)
+ Boolean use_da,
+ const char* srv_type)
: _listen_thread(service_listener, this, false),
_initialized(0)
{
"DSA",
"scopes",
listen,
- use_da);
+ use_da,
+ srv_type);
}
}
const char*,
const char*,
BOOL,
- BOOL))
+ BOOL,
+ const char*))
_library.getSymbol("create_slp_client");
_destroy_client = (void (*)(struct slp_client *))
Uint32 now, msec;
System::getCurrentTime(now, msec);
// now register everything
-
for (slp_reg_table::Iterator i = agent->_internal_regs.start();
i ; i++)
{
unsigned short target_port,
const char *scopes,
Boolean listen,
- Boolean use_da);
+ Boolean use_da,
+ const char *srv_type);
~slp_service_agent();
/* svr_register registers one url. The parameters must exist.
const char *,
const char *,
BOOL,
- BOOL);
+ BOOL,
+ const char *);
void (*_destroy_client)(struct slp_client *);
#define SLP_LIB_IMPORT 1
#include "../slp_client/slp_client.h"
+#include "../slp_client/slp_utils.h"
static char *url, *scopes, *tags, *addr, *_interface;
static int16 port = 427, converge ;
"DSA",
scopes,
FALSE,
- dir_agent)))
+ dir_agent,
+ 0)))
{
-
- if (addr != NULL && inet_addr(addr) == inet_addr("127.0.0.1"))
+ if (slp_is_loop_back_addr(addr))
{
client->local_attr_req(client, url, scopes, tags);
}
}
else
{
- SOCKADDR_IN address;
- address.sin_port = htons(port);
- address.sin_family = AF_INET;
- if (addr != NULL)
+ if (!addr)
{
- address.sin_addr.s_addr = inet_addr(addr);
- client->unicast_attr_req(
- client,
- url,
- scopes,
- tags,
- &address);
+ client->converge_attr_req(client, url, scopes, tags);
}
else
{
- address.sin_addr.s_addr = _LSLP_MCAST;
- client->converge_attr_req(client, url, scopes, tags);
+#ifdef PEGASUS_ENABLE_IPV6
+ SOCKADDR_IN6 ip6;
+#endif
+ SOCKADDR_IN ip4;
+ void *target = 0;
+
+ if (slp_is_valid_ip4_addr(addr))
+ {
+ ip4.sin_port = htons(port);
+ ip4.sin_family = AF_INET;
+ ip4.sin_addr.s_addr = inet_addr(addr);
+ target = &ip4;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ memset(&ip6, 0, sizeof(ip6));
+ ip6.sin6_port = htons(port);
+ ip6.sin6_family = AF_INET6;
+ slp_pton(AF_INET6, addr, &ip6.sin6_addr);
+ target = &ip6;
+ }
+#endif
+ if(target)
+ {
+ client->unicast_attr_req(
+ client,
+ url,
+ scopes,
+ tags,
+ (SOCKADDR*)target);
+ }
}
- } /* end of request */
+ }
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
include $(ROOT)/mak/config.mak
-# Treat all the SOURCES as C source only
ifeq ($(OS_TYPE),windows)
-FLAGS += /TC
-endif
-ifeq ($(PEGASUS_PLATFORM),LINUX_IX86_GNU)
-FLAGS += -x c
+EXTRA_INCLUDES += -I./nt_includes
endif
+# Treat all the SOURCES as C source only
+#ifeq ($(OS_TYPE),windows)
+#FLAGS += /TC
+#endif
+#ifeq ($(PEGASUS_PLATFORM),LINUX_IX86_GNU)
+#FLAGS += -x c
+#endif
+
LIBRARY = pegslp_client
SOURCES = \
+ slp_utils.cpp \
slp_client.cpp \
lslp.cpp \
y_attr.cpp \
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//==============================================================================
+
+//NOCHKSRC
+
/*****************************************************************************
* Description: encode/decode attribute lists
*
* Original Author: Mike Day md@soft-hackle.net
* mdd@us.ibm.com
*
- * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/attr.y,v 1.4 2006/01/31 15:03:55 karl Exp $
+ * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/attr.y,v 1.4.46.1 2008/03/20 06:16:44 s.kodali Exp $
*
* Copyright (c) 2001 - 2003 IBM
* Copyright (c) 2000 - 2003 Michael Day
*****************************************************************************/
-
%{
#include "slp_client.h"
void attrerror(const char *, ...);
lslpAttrList attrHead =
{
- &attrHead, &attrHead, TRUE
+ &attrHead, &attrHead, TRUE, 0, 0, 0, 0, 0, 0
};
lslpAttrList inProcessAttr =
{
- &inProcessAttr, &inProcessAttr, TRUE
+ &inProcessAttr, &inProcessAttr, TRUE, 0, 0, 0, 0, 0, 0
};
lslpAttrList inProcessTag =
{
- &inProcessTag, &inProcessTag, TRUE
+ &inProcessTag, &inProcessTag, TRUE, 0, 0, 0, 0, 0, 0
};
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//==============================================================================
+
+//NOCHKSRC
+
/*****************************************************************************
* Description: encode/decode/eval LDAP Filters
*
/* need to free is available from the list heads below. */
/* listhead for reduced filters until the parser is finished */
- filterHead reducedFilters = { &reducedFilters, &reducedFilters, TRUE } ;
+ filterHead reducedFilters = { &reducedFilters, &reducedFilters, TRUE, FALSE};
int nesting_level;
%}
#define yyrestart attrrestart
#define yytext attrtext
+//NOCHKSRC
#line 19 "l_attr.c"
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_attr.cpp,v 1.10 2007/02/28 09:24:33 mreddy Exp $
+ * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_attr.cpp,v 1.10.12.1 2008/03/20 06:16:44 s.kodali Exp $
*/
#define FLEX_SCANNER
YY_DECL
{
register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
+ register char *yy_cp = NULL, *yy_bp = NULL;
register int yy_act;
#line 122 "attr.l"
#endif /* ifndef YY_NO_UNPUT */
+#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput()
#else
return c;
}
-
+#endif /* YY_NO_INPUT */
#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
}
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#define yyout filterout
#define yyrestart filterrestart
#define yytext filtertext
-
+//NOCHKSRC
#line 19 "l_filter.c"
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_filter.cpp,v 1.10 2007/02/28 09:23:34 mreddy Exp $
+ * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_filter.cpp,v 1.10.12.1 2008/03/20 06:16:44 s.kodali Exp $
*/
#define FLEX_SCANNER
* Original Author: Mike Day md@soft-hackle.net
* mdd@us.ibm.com
*
- * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_filter.cpp,v 1.10 2007/02/28 09:23:34 mreddy Exp $
+ * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_filter.cpp,v 1.10.12.1 2008/03/20 06:16:44 s.kodali Exp $
*
* Copyright (c) 2001 - 2003 IBM
* Copyright (c) 2000 - 2003 Michael Day
YY_DECL
{
register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
+ register char *yy_cp = NULL, *yy_bp = NULL;
register int yy_act;
#line 109 "filter.l"
#endif /* ifndef YY_NO_UNPUT */
+#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput()
#else
return c;
}
-
+#endif /* YY_NO_INPUT */
#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
}
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#define yyrestart urlrestart
#define yytext urltext
+//NOCHKSRC
+
#line 19 "l_url.c"
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_url.cpp,v 1.9 2007/02/28 09:16:46 mreddy Exp $
+ * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_url.cpp,v 1.9.12.1 2008/03/20 06:16:44 s.kodali Exp $
*/
#define FLEX_SCANNER
#define YY_NUM_RULES 24
#define YY_END_OF_BUFFER 25
-static yyconst short int yy_accept[177] =
+static yyconst short int yy_accept[292] =
{ 0,
21, 21, 3, 3, 0, 0, 0, 0, 25, 23,
17, 14, 16, 18, 21, 10, 19, 12, 9, 15,
- 11, 13, 24, 3, 2, 5, 24, 7, 6, 22,
- 23, 21, 1, 0, 0, 21, 19, 3, 5, 0,
- 0, 22, 0, 0, 21, 19, 5, 0, 0, 5,
- 4, 0, 21, 21, 19, 5, 0, 0, 0, 21,
- 21, 5, 0, 0, 0, 21, 21, 5, 0, 0,
- 0, 20, 21, 5, 0, 0, 0, 20, 5, 0,
- 0, 0, 20, 5, 0, 0, 0, 5, 0, 0,
- 0, 5, 0, 0, 0, 5, 0, 0, 0, 5,
-
- 0, 0, 0, 5, 0, 0, 0, 5, 0, 0,
- 0, 5, 0, 0, 0, 5, 0, 0, 0, 5,
- 0, 0, 0, 5, 0, 0, 0, 5, 0, 0,
- 0, 5, 0, 0, 0, 5, 0, 0, 0, 5,
- 0, 0, 0, 5, 0, 0, 0, 5, 0, 0,
- 0, 5, 0, 0, 0, 5, 0, 0, 0, 5,
- 0, 0, 0, 5, 0, 0, 0, 5, 0, 0,
- 8, 5, 0, 0, 0, 0
+ 11, 13, 23, 24, 3, 2, 24, 5, 24, 7,
+ 6, 22, 23, 21, 1, 0, 0, 21, 19, 23,
+ 0, 3, 0, 0, 5, 0, 0, 22, 0, 0,
+ 21, 19, 23, 0, 20, 0, 0, 0, 3, 0,
+ 5, 0, 0, 5, 4, 0, 21, 21, 19, 23,
+ 0, 0, 0, 0, 0, 20, 0, 0, 0, 0,
+ 0, 0, 5, 0, 0, 0, 21, 21, 23, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 5, 0, 0, 0, 21, 21,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 5, 0,
+ 0, 0, 20, 21, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 0, 0, 0, 20, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 5, 0, 0, 0, 20, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 5, 0,
+
+ 0, 0, 0, 0, 5, 0, 0, 0, 0, 0,
+ 5, 0, 0, 0, 5, 0, 0, 0, 5, 0,
+ 0, 0, 5, 0, 0, 0, 5, 0, 0, 0,
+ 5, 0, 0, 0, 5, 0, 0, 0, 5, 0,
+ 0, 0, 5, 0, 0, 0, 5, 0, 0, 0,
+ 5, 0, 0, 0, 5, 0, 0, 0, 5, 0,
+ 0, 0, 5, 0, 0, 0, 5, 0, 0, 0,
+ 5, 0, 0, 0, 5, 0, 0, 0, 5, 0,
+ 0, 0, 5, 0, 0, 8, 5, 0, 0, 0,
+ 0
+
} ;
static yyconst int yy_ec[256] =
1, 1, 2, 3, 3, 4, 5, 6, 2, 2,
2, 2, 7, 8, 9, 10, 11, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 13, 14, 3,
- 15, 3, 16, 17, 18, 12, 12, 12, 12, 12,
- 9, 9, 19, 9, 9, 9, 9, 9, 9, 20,
- 9, 9, 9, 21, 9, 9, 9, 22, 9, 9,
- 3, 3, 3, 3, 23, 3, 18, 12, 12, 12,
-
- 12, 12, 9, 9, 19, 9, 9, 9, 9, 9,
- 9, 20, 9, 9, 9, 21, 9, 9, 9, 22,
- 9, 9, 3, 3, 3, 23, 1, 1, 1, 1,
+ 15, 3, 16, 17, 18, 19, 19, 19, 19, 19,
+ 9, 9, 20, 9, 9, 9, 9, 9, 9, 21,
+ 9, 9, 9, 22, 9, 9, 9, 23, 9, 9,
+ 24, 3, 25, 3, 26, 3, 18, 19, 19, 19,
+
+ 19, 19, 9, 9, 20, 9, 9, 9, 9, 9,
+ 9, 21, 9, 9, 9, 22, 9, 9, 9, 23,
+ 9, 9, 3, 3, 3, 26, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
-static yyconst int yy_meta[24] =
+static yyconst int yy_meta[27] =
{ 0,
1, 2, 3, 4, 5, 6, 6, 7, 5, 5,
- 7, 5, 7, 6, 6, 7, 7, 5, 5, 5,
- 5, 5, 5
+ 7, 8, 9, 6, 6, 7, 7, 8, 8, 5,
+ 5, 5, 5, 3, 10, 5
} ;
-static yyconst short int yy_base[213] =
+static yyconst short int yy_base[347] =
{ 0,
- 0, 0, 23, 40, 57, 0, 419, 418, 418, 0,
- 421, 421, 421, 421, 80, 14, 103, 421, 421, 421,
- 421, 421, 421, 0, 421, 412, 17, 421, 421, 0,
- 0, 126, 421, 395, 395, 34, 37, 0, 409, 72,
- 74, 0, 402, 390, 77, 76, 406, 79, 81, 405,
- 421, 398, 84, 89, 98, 403, 99, 102, 118, 122,
- 397, 401, 121, 123, 125, 126, 130, 400, 133, 134,
- 135, 138, 394, 398, 142, 143, 145, 146, 397, 147,
- 150, 154, 0, 396, 155, 157, 158, 395, 159, 162,
- 166, 326, 167, 169, 170, 325, 171, 174, 314, 317,
-
- 178, 179, 181, 298, 182, 183, 186, 297, 190, 191,
- 193, 296, 194, 195, 198, 294, 202, 203, 205, 114,
- 206, 207, 210, 113, 214, 215, 217, 104, 218, 219,
- 222, 95, 226, 227, 229, 93, 230, 231, 234, 49,
- 238, 239, 241, 45, 242, 243, 246, 42, 250, 251,
- 32, 37, 253, 254, 255, 33, 258, 262, 263, 32,
- 265, 266, 267, 25, 270, 274, 275, 23, 277, 278,
- 421, 421, 279, 282, 286, 421, 304, 311, 318, 323,
- 327, 330, 334, 338, 340, 342, 344, 346, 348, 350,
- 352, 354, 356, 358, 360, 362, 364, 366, 368, 370,
-
- 372, 374, 376, 378, 380, 382, 384, 386, 388, 390,
- 392, 394
+ 0, 0, 26, 51, 76, 0, 784, 783, 768, 0,
+ 913, 913, 913, 913, 102, 20, 119, 913, 913, 913,
+ 913, 913, 127, 913, 0, 913, 754, 746, 29, 913,
+ 913, 0, 0, 0, 913, 728, 710, 51, 53, 135,
+ 717, 0, 19, 704, 711, 97, 123, 0, 689, 676,
+ 151, 131, 139, 159, 0, 20, 33, 167, 913, 36,
+ 688, 147, 155, 685, 913, 678, 163, 171, 175, 179,
+ 189, 93, 98, 119, 674, 913, 139, 205, 143, 107,
+ 163, 672, 678, 191, 193, 201, 221, 671, 171, 643,
+ 209, 124, 179, 209, 217, 231, 212, 642, 226, 236,
+
+ 229, 234, 237, 240, 648, 239, 248, 250, 252, 260,
+ 251, 262, 631, 240, 264, 260, 276, 265, 280, 281,
+ 284, 618, 274, 286, 284, 300, 296, 304, 610, 303,
+ 305, 308, 316, 592, 577, 319, 317, 319, 335, 326,
+ 324, 321, 331, 566, 551, 340, 333, 338, 354, 345,
+ 343, 357, 349, 540, 532, 359, 362, 370, 372, 373,
+ 514, 373, 375, 385, 384, 501, 389, 488, 379, 388,
+ 398, 393, 475, 467, 397, 401, 405, 0, 447, 415,
+ 410, 446, 0, 436, 420, 419, 436, 0, 431, 421,
+ 423, 431, 41, 416, 0, 48, 408, 0, 409, 433,
+
+ 435, 443, 409, 432, 365, 446, 448, 451, 340, 337,
+ 306, 456, 459, 294, 295, 461, 464, 469, 279, 472,
+ 474, 477, 227, 482, 485, 487, 221, 490, 495, 498,
+ 211, 500, 503, 508, 201, 511, 513, 516, 195, 521,
+ 524, 526, 190, 529, 534, 537, 157, 539, 542, 547,
+ 150, 550, 552, 555, 128, 560, 563, 565, 125, 568,
+ 573, 576, 108, 578, 581, 61, 52, 586, 589, 591,
+ 51, 594, 599, 602, 31, 604, 607, 612, 30, 615,
+ 617, 620, 23, 625, 628, 913, 913, 630, 633, 638,
+ 913, 657, 667, 677, 686, 687, 693, 700, 703, 710,
+
+ 711, 714, 717, 724, 725, 728, 731, 734, 737, 744,
+ 745, 748, 751, 754, 761, 762, 765, 768, 771, 778,
+ 779, 782, 789, 794, 799, 804, 809, 814, 819, 824,
+ 829, 834, 839, 844, 849, 854, 859, 864, 869, 874,
+ 879, 884, 889, 894, 899, 904
} ;
-static yyconst short int yy_def[213] =
+static yyconst short int yy_def[347] =
{ 0,
- 176, 1, 177, 177, 176, 5, 178, 178, 176, 179,
- 176, 176, 176, 176, 180, 176, 176, 176, 176, 176,
- 176, 176, 176, 181, 176, 182, 176, 176, 176, 183,
- 179, 180, 176, 176, 176, 32, 17, 181, 184, 176,
- 176, 183, 176, 176, 17, 17, 185, 176, 176, 182,
- 176, 176, 32, 45, 32, 186, 176, 176, 176, 32,
- 32, 187, 176, 176, 176, 32, 60, 188, 176, 176,
- 176, 32, 32, 189, 176, 176, 176, 32, 190, 176,
- 176, 176, 32, 191, 176, 176, 176, 192, 176, 176,
- 176, 193, 176, 176, 176, 194, 176, 176, 176, 195,
-
- 176, 176, 176, 196, 176, 176, 176, 197, 176, 176,
- 176, 198, 176, 176, 176, 199, 176, 176, 176, 200,
- 176, 176, 176, 201, 176, 176, 176, 202, 176, 176,
- 176, 203, 176, 176, 176, 204, 176, 176, 176, 205,
- 176, 176, 176, 206, 176, 176, 176, 207, 176, 176,
- 176, 208, 176, 176, 176, 209, 176, 176, 176, 210,
- 176, 176, 176, 211, 176, 176, 176, 212, 176, 176,
- 176, 176, 176, 176, 176, 0, 176, 176, 176, 176,
- 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
- 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
-
- 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
- 176, 176
+ 291, 1, 292, 292, 291, 5, 293, 293, 291, 294,
+ 291, 291, 291, 291, 291, 291, 15, 291, 291, 291,
+ 291, 291, 294, 291, 295, 291, 296, 297, 291, 291,
+ 291, 298, 294, 15, 291, 291, 291, 15, 17, 294,
+ 291, 295, 299, 291, 300, 291, 291, 298, 291, 291,
+ 17, 17, 40, 291, 294, 301, 302, 291, 291, 303,
+ 304, 291, 291, 297, 291, 291, 15, 51, 15, 40,
+ 291, 305, 71, 306, 291, 291, 307, 291, 308, 78,
+ 309, 291, 310, 291, 291, 291, 15, 15, 294, 291,
+ 71, 91, 311, 312, 291, 291, 291, 291, 78, 99,
+
+ 313, 314, 291, 291, 315, 291, 291, 291, 15, 87,
+ 291, 91, 112, 316, 291, 317, 291, 117, 291, 291,
+ 99, 121, 318, 291, 319, 291, 126, 291, 320, 291,
+ 291, 291, 15, 15, 291, 291, 291, 321, 291, 139,
+ 317, 117, 142, 291, 291, 291, 291, 322, 291, 149,
+ 319, 126, 152, 291, 323, 291, 291, 291, 15, 291,
+ 291, 321, 139, 163, 142, 165, 291, 291, 322, 149,
+ 170, 152, 172, 324, 291, 291, 291, 15, 291, 291,
+ 163, 181, 141, 291, 291, 170, 186, 151, 325, 291,
+ 291, 291, 291, 291, 162, 291, 291, 169, 326, 291,
+
+ 291, 291, 291, 291, 327, 291, 291, 291, 291, 291,
+ 328, 291, 291, 291, 329, 291, 291, 291, 330, 291,
+ 291, 291, 331, 291, 291, 291, 332, 291, 291, 291,
+ 333, 291, 291, 291, 334, 291, 291, 291, 335, 291,
+ 291, 291, 336, 291, 291, 291, 337, 291, 291, 291,
+ 338, 291, 291, 291, 339, 291, 291, 291, 340, 291,
+ 291, 291, 341, 291, 291, 291, 342, 291, 291, 291,
+ 343, 291, 291, 291, 344, 291, 291, 291, 345, 291,
+ 291, 291, 346, 291, 291, 291, 291, 291, 291, 291,
+ 0, 291, 291, 291, 291, 291, 291, 291, 291, 291,
+
+ 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
+ 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
+ 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
+ 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
+ 291, 291, 291, 291, 291, 291
} ;
-static yyconst short int yy_nxt[445] =
+static yyconst short int yy_nxt[940] =
{ 0,
10, 10, 10, 11, 10, 12, 13, 14, 15, 15,
- 16, 17, 18, 19, 20, 21, 22, 17, 15, 15,
- 15, 15, 10, 23, 33, 23, 23, 173, 41, 169,
- 23, 34, 35, 25, 41, 23, 165, 161, 23, 23,
- 23, 157, 23, 23, 155, 45, 153, 23, 46, 149,
- 25, 45, 23, 145, 46, 23, 23, 23, 23, 23,
- 26, 27, 23, 23, 23, 26, 26, 28, 26, 29,
- 23, 23, 23, 23, 26, 26, 26, 26, 26, 26,
- 31, 31, 31, 49, 31, 50, 53, 55, 54, 49,
- 58, 50, 39, 55, 54, 60, 58, 141, 39, 137,
-
- 61, 60, 31, 31, 31, 31, 61, 31, 133, 55,
- 64, 32, 36, 47, 37, 55, 64, 129, 125, 47,
- 37, 32, 32, 32, 32, 31, 31, 31, 31, 65,
- 31, 66, 70, 67, 56, 65, 71, 72, 70, 67,
- 56, 73, 71, 72, 76, 62, 77, 73, 31, 78,
- 76, 62, 77, 81, 68, 78, 82, 83, 86, 81,
- 68, 74, 82, 83, 86, 87, 90, 74, 79, 91,
- 94, 87, 90, 84, 79, 91, 94, 95, 98, 84,
- 88, 99, 102, 95, 98, 92, 88, 99, 102, 106,
- 96, 92, 107, 110, 100, 106, 96, 111, 107, 110,
-
- 100, 114, 104, 111, 115, 118, 108, 114, 104, 119,
- 115, 118, 108, 122, 112, 119, 123, 126, 116, 122,
- 112, 127, 123, 126, 116, 130, 120, 127, 131, 134,
- 124, 130, 120, 135, 131, 134, 124, 138, 128, 135,
- 139, 142, 132, 138, 128, 143, 139, 142, 132, 146,
- 136, 143, 147, 150, 140, 146, 136, 151, 147, 150,
- 140, 154, 144, 151, 158, 148, 159, 154, 144, 162,
- 158, 148, 159, 152, 163, 162, 166, 156, 167, 152,
- 163, 170, 166, 156, 167, 160, 171, 170, 174, 164,
- 175, 160, 171, 168, 174, 164, 175, 172, 121, 168,
-
- 117, 113, 109, 172, 24, 24, 24, 24, 24, 24,
- 24, 30, 30, 30, 30, 30, 30, 30, 31, 31,
- 31, 105, 31, 32, 32, 32, 103, 32, 38, 101,
- 97, 38, 38, 39, 39, 42, 42, 42, 42, 42,
- 42, 47, 47, 56, 56, 62, 62, 68, 68, 74,
- 74, 79, 79, 84, 84, 88, 88, 92, 92, 96,
- 96, 100, 100, 104, 104, 108, 108, 112, 112, 116,
- 116, 120, 120, 124, 124, 128, 128, 132, 132, 136,
- 136, 140, 140, 144, 144, 148, 148, 152, 152, 156,
- 156, 160, 160, 164, 164, 168, 168, 172, 172, 93,
-
- 89, 85, 80, 66, 75, 69, 53, 63, 59, 40,
- 57, 52, 51, 48, 44, 43, 40, 176, 23, 23,
- 9, 176, 176, 176, 176, 176, 176, 176, 176, 176,
- 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
- 176, 176, 176, 176
+ 16, 17, 18, 19, 20, 21, 22, 17, 17, 15,
+ 15, 15, 15, 23, 10, 10, 24, 288, 24, 24,
+ 35, 58, 75, 24, 284, 280, 26, 36, 24, 37,
+ 47, 24, 24, 59, 76, 58, 47, 47, 82, 27,
+ 24, 24, 203, 24, 24, 276, 272, 59, 24, 204,
+ 59, 26, 51, 24, 52, 76, 24, 24, 51, 51,
+ 52, 52, 59, 270, 27, 24, 24, 24, 24, 28,
+ 29, 24, 24, 24, 28, 28, 30, 28, 31, 24,
+ 24, 24, 24, 28, 28, 28, 28, 28, 28, 24,
+
+ 24, 28, 33, 33, 33, 75, 33, 291, 63, 92,
+ 34, 34, 268, 34, 63, 63, 291, 76, 100, 34,
+ 34, 34, 34, 34, 34, 33, 33, 33, 38, 264,
+ 39, 95, 260, 291, 64, 113, 39, 39, 40, 41,
+ 64, 64, 69, 76, 40, 40, 53, 54, 69, 69,
+ 70, 58, 53, 53, 256, 82, 70, 70, 85, 55,
+ 67, 252, 68, 59, 85, 85, 45, 59, 68, 68,
+ 71, 72, 45, 45, 87, 103, 73, 73, 78, 79,
+ 87, 87, 88, 54, 80, 80, 69, 59, 88, 88,
+ 89, 115, 69, 69, 248, 55, 89, 89, 90, 244,
+
+ 91, 54, 107, 76, 61, 240, 92, 92, 107, 107,
+ 61, 61, 108, 76, 98, 236, 99, 58, 108, 108,
+ 112, 95, 100, 100, 58, 232, 113, 113, 117, 59,
+ 109, 228, 110, 76, 118, 118, 59, 121, 110, 110,
+ 90, 124, 119, 122, 122, 291, 103, 122, 126, 98,
+ 131, 128, 115, 59, 127, 127, 131, 131, 59, 83,
+ 135, 132, 136, 133, 76, 83, 83, 132, 132, 133,
+ 133, 134, 95, 137, 291, 139, 143, 134, 134, 137,
+ 137, 140, 140, 224, 76, 90, 124, 142, 95, 90,
+ 145, 144, 146, 143, 143, 147, 103, 149, 59, 220,
+
+ 76, 147, 147, 150, 150, 291, 218, 153, 59, 98,
+ 216, 152, 103, 98, 157, 154, 105, 153, 153, 158,
+ 157, 157, 105, 105, 59, 158, 158, 159, 135, 54,
+ 161, 115, 165, 159, 159, 291, 95, 164, 166, 166,
+ 291, 76, 166, 76, 90, 58, 163, 115, 76, 145,
+ 124, 168, 164, 164, 291, 103, 171, 59, 291, 76,
+ 173, 59, 59, 98, 76, 170, 124, 59, 172, 212,
+ 176, 171, 171, 129, 173, 173, 176, 176, 59, 129,
+ 129, 177, 179, 178, 180, 115, 181, 177, 177, 178,
+ 178, 124, 182, 182, 291, 183, 182, 76, 184, 186,
+
+ 185, 183, 183, 59, 188, 187, 187, 291, 191, 187,
+ 188, 188, 155, 206, 191, 191, 192, 184, 155, 155,
+ 209, 195, 192, 192, 179, 179, 194, 195, 195, 184,
+ 198, 197, 201, 76, 174, 200, 198, 198, 201, 201,
+ 174, 174, 202, 210, 207, 291, 189, 196, 202, 202,
+ 207, 207, 189, 189, 208, 291, 59, 213, 193, 199,
+ 208, 208, 214, 213, 213, 199, 199, 217, 214, 214,
+ 205, 190, 221, 217, 217, 211, 205, 205, 221, 221,
+ 222, 211, 211, 225, 291, 215, 222, 222, 226, 225,
+ 225, 215, 215, 229, 226, 226, 219, 145, 230, 229,
+
+ 229, 233, 219, 219, 230, 230, 223, 233, 233, 234,
+ 291, 237, 223, 223, 227, 234, 234, 237, 237, 238,
+ 227, 227, 241, 135, 231, 238, 238, 242, 241, 241,
+ 231, 231, 245, 242, 242, 235, 175, 246, 245, 245,
+ 249, 235, 235, 246, 246, 239, 249, 249, 250, 98,
+ 253, 239, 239, 243, 250, 250, 253, 253, 254, 243,
+ 243, 257, 167, 247, 254, 254, 258, 257, 257, 247,
+ 247, 261, 258, 258, 251, 90, 262, 261, 261, 265,
+ 251, 251, 262, 262, 255, 265, 265, 266, 160, 269,
+ 255, 255, 259, 266, 266, 269, 269, 273, 259, 259,
+
+ 263, 109, 274, 273, 273, 277, 263, 263, 274, 274,
+ 267, 277, 277, 278, 156, 281, 267, 267, 271, 278,
+ 278, 281, 281, 282, 271, 271, 285, 291, 275, 282,
+ 282, 286, 285, 285, 275, 275, 289, 286, 286, 279,
+ 291, 290, 289, 289, 283, 279, 279, 290, 290, 287,
+ 283, 283, 130, 120, 111, 287, 287, 25, 25, 25,
+ 25, 25, 25, 25, 25, 25, 25, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 33, 33, 33,
+ 67, 33, 106, 104, 33, 96, 33, 42, 86, 46,
+ 42, 42, 84, 42, 43, 43, 45, 45, 66, 65,
+
+ 45, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 57, 57, 57, 61, 61, 62, 60, 61, 74, 74,
+ 74, 77, 77, 77, 81, 81, 81, 83, 83, 56,
+ 50, 83, 93, 93, 93, 94, 94, 94, 97, 97,
+ 97, 101, 101, 101, 102, 102, 102, 105, 105, 49,
+ 46, 105, 114, 114, 114, 116, 116, 116, 123, 123,
+ 123, 125, 125, 125, 129, 129, 44, 291, 129, 138,
+ 138, 138, 141, 141, 141, 148, 148, 148, 151, 151,
+ 151, 155, 155, 24, 24, 155, 162, 162, 162, 169,
+ 169, 169, 174, 174, 291, 291, 174, 189, 189, 291,
+
+ 291, 189, 199, 199, 291, 291, 199, 205, 205, 291,
+ 291, 205, 211, 211, 291, 291, 211, 215, 215, 291,
+ 291, 215, 219, 219, 291, 291, 219, 223, 223, 291,
+ 291, 223, 227, 227, 291, 291, 227, 231, 231, 291,
+ 291, 231, 235, 235, 291, 291, 235, 239, 239, 291,
+ 291, 239, 243, 243, 291, 291, 243, 247, 247, 291,
+ 291, 247, 251, 251, 291, 291, 251, 255, 255, 291,
+ 291, 255, 259, 259, 291, 291, 259, 263, 263, 291,
+ 291, 263, 267, 267, 291, 291, 267, 271, 271, 291,
+ 291, 271, 275, 275, 291, 291, 275, 279, 279, 291,
+
+ 291, 279, 283, 283, 291, 291, 283, 287, 287, 291,
+ 291, 287, 9, 291, 291, 291, 291, 291, 291, 291,
+ 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
+ 291, 291, 291, 291, 291, 291, 291, 291, 291
} ;
-static yyconst short int yy_chk[445] =
+static yyconst short int yy_chk[940] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 3, 16, 3, 3, 168, 27, 164,
- 3, 16, 16, 3, 27, 3, 160, 156, 3, 3,
- 4, 152, 4, 4, 151, 36, 148, 4, 37, 144,
- 4, 36, 4, 140, 37, 4, 4, 5, 5, 5,
+ 1, 1, 1, 1, 1, 1, 3, 283, 3, 3,
+ 16, 43, 56, 3, 279, 275, 3, 16, 3, 16,
+ 29, 3, 3, 43, 56, 57, 29, 29, 60, 3,
+ 3, 4, 193, 4, 4, 271, 267, 57, 4, 196,
+ 60, 4, 38, 4, 39, 193, 4, 4, 38, 38,
+ 39, 39, 196, 266, 4, 4, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 15, 15, 15, 40, 15, 41, 45, 46, 45, 40,
- 48, 41, 49, 46, 45, 53, 48, 136, 49, 132,
-
- 54, 53, 15, 17, 17, 17, 54, 17, 128, 55,
- 57, 17, 17, 58, 17, 55, 57, 124, 120, 58,
- 17, 17, 17, 17, 17, 17, 32, 32, 32, 59,
- 32, 60, 63, 60, 64, 59, 65, 66, 63, 60,
- 64, 67, 65, 66, 69, 70, 71, 67, 32, 72,
- 69, 70, 71, 75, 76, 72, 77, 78, 80, 75,
- 76, 81, 77, 78, 80, 82, 85, 81, 86, 87,
- 89, 82, 85, 90, 86, 87, 89, 91, 93, 90,
- 94, 95, 97, 91, 93, 98, 94, 95, 97, 101,
- 102, 98, 103, 105, 106, 101, 102, 107, 103, 105,
-
- 106, 109, 110, 107, 111, 113, 114, 109, 110, 115,
- 111, 113, 114, 117, 118, 115, 119, 121, 122, 117,
- 118, 123, 119, 121, 122, 125, 126, 123, 127, 129,
- 130, 125, 126, 131, 127, 129, 130, 133, 134, 131,
- 135, 137, 138, 133, 134, 139, 135, 137, 138, 141,
- 142, 139, 143, 145, 146, 141, 142, 147, 143, 145,
- 146, 149, 150, 147, 153, 154, 155, 149, 150, 157,
- 153, 154, 155, 158, 159, 157, 161, 162, 163, 158,
- 159, 165, 161, 162, 163, 166, 167, 165, 169, 170,
- 173, 166, 167, 174, 169, 170, 173, 175, 116, 174,
-
- 112, 108, 104, 175, 177, 177, 177, 177, 177, 177,
- 177, 178, 178, 178, 178, 178, 178, 178, 179, 179,
- 179, 100, 179, 180, 180, 180, 99, 180, 181, 96,
- 92, 181, 181, 182, 182, 183, 183, 183, 183, 183,
- 183, 184, 184, 185, 185, 186, 186, 187, 187, 188,
- 188, 189, 189, 190, 190, 191, 191, 192, 192, 193,
- 193, 194, 194, 195, 195, 196, 196, 197, 197, 198,
- 198, 199, 199, 200, 200, 201, 201, 202, 202, 203,
- 203, 204, 204, 205, 205, 206, 206, 207, 207, 208,
- 208, 209, 209, 210, 210, 211, 211, 212, 212, 88,
-
- 84, 79, 74, 73, 68, 62, 61, 56, 52, 50,
- 47, 44, 43, 39, 35, 34, 26, 9, 8, 7,
- 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
- 176, 176, 176, 176, 176, 176, 176, 176, 176, 176,
- 176, 176, 176, 176
+
+ 5, 5, 15, 15, 15, 72, 15, 73, 46, 73,
+ 15, 15, 263, 15, 46, 46, 80, 72, 80, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 17, 259,
+ 17, 74, 255, 92, 47, 92, 17, 17, 23, 23,
+ 47, 47, 52, 74, 23, 23, 40, 40, 52, 52,
+ 53, 77, 40, 40, 251, 79, 53, 53, 62, 40,
+ 51, 247, 51, 77, 62, 62, 63, 79, 51, 51,
+ 54, 54, 63, 63, 67, 81, 54, 54, 58, 58,
+ 67, 67, 68, 89, 58, 58, 69, 81, 68, 68,
+ 70, 93, 69, 69, 243, 89, 70, 70, 71, 239,
+
+ 71, 71, 84, 93, 85, 235, 71, 71, 84, 84,
+ 85, 85, 86, 71, 78, 231, 78, 78, 86, 86,
+ 91, 94, 78, 78, 97, 227, 91, 91, 95, 78,
+ 87, 223, 87, 94, 95, 95, 97, 99, 87, 87,
+ 96, 101, 96, 99, 99, 100, 102, 100, 103, 104,
+ 106, 104, 114, 101, 103, 103, 106, 106, 102, 107,
+ 111, 108, 111, 109, 114, 107, 107, 108, 108, 109,
+ 109, 110, 116, 112, 118, 115, 118, 110, 110, 112,
+ 112, 115, 115, 219, 116, 117, 123, 117, 117, 119,
+ 120, 119, 120, 117, 117, 121, 125, 124, 123, 215,
+
+ 117, 121, 121, 124, 124, 127, 214, 127, 125, 126,
+ 211, 126, 126, 128, 130, 128, 131, 126, 126, 132,
+ 130, 130, 131, 131, 126, 132, 132, 133, 136, 137,
+ 136, 138, 142, 133, 133, 140, 141, 140, 142, 142,
+ 143, 137, 143, 138, 139, 147, 139, 139, 141, 146,
+ 148, 146, 139, 139, 150, 151, 150, 147, 153, 139,
+ 153, 210, 148, 149, 209, 149, 149, 151, 152, 205,
+ 156, 149, 149, 157, 152, 152, 156, 156, 149, 157,
+ 157, 158, 160, 159, 160, 162, 163, 158, 158, 159,
+ 159, 169, 163, 163, 164, 165, 164, 162, 167, 170,
+
+ 167, 165, 165, 169, 172, 170, 170, 171, 175, 171,
+ 172, 172, 176, 199, 175, 175, 177, 197, 176, 176,
+ 203, 181, 177, 177, 180, 194, 180, 181, 181, 185,
+ 186, 185, 190, 203, 191, 189, 186, 186, 190, 190,
+ 191, 191, 192, 204, 200, 187, 201, 184, 192, 192,
+ 200, 200, 201, 201, 202, 182, 204, 206, 179, 207,
+ 202, 202, 208, 206, 206, 207, 207, 212, 208, 208,
+ 213, 174, 216, 212, 212, 217, 213, 213, 216, 216,
+ 218, 217, 217, 220, 173, 221, 218, 218, 222, 220,
+ 220, 221, 221, 224, 222, 222, 225, 168, 226, 224,
+
+ 224, 228, 225, 225, 226, 226, 229, 228, 228, 230,
+ 166, 232, 229, 229, 233, 230, 230, 232, 232, 234,
+ 233, 233, 236, 161, 237, 234, 234, 238, 236, 236,
+ 237, 237, 240, 238, 238, 241, 155, 242, 240, 240,
+ 244, 241, 241, 242, 242, 245, 244, 244, 246, 154,
+ 248, 245, 245, 249, 246, 246, 248, 248, 250, 249,
+ 249, 252, 145, 253, 250, 250, 254, 252, 252, 253,
+ 253, 256, 254, 254, 257, 144, 258, 256, 256, 260,
+ 257, 257, 258, 258, 261, 260, 260, 262, 135, 264,
+ 261, 261, 265, 262, 262, 264, 264, 268, 265, 265,
+
+ 269, 134, 270, 268, 268, 272, 269, 269, 270, 270,
+ 273, 272, 272, 274, 129, 276, 273, 273, 277, 274,
+ 274, 276, 276, 278, 277, 277, 280, 122, 281, 278,
+ 278, 282, 280, 280, 281, 281, 284, 282, 282, 285,
+ 113, 288, 284, 284, 289, 285, 285, 288, 288, 290,
+ 289, 289, 105, 98, 90, 290, 290, 292, 292, 292,
+ 292, 292, 292, 292, 292, 292, 292, 293, 293, 293,
+ 293, 293, 293, 293, 293, 293, 293, 294, 294, 294,
+ 88, 294, 83, 82, 294, 75, 294, 295, 66, 64,
+ 295, 295, 61, 295, 296, 296, 297, 297, 50, 49,
+
+ 297, 298, 298, 298, 298, 298, 298, 298, 298, 298,
+ 299, 299, 299, 300, 300, 45, 44, 300, 301, 301,
+ 301, 302, 302, 302, 303, 303, 303, 304, 304, 41,
+ 37, 304, 305, 305, 305, 306, 306, 306, 307, 307,
+ 307, 308, 308, 308, 309, 309, 309, 310, 310, 36,
+ 28, 310, 311, 311, 311, 312, 312, 312, 313, 313,
+ 313, 314, 314, 314, 315, 315, 27, 9, 315, 316,
+ 316, 316, 317, 317, 317, 318, 318, 318, 319, 319,
+ 319, 320, 320, 8, 7, 320, 321, 321, 321, 322,
+ 322, 322, 323, 323, 0, 0, 323, 324, 324, 0,
+
+ 0, 324, 325, 325, 0, 0, 325, 326, 326, 0,
+ 0, 326, 327, 327, 0, 0, 327, 328, 328, 0,
+ 0, 328, 329, 329, 0, 0, 329, 330, 330, 0,
+ 0, 330, 331, 331, 0, 0, 331, 332, 332, 0,
+ 0, 332, 333, 333, 0, 0, 333, 334, 334, 0,
+ 0, 334, 335, 335, 0, 0, 335, 336, 336, 0,
+ 0, 336, 337, 337, 0, 0, 337, 338, 338, 0,
+ 0, 338, 339, 339, 0, 0, 339, 340, 340, 0,
+ 0, 340, 341, 341, 0, 0, 341, 342, 342, 0,
+ 0, 342, 343, 343, 0, 0, 343, 344, 344, 0,
+
+ 0, 344, 345, 345, 0, 0, 345, 346, 346, 0,
+ 0, 346, 291, 291, 291, 291, 291, 291, 291, 291,
+ 291, 291, 291, 291, 291, 291, 291, 291, 291, 291,
+ 291, 291, 291, 291, 291, 291, 291, 291, 291
} ;
static yy_state_type yy_last_accepting_state;
* Original Author: Mike Day md@soft-hackle.net
* mdd@us.ibm.com
*
- * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_url.cpp,v 1.9 2007/02/28 09:16:46 mreddy Exp $
+ * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/l_url.cpp,v 1.9.12.1 2008/03/20 06:16:44 s.kodali Exp $
*
* Copyright (c) 2001 - 2003 IBM
* Copyright (c) 2000 - 2003 Michael Day
*
*****************************************************************************/
#line 67 "url.l"
-
#undef YYLMAX
#define YYLMAX 2048
#define YY_NEVER_INTERACTIVE 1
size_t url_init_lexer(const char *s);
/* {} */
+/* IPv6 definitions */
#define IP_SITE 1
#define AT_SITE 2
#define ATTRIBUTE 3
-#line 640 "l_url.c"
+#line 791 "l_url.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
YY_DECL
{
register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
+ register char *yy_cp = NULL, *yy_bp = NULL;
register int yy_act;
-#line 114 "url.l"
+#line 122 "url.l"
/* the ip user @ host syntax is a special state because some reserved */
/* characters are valid - but user the string itself is optional so we can't */
/* build it into a full-time rule */
-#line 798 "l_url.c"
+#line 949 "l_url.c"
if ( yy_init )
{
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 177 )
+ if ( yy_current_state >= 292 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 421 );
+ while ( yy_base[yy_current_state] != 913 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
case 1:
YY_RULE_SETUP
-#line 120 "url.l"
+#line 128 "url.l"
{
BEGIN IP_SITE;
urlless(0);
/* return the slash as a token */
case 2:
YY_RULE_SETUP
-#line 125 "url.l"
+#line 133 "url.l"
{urllval._i = *urltext; return(urllval._i);}
YY_BREAK
/* this next rule needs to kick in even if it matches a zero-length string */
/* i.e., it needs to be guaranteed even if there is no user @ host production */
case 3:
YY_RULE_SETUP
-#line 129 "url.l"
+#line 137 "url.l"
{
BEGIN INITIAL;
if (urlleng > 0)
/* chars as tokens. */
case 4:
YY_RULE_SETUP
-#line 144 "url.l"
+#line 152 "url.l"
{
BEGIN AT_SITE;
if(NULL != (urllval._s = _lslp_strdup(urltext)))
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 152 "url.l"
+#line 160 "url.l"
{
atalk_state++;
if (atalk_state == 3)
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 162 "url.l"
+#line 170 "url.l"
{urllval._i = *urltext; return(urllval._i);}
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 163 "url.l"
+#line 171 "url.l"
{BEGIN INITIAL; urlless(0);}
YY_BREAK
/* ipx syntax includes two reserved characters - give the lexer a chance */
/* as tokens */
case 8:
YY_RULE_SETUP
-#line 169 "url.l"
+#line 177 "url.l"
{
if(NULL != (urllval._s = _lslp_strdup(urltext)))
return(_IPX);
/* one of the productions above */
case 9:
YY_RULE_SETUP
-#line 178 "url.l"
+#line 186 "url.l"
{BEGIN ATTRIBUTE; urllval._i = *urltext; return(urllval._i);}
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 179 "url.l"
+#line 187 "url.l"
{urllval._i = *urltext; return(urllval._i);}
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 180 "url.l"
+#line 188 "url.l"
{urllval._i = *urltext; return(urllval._i);}
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 181 "url.l"
+#line 189 "url.l"
{urllval._i = *urltext; return(urllval._i);}
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 182 "url.l"
+#line 190 "url.l"
{urllval._i = *urltext; return(urllval._i);}
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 183 "url.l"
+#line 191 "url.l"
{urllval._i = *urltext; return(urllval._i);}
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 184 "url.l"
+#line 192 "url.l"
{urllval._i = *urltext; return(urllval._i);}
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 185 "url.l"
+#line 193 "url.l"
{urllval._i = *urltext; return(urllval._i);}
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 186 "url.l"
+#line 194 "url.l"
{urllval._i = *urltext; return(urllval._i);}
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 187 "url.l"
+#line 195 "url.l"
{urllval._i = *urltext; return(urllval._i);}
YY_BREAK
/* a string consisting of only hex digits */
case 19:
YY_RULE_SETUP
-#line 190 "url.l"
+#line 198 "url.l"
{
if(NULL != (urllval._s = _lslp_strdup(urltext)))
return(_HEXDIG);
/* an ipv4 address */
case 20:
YY_RULE_SETUP
-#line 198 "url.l"
+#line 206 "url.l"
{
if(NULL != (urllval._s = _lslp_strdup(urltext)))
return(_IPADDR);
/* but '+' is reserved and must be escaped */
case 21:
YY_RULE_SETUP
-#line 207 "url.l"
+#line 215 "url.l"
{
if(NULL != (urllval._s = _lslp_strdup(urltext)))
return(_RESNAME);
/* anything else that is not reserved */
case 22:
YY_RULE_SETUP
-#line 216 "url.l"
+#line 224 "url.l"
{
BEGIN INITIAL;
if(NULL != (urllval._s = _lslp_strdup(urltext)))
/* anything else that is not reserved */
case 23:
YY_RULE_SETUP
-#line 225 "url.l"
+#line 233 "url.l"
{
if(NULL != (urllval._s = _lslp_strdup(urltext)))
return(_ELEMENT);
/* anything else is an error */
case 24:
YY_RULE_SETUP
-#line 234 "url.l"
+#line 242 "url.l"
ECHO;
YY_BREAK
-#line 1076 "l_url.c"
+#line 1227 "l_url.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(IP_SITE):
case YY_STATE_EOF(AT_SITE):
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 177 )
+ if ( yy_current_state >= 292 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 177 )
+ if ( yy_current_state >= 292 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 176);
+ yy_is_jam = (yy_current_state == 291);
return yy_is_jam ? 0 : yy_current_state;
}
#endif /* ifndef YY_NO_UNPUT */
+#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput()
#else
return c;
}
-
+#endif /* YY_NO_INPUT */
#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
}
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
return 0;
}
#endif
-#line 234 "url.l"
+#line 242 "url.l"
--- /dev/null
+//%2006////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// 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 was added since flex on windows expects to find a file called
+** <unistd.h>. It doesn't seem to care what is in it though.
+*/
+
/* << Mon Sep 16 14:00:36 2002 mdd >> */
#include "slp_client.h"
+#include "slp_utils.h"
#if (__cplusplus)
#include <cassert>
/***************** #define SLP_CLIENT_DEBUG 1 *********************/
+//#define SLP_CLIENT_DEBUG 1
#ifdef SLP_CLIENT_DEBUG
return NULL;
}
-
void free_da_list_members(struct da_list *da)
{
PEGASUS_ASSERT( ! _LSLP_IS_HEAD(da));
free(da);
}
-
-/* DOES NOT free the list head ! */
-void free_da_list(struct da_list *list)
-{
- struct da_list *temp;
- PEGASUS_ASSERT(_LSLP_IS_HEAD(list));
- temp = list->next;
- while (! _LSLP_IS_HEAD(temp))
- {
- _LSLP_UNLINK(temp);
- free_da_list_node(temp);
- temp = list->next;
- }
-}
-
-struct rply_list *alloc_rply_list(BOOL head)
-{
- struct rply_list *node =
- (struct rply_list *)calloc(1, sizeof(struct rply_list));
-
- if (node != NULL && head == TRUE)
- {
- node->isHead = TRUE;
- node->next = node->prev = node;
- }
- return node;
-}
-
-
-struct rply_list *rpl_node_exists(struct rply_list *head, const void *key)
-{
- if (head != NULL && _LSLP_IS_HEAD(head) && key != NULL)
- {
- struct rply_list *temp = head->next;
- while (! _LSLP_IS_HEAD(temp))
- {
- if (! strcmp(temp->url, (const char *)key))
- {
- return temp;
- }
- temp = temp->next;
- }
- }
- return NULL;
-}
-
-void free_rply_list_members(struct rply_list *rply)
-{
- PEGASUS_ASSERT(! _LSLP_IS_HEAD(rply));
- if (rply->url != NULL)
- {
- free(rply->url);
- }
- if (rply->auth != NULL)
- {
- free(rply->auth);
- }
-}
-
-void free_rply_list_node(struct rply_list *rply)
-{
- PEGASUS_ASSERT(! _LSLP_IS_HEAD(rply));
- free_rply_list_members(rply);
- free(rply);
-}
-
-/* DOES NOT free the list head ! */
-void free_rply_list(struct rply_list *list)
-{
- struct rply_list *temp;
- PEGASUS_ASSERT(_LSLP_IS_HEAD(list));
- temp = list->next;
- while (! _LSLP_IS_HEAD(temp))
- {
- _LSLP_UNLINK(temp);
- free_rply_list_node(temp);
- temp = list->next;
- }
-}
-
-struct reg_list *alloc_reg_list(BOOL head)
-{
- struct reg_list *node =
- (struct reg_list *)calloc(1,sizeof(struct reg_list));
- if (node != NULL && head == TRUE)
- {
- node->isHead = TRUE;
- node->next = node->prev = node;
- }
- return node;
-}
-
-struct reg_list *reg_node_exists(struct reg_list *head, const void *key)
-{
- if (head != NULL && _LSLP_IS_HEAD(head) && key != NULL)
- {
- struct reg_list *temp = head->next;
- while (! _LSLP_IS_HEAD(temp))
- {
- if (! strcmp(temp->url, (const char *)key))
- {
- return temp;
- }
- temp = temp->next;
- }
- }
- return NULL;
-}
-
-void free_reg_list_members(struct reg_list *reg)
-{
- PEGASUS_ASSERT(! _LSLP_IS_HEAD(reg));
- if (reg->url != NULL)
- {
- free(reg->url);
- }
- if (reg->attributes != NULL)
- {
- free(reg->attributes);
- }
- if (reg->service_type != NULL)
- {
- free(reg->service_type);
- }
- if (reg->scopes != NULL)
- {
- free(reg->scopes);
- }
-}
-
-void free_reg_list_node(struct reg_list *reg)
-{
- PEGASUS_ASSERT(! _LSLP_IS_HEAD(reg));
- free_reg_list_members(reg);
- free(reg);
-}
-
-/* DOES NOT free the list head ! */
-void free_reg_list(struct reg_list *list)
-{
- struct reg_list *temp;
- PEGASUS_ASSERT( _LSLP_IS_HEAD(list));
- temp = list->next;
- while (! _LSLP_IS_HEAD(temp))
- {
- _LSLP_UNLINK(temp);
- free_reg_list_node(temp);
- temp = list->next;
- }
-}
-
-struct url_entry *alloc_url_entry(BOOL head)
+/*
+ Checks the address type in URL based on addr family.
+*/
+BOOL _slp_check_url_addr(const char *url, int af, void *url_bin_addr)
{
- struct url_entry *node =
- (struct url_entry *)calloc(1, sizeof(struct url_entry));
+ char *p, *q, *r;
+ BOOL match = FALSE;
- if (node != NULL && head == TRUE)
- {
- node->isHead = TRUE;
- node->next = node->prev = node;
- }
- return node;
-}
-
-struct url_entry *url_node_exists(struct url_entry *head, const void *key)
-{
- if (head != NULL && _LSLP_IS_HEAD(head) && key != NULL)
+ if (!url || !(p = strdup(url)))
{
- struct url_entry *temp = head->next;
- while (! _LSLP_IS_HEAD(temp))
- {
- if (! strcmp(temp->url, (const char *)key))
- {
- return temp;
- }
- temp = temp->next;
- }
- }
- return NULL;
-}
-
-void free_url_entry_members(struct url_entry *url)
-{
- PEGASUS_ASSERT(! _LSLP_IS_HEAD(url));
- if (url->url != NULL)
- {
- free(url->url);
- }
- if (url->auth_blocks != NULL)
- {
- free(url->auth_blocks);
+ return FALSE;
}
-}
-
-void free_url_node(struct url_entry *node)
-{
- PEGASUS_ASSERT(! _LSLP_IS_HEAD(node));
- free_url_entry_members(node);
- free(node);
-}
-
-/* DOES NOT free the list head ! */
-void free_url_list(struct url_entry *list)
-{
- struct url_entry *temp;
- PEGASUS_ASSERT( _LSLP_IS_HEAD(list));
- temp = list->next;
- while (! _LSLP_IS_HEAD(temp))
- {
- _LSLP_UNLINK(temp);
- free_url_node(temp);
- temp = list->next;
+ r = p;
+ while (*p && *p != '/')
+ {
+ p++;
+ }
+ if (*p == '/' && *(p + 1) == '/')
+ {
+ p += 2;
+ q = p;
+ while(*p && *p != '/' && *p != ';' && *p != ']')
+ {
+ p++;
+ }
+ if (*q == '[' && *p == ']')
+ {
+ q++;
+ }
+ *p = 0;
+ if (af == AF_INET)
+ {
+ if ((match = slp_is_valid_ip4_addr(q)) && url_bin_addr)
+ {
+ slp_pton(AF_INET, q, &url_bin_addr);
+ }
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else if (af == AF_INET6)
+ {
+ if ((match = slp_is_valid_ip6_addr(q)) && url_bin_addr)
+ {
+ slp_pton(AF_INET6, q, &url_bin_addr);
+ }
+ }
+#endif
}
+ free(r);
+ return match;
}
#if defined(PEGASUS_PLATFORM_WIN64_IA64_MSVC) || \
#endif
-char *slp_get_addr_string_from_url(const char *url, char *addr, int addr_len)
+/*** effectively reallocates *list -- FREES MEMORY ***/
+static int _slp_get_local_interface(struct slp_if_addr **list, int af)
{
- char name[255];
- SOCKADDR_IN a;
-
- if (addr == NULL || addr_len < 1)
- {
- return NULL;
- }
-
- if (get_addr_from_url( url, &a, NULL))
- {
+ struct slp_if_addr *ifp;
#if defined(PEGASUS_PLATFORM_WIN64_IA64_MSVC) || \
defined(PEGASUS_PLATFORM_WIN64_X86_64_MSVC) || \
defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)
- _snprintf(
- name,
- 254,
- "%s:%d",
- inet_ntoa(a.sin_addr),
- ntohs(a.sin_port));
-#else //jeb
-# if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
- sprintf(name, "%s:%d", inet_ntoa(a.sin_addr), ntohs(a.sin_port));
-#else //jeb
- snprintf(name, 254, "%s:%d", inet_ntoa(a.sin_addr), ntohs(a.sin_port));
-# endif //end of PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
+ int errcode;
+ int buf_size = 256;
#endif
- memset(addr, 0x00, addr_len);
- strncpy(addr, name, addr_len - 1 );
- return addr;
- }
- return NULL;
-}
-
-char *slp_get_host_string_from_url(const char *url, char *host, int host_len)
-{
- char *s;
- SOCKADDR_IN addr;
-
- if (host == NULL || host_len < 1)
- {
- return NULL;
- }
-
- if (TRUE == get_addr_from_url(url, &addr, &s))
- {
- memset(host, 0x00, host_len);
- strncpy(host, s, host_len - 1);
- return host;
- }
-
- return NULL;
-}
-
-BOOL get_addr_from_url(const char *url, SOCKADDR_IN *addr, char **host)
-{
- char *bptr, *url_dup;
- BOOL ccode = FALSE;
+ SOCKETD sock;
+ int interfaces = 0;
- // isolate the host field
- bptr = (url_dup = strdup(url));
- if (bptr == NULL)
+ if (list == NULL)
{
- return( FALSE );
+ return 0;
}
- while ((*bptr != '/') && (*bptr != 0x00))
+ if (*list != NULL)
{
- bptr++;
+ free( *list );
}
+ *list = (struct slp_if_addr*)malloc(sizeof(struct slp_if_addr));
+ (*list)->af = AF_UNSPEC;
- if (*bptr == '/' && *(bptr + 1) == '/')
+#ifdef PEGASUS_ENABLE_IPV6
+ if (af == AF_INET6)
{
- char *endptr, *portptr;
- endptr = bptr + 2;
- while (*endptr != 0x00 && *endptr != '/' && *endptr != ';')
- {
- endptr++;
- }
- *endptr = 0x00;
- portptr = (endptr - 1);
-
- while ((portptr > ( bptr + 2 )) && (*portptr != ':'))
- {
- portptr--;
- }
-
- if (*portptr == ':')
- {
- *portptr = 0x00;
- portptr++;
- }
- else
+ if (!slp_is_ip6_stack_active())
{
- portptr = NULL;
- }
-
- // bptr points to the host name or address
- // portptr points to the port or is null
-
- bptr += 2;
-
- if (host != NULL)
- {
- *host = (char *)malloc(strlen(bptr) + strlen(portptr) + 3);
- strcpy(*host, bptr);
- strcat(*host, ":");
- strcat(*host, portptr);
- }
-
- if (portptr != NULL)
- {
- addr->sin_port = htons( (int16)strtoul(portptr, NULL, 0) );
- }
- else
- {
- addr->sin_port = 0x0000;
+ return 0;
}
-
- addr->sin_family = AF_INET;
- addr->sin_addr.s_addr = inet_addr(bptr);
-
- if (addr->sin_addr.s_addr == INADDR_NONE)
+#ifdef PEGASUS_HAS_GETIFADDRS
{
- struct hostent *host;
- struct hostent hostbuf;
- char *temp ;
- uint32 result;
- int err;
- size_t hostbuflen = 256;
-
- // hopefully a hostname because dotted decimal notation was invalid
- // look for the user@hostname production
- char *userptr;
- userptr = bptr;
- while ((*userptr != '\0' ) && (*userptr != '@' ))
- {
- userptr++;
- }
- if (*userptr == '@')
+ struct ifaddrs *array, *addrs;
+ if (0 > getifaddrs(&array))
{
- bptr = userptr + 1;
+ return 0;
}
-
- temp = (char *) malloc(hostbuflen);
-
- if (temp != NULL)
+ for( addrs = array; addrs != NULL; addrs = addrs->ifa_next)
{
- host = NULL;
- while (temp != NULL && (result = Gethostbyname_r(
- bptr,
- &hostbuf,
- temp,
- hostbuflen,
- &host, &err)) == ERANGE)
+ if(addrs->ifa_addr->sa_family == AF_INET6)
{
- hostbuflen *= 2;
- temp = (char *) realloc(temp, hostbuflen);
+ interfaces++;
}
- if (host != NULL)
+ }
+ free(*list);
+ *list = (struct slp_if_addr *)
+ calloc(interfaces + 2, sizeof(struct slp_if_addr));
+ ifp = *list;
+ for( addrs = array; addrs != NULL; addrs = addrs->ifa_next)
+ {
+ if(addrs->ifa_addr->sa_family == AF_INET6)
{
- struct in_addr *ptr;
- if (((ptr = (struct in_addr *)*(host->h_addr_list)) !=
- NULL))
- {
- addr->sin_addr.s_addr = ptr->s_addr;
- ccode = TRUE;
- }
+ ifp->af = AF_INET6;
+ ifp->ip6_addr =
+ ((struct sockaddr_in6 *)addrs->ifa_addr)->sin6_addr;
+ ifp++;
}
- free(temp);
- } /* we allocated the temp buffer for gethostbyname */
+ }
+ ifp->af = AF_UNSPEC;
}
- else
- {
- ccode = TRUE ;
- } /* host field is not in a valid dotted decimal form */
- } /* isolated the host field in the url */
- return(ccode);
-}
-
-
-/*** effectively reallocates *list -- FREES MEMORY ***/
-int slp_get_local_interfaces(uint32 **list)
-{
- SOCKETD sock; //jeb
- int interfaces = 0;
-#if defined(PEGASUS_PLATFORM_WIN64_IA64_MSVC) || \
- defined(PEGASUS_PLATFORM_WIN64_X86_64_MSVC) || \
- defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)
- int errcode;
- int buf_size = 256;
-#endif
- if (list == NULL)
- {
- return 0;
+#endif // PEGASUS_HAS_GETIFADDRS
+ return interfaces;
}
+#endif // PEGASUS_ENABLE_IPV6
- if (*list != NULL)
+ if (!slp_is_ip4_stack_active())
{
- free( *list );
+ return 0;
}
DEBUG_PRINT((DEBUG_ENTER, "slp_get_local_interfaces "));
defined(PEGASUS_PLATFORM_WIN64_X86_64_MSVC) || \
defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)
- if (INVALID_SOCKET != (sock = WSASocket(AF_INET, SOCK_RAW,
+ if (INVALID_SOCKET != (sock = WSASocket(af, SOCK_RAW,
0, NULL, 0, 0)))
{
int bytes_returned;
- char *output_buf = (char *)calloc(1, buf_size);
- if (output_buf == NULL)
- {
- DEBUG_PRINT((DEBUG_EXIT, "slp_get_local_interfaces:err "));
- return 0;
- }
+ char output_buf[2048];
if (0 == (errcode = WSAIoctl(sock, SIO_ADDRESS_LIST_QUERY, NULL, 0,
- output_buf, buf_size, &bytes_returned, NULL,
+ output_buf, buf_size, (LPDWORD)&bytes_returned, NULL,
NULL)))
{
SOCKET_ADDRESS_LIST *addr_list;
SOCKET_ADDRESS *addr;
- uint32 *intp;
- struct sockaddr_in *sin;
+ struct slp_if_addr *ifp;
+ SOCKADDR *sin;
+ void *p;
+
addr_list = (SOCKET_ADDRESS_LIST *)output_buf;
- *list = (uint32 *) malloc(
- sizeof(SOCKET_ADDRESS)* (addr_list->iAddressCount + 1));
+ free(*list);
+ *list = (struct slp_if_addr *) malloc(
+ sizeof(struct slp_if_addr)* (addr_list->iAddressCount + 1));
addr = addr_list->Address;
- for (interfaces = 0, intp = *list,
- sin = (struct sockaddr_in *) addr->lpSockaddr ;
+ for (interfaces = 0, ifp = *list,
+ sin = (SOCKADDR*) addr->lpSockaddr ;
interfaces < addr_list->iAddressCount;
- interfaces++ , intp++)
+ interfaces++ , ifp++)
{
- *intp = sin->sin_addr.s_addr;
+ if (af == AF_INET)
+ {
+ ifp->ip4_addr = ((struct sockaddr_in*)sin)->sin_addr;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ ifp->ip6_addr = ((struct sockaddr_in6*)sin)->sin6_addr;
+ }
+#endif
+ ifp->af = af;
addr++;
- sin = (struct sockaddr_in *)addr->lpSockaddr;
+ sin = (SOCKADDR*)addr->lpSockaddr;
}
- *intp = INADDR_ANY;
+ ifp->af = AF_UNSPEC; // list terminate
}
else
{
errcode = WSAGetLastError();
}
-
- free(output_buf);
_LSLP_CLOSESOCKET(sock);
}
if (-1 < (sock = _LSLP_SOCKET(AF_INET, SOCK_DGRAM, 0)))
{
struct ifconf conf;
- uint32 *this_addr;
+ struct slp_if_addr *this_addr;
int interface_counter;
conf.ifc_buf = (char *)calloc(128, sizeof(struct ifreq));
// now store the addresses
interface_counter = interfaces;
-
- *list = (uint32 *)calloc(interfaces + 2, sizeof(uint32));
+ free(*list);
+ *list = (struct slp_if_addr *)
+ calloc(interfaces + 2, sizeof(struct slp_if_addr));
this_addr = *list;
r = conf.ifc_req;
addr = (SOCKADDR_IN *)&r->ifr_addr;
while (interface_counter-- && addr->sin_addr.s_addr != 0)
{
- *this_addr = addr->sin_addr.s_addr;
+ this_addr->ip4_addr.s_addr = addr->sin_addr.s_addr;
+ this_addr->af = AF_INET;
r++;
this_addr++;
addr = (SOCKADDR_IN *)&r->ifr_addr;
}
- *this_addr = INADDR_ANY;
+ this_addr->af = AF_UNSPEC; // list terminate
} // did the ioctl
free(conf.ifc_buf);
_LSLP_CLOSESOCKET(sock);
} // opened the socket
#endif
- // failsafe if the ioctl doesn't work
- if (interfaces == 0)
- {
- *list = (uint32 *)malloc(sizeof(uint32)) ;
- *list[0] = INADDR_ANY;
- }
DEBUG_PRINT((DEBUG_EXIT, "slp_get_local_interfaces:ok "));
return(interfaces);
}
-BOOL slp_join_multicast(SOCKETD sock, uint32 addr) //jeb
+void slp_get_local_interfaces(struct slp_client *client)
{
+ _slp_get_local_interface(&client->_local_addr_list[0], AF_INET);
+#ifdef PEGASUS_ENABLE_IPV6
+ _slp_get_local_interface(&client->_local_addr_list[1], AF_INET6);
+#endif
+}
+BOOL slp_join_multicast(SOCKETD sock, struct slp_if_addr addr)
+{
+#ifdef PEGASUS_ENABLE_IPV6
+ struct ipv6_mreq group;
+ unsigned long hash;
+ char buff[PEGASUS_INET6_ADDRSTR_LEN];
+#endif
struct ip_mreq mreq;
DEBUG_PRINT((DEBUG_ENTER, "slp_join_multicast "));
+
// don't join on the loopback interface
- if (addr == inet_addr("127.0.0.1"))
+ if (addr.af == AF_INET)
{
- DEBUG_PRINT((DEBUG_EXIT, "slp_join_multicast:err2 "));
- return(FALSE);
+ if (!slp_is_ip4_stack_active() ||
+ slp_is_loop_back(AF_INET, &addr.ip4_addr))
+ {
+ DEBUG_PRINT((DEBUG_EXIT, "slp_join_multicast ip4:err2 "));
+ return(FALSE);
+ }
+ }
+ else
+ {
+#ifdef PEGASUS_ENABLE_IPV6
+ PEGASUS_ASSERT(addr.af == AF_INET6);
+ if (!slp_is_ip6_stack_active() ||
+ slp_is_loop_back(AF_INET6, &addr.ip6_addr))
+ {
+ DEBUG_PRINT((DEBUG_EXIT, "slp_join_multicast ip6:err2 "));
+ return(FALSE);
+ }
+#endif
}
- mreq.imr_multiaddr.s_addr = inet_addr("239.255.255.253");
- mreq.imr_interface.s_addr = addr;
+ if (addr.af == AF_INET)
+ {
+ // Join ip4 multicast adress for SVRLOC , SVRLOC-DA and Service
+ // location type.
+ mreq.imr_multiaddr.s_addr = inet_addr("239.255.255.253");
+ mreq.imr_interface.s_addr = addr.ip4_addr.s_addr;
- if (SOCKET_ERROR == setsockopt(sock,IPPROTO_IP, IP_ADD_MEMBERSHIP,
- (const char *)&mreq, sizeof(mreq)))
+ if (SOCKET_ERROR == setsockopt(sock,IPPROTO_IP, IP_ADD_MEMBERSHIP,
+ (const char *)&mreq, sizeof(mreq)))
+ {
+ DEBUG_PRINT((DEBUG_EXIT, "slp_join_multicast ip4:err3 "));
+ return(FALSE);
+ }
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
{
- DEBUG_PRINT((DEBUG_EXIT, "slp_join_multicast:err3 "));
- return(FALSE);
+ // Join multicast groups SVRLOC and SVRLOC-DA for ip6 interfaces.
+ // Refer RFC 3111.
+ group.ipv6mr_interface = 0; // default interface
+
+ // SVRLOC Link Local
+ slp_pton(AF_INET6, SLP_MC_LINK_SVRLOC, &group.ipv6mr_multiaddr);
+ setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
+ (char *)&group, sizeof(group));
+
+ // SVRLOC Site Local
+ slp_pton(AF_INET6, SLP_MC_SITE_SVRLOC, &group.ipv6mr_multiaddr);
+ setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
+ (char *)&group, sizeof(group));
+
+ // SVRLOC-DA Link Local
+ slp_pton(AF_INET6, SLP_MC_LINK_SVRLOC_DA, &group.ipv6mr_multiaddr);
+ setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
+ (char *)&group, sizeof(group));
+
+ // SVRLOC-DA Site Local
+ slp_pton(AF_INET6, SLP_MC_SITE_SVRLOC_DA, &group.ipv6mr_multiaddr);
+ setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
+ (char *)&group, sizeof(group));
}
+#endif
DEBUG_PRINT((DEBUG_EXIT, "slp_join_multicast:ok "));
return(TRUE); //jeb
}
-int slp_join_multicast_all(SOCKETD sock)
+#ifdef PEGASUS_ENABLE_IPV6
+void slp_join_ip6_service_type_multicast_group(struct slp_client *client,
+ const char *srv_type)
{
+ struct ipv6_mreq group;
+ unsigned long hash;
+ char buff[PEGASUS_INET6_ADDRSTR_LEN];
+ SOCKETD sock = client->_rcv_sock[1];
- uint32 *list = NULL , *lptr = NULL;
+ if (!srv_type || sock == INVALID_SOCKET)
+ {
+ return;
+ }
+ // Refer RFC 3111 sec 4.1 for computing the SLP service location hash
+ hash = 1000 + slp_hash(srv_type, (unsigned long)strlen(srv_type));
+
+ // Join on Link local scope
+ sprintf(buff,"FF02::1:%lu",hash);
+ slp_pton(AF_INET6, buff, &group.ipv6mr_multiaddr);
+ setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
+ (char *)&group, sizeof(group));
+
+ // Join on SITE Local scope
+ sprintf(buff,"FF05::1:%lu",hash);
+ slp_pton(AF_INET6, buff, &group.ipv6mr_multiaddr);
+ setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
+ (char *)&group, sizeof(group));
+
+}
+#endif
+
+int slp_join_multicast_all(SOCKETD sock, int af)
+{
+
+ struct slp_if_addr *list = NULL , *lptr = NULL;
int interface_counter;
- int num_interfaces = slp_get_local_interfaces(&list);
+ int num_interfaces = _slp_get_local_interface(&list, af);
DEBUG_PRINT((DEBUG_ENTER, "slp_join_multicast_all "));
interface_counter = num_interfaces;
lptr = list;
- while (interface_counter-- && *lptr != INADDR_ANY)
+ while (interface_counter-- && lptr->af != AF_UNSPEC)
{
slp_join_multicast(sock, *lptr);
lptr++;
return(num_interfaces);
}
-
-SOCKETD slp_open_listen_sock() //jeb
+/*
+ Creates and binds the socket based on address family.
+*/
+static int _slp_create_bind_socket(SOCKETD *sock, int af, int port,
+ void *addr, BOOL reuse)
{
- SOCKADDR_IN local;
- SOCKETD sock = _LSLP_SOCKET(AF_INET, SOCK_DGRAM, 0) ; //jeb
+#ifdef PEGASUS_ENABLE_IPV6
+ SOCKADDR_IN6 ip6;
+#endif
+ SOCKADDR_IN ip4;
int err = 1;
+ int brc = 0;
+
+ *sock = _LSLP_SOCKET(af, SOCK_DGRAM, 0);
+ DEBUG_PRINT((DEBUG_ENTER, "_slp_create_bind_socket"));
+
+ if (*sock == INVALID_SOCKET)
+ {
+ DEBUG_PRINT((DEBUG_EXIT, "_slp_create_bind_socket:err1"));
+ return -1;
+ }
+ if (reuse)
+ {
+ _LSLP_SETSOCKOPT(*sock, SOL_SOCKET, LSLP_REUSEADDR,
+ (const char *)&err, sizeof(err));
+ }
+
+ if (af == AF_INET)
+ {
+ ip4.sin_family = af;
+ ip4.sin_port = htons(port);
+ ip4.sin_addr.s_addr =
+ addr ? ((struct in_addr*)addr)->s_addr : INADDR_ANY;
+ brc = _LSLP_BIND(*sock, (struct sockaddr *)&ip4, sizeof(ip4));
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ PEGASUS_ASSERT(af == AF_INET6);
+ memset (&ip6, 0, sizeof(ip6));
+ ip6.sin6_family = af;
+ ip6.sin6_port = htons(port);
+ ip6.sin6_addr = addr ? *((struct in6_addr*)addr) : in6addr_any;
+ _LSLP_BIND(*sock, (struct sockaddr *)&ip6, sizeof(ip6));
+ }
+#endif
+
+ DEBUG_PRINT((DEBUG_EXIT, "_slp_create_bind_socket"));
+
+ return brc == SOCKET_ERROR ? -1 : 0;
+}
+
+static SOCKETD _slp_open_listen_sock(int af)
+{
+ SOCKETD sock = INVALID_SOCKET;
DEBUG_PRINT((DEBUG_ENTER, "slp_open_listen_sock "));
- _LSLP_SETSOCKOPT(sock, SOL_SOCKET, LSLP_REUSEADDR,
- (const char *)&err, sizeof(err));
- local.sin_family = AF_INET;
- local.sin_port = htons(427);
- local.sin_addr.s_addr = INADDR_ANY;
- if (0 == _LSLP_BIND(sock, (struct sockaddr *)&local, sizeof(local)))
+ if (_slp_create_bind_socket(&sock, af, 427, 0, TRUE) == 0)
{
- slp_join_multicast_all(sock);
+ slp_join_multicast_all(sock, af);
}
+
DEBUG_PRINT((DEBUG_EXIT, "slp_open_listen_sock "));
+
return(sock);
}
-
+void slp_open_listen_socks(struct slp_client *client)
+{
+ int i;
+ for (i = 0; i < 2; ++i)
+ {
+ if (client->_rcv_sock[i] != INVALID_SOCKET)
+ {
+ _LSLP_CLOSESOCKET(client->_rcv_sock[i]);
+ }
+ }
+
+ if (client->_ip4_stack_active)
+ {
+ client->_rcv_sock[0] = _slp_open_listen_sock(AF_INET);
+ }
+
+#ifdef PEGASUS_ENABLE_IPV6
+ if (client->_ip6_stack_active)
+ {
+ client->_rcv_sock[1] = _slp_open_listen_sock(AF_INET6);
+ }
+#endif
+}
+
void prepare_pr_buf(struct slp_client *client, const char *address)
{
if (address == NULL || client == NULL)
{
return;;
}
-
if (client->_pr_buf_len > LSLP_MTU)
{
printf("Memory allocation failed in file %s at Line number %d\n",
/** attn need to role change to getflags line into nucleus **/
void make_srv_ack(
struct slp_client *client,
- SOCKADDR_IN *remote,
+ SOCKADDR *remote,
char response,
int16 code)
{
char *bptr;
- uint32 local_address;
+ struct slp_if_addr local_address;
+ size_t addr_len;
+ int idx;
+
if (TRUE == ( ((_LSLP_GETFLAGS( client->_rcv_buf )) &
(LSLP_FLAGS_MCAST) ) ? FALSE : TRUE ))
{
_LSLP_SETSHORT(bptr, code, 0 );
bptr += 2;
_LSLP_SETLENGTH(client->_msg_buf, bptr - client->_msg_buf);
- local_address = client->_local_addr;
-#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
- uint32* ptr_addr;
- ptr_addr = client->_local_addr_list;
- while (*ptr_addr != INADDR_ANY)
+ if (remote->sa_family == AF_INET)
+ {
+ addr_len = sizeof(SOCKADDR_IN);
+ idx = 0;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ addr_len = sizeof(SOCKADDR_IN6);
+ idx = 1;
+ }
+#endif
+ if (client->_local_addr_any)
+ {
+ local_address.af = remote->sa_family;
+ if (local_address.af == AF_INET)
+ {
+ local_address.ip4_addr.s_addr = INADDR_ANY;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ local_address.ip6_addr = in6addr_any;
+ }
+#endif
+ }
+ else
+ {
+ local_address = client->_local_addr;
+ }
+
+#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
+ struct slp_if_addr* ptr_addr;
+ ptr_addr = client->_local_addr_list[idx];
+ while (ptr_addr->af != AF_UNSPEC)
{
local_address = *ptr_addr;
#endif
- if (INVALID_SOCKET !=
- (sock = _LSLP_SOCKET(AF_INET, SOCK_DGRAM, 0)))
+ if (-1 != _slp_create_bind_socket(&sock, local_address.af, 427,
+ &local_address.ip4_addr, TRUE))
{
- SOCKADDR_IN local;
- int err = 1;
- _LSLP_SETSOCKOPT(sock, SOL_SOCKET, LSLP_REUSEADDR,
- (const char *)&err, sizeof(err) );
- local.sin_family = AF_INET;
- local.sin_port = client->_target_port;
- local.sin_addr.s_addr = local_address;
- if (SOCKET_ERROR != _LSLP_BIND(sock, &local, sizeof(local)))
- {
- _LSLP_SENDTO(sock, client->_msg_buf,
- _LSLP_GETLENGTH(client->_msg_buf), 0,
- remote, sizeof(SOCKADDR_IN ));
- } // successfully bound this socket
- _LSLP_CLOSESOCKET(sock);
- } // successfully opened this socket
+ _LSLP_SENDTO(sock, client->_msg_buf,
+ _LSLP_GETLENGTH(client->_msg_buf), 0,
+ remote, addr_len);
+ }
+ _LSLP_CLOSESOCKET(sock);
#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
ptr_addr++;
} // end of while loop around all local network interfaces
}
-void set_separators(struct slp_client *client, char fs, char rs)
-{
- client->_fs = fs;
- client->_rs = rs;
- client->_use_separators = TRUE;
-}
-
-
lslpMsg *get_response( struct slp_client *client, lslpMsg *head)
{
PEGASUS_ASSERT(head != NULL && _LSLP_IS_HEAD(head));
return(head);
}
+/*
+ Sets the local interface address in the client which is used to bind the
+ local socket while sending the UDP datagrams.
+*/
+static void _slp_set_local_addr(struct slp_client *client, int af)
+{
+ if (client->_local_addr_any)
+ {
+ client->_local_addr.af = af;
+ if (af == AF_INET)
+ {
+ client->_local_addr.ip4_addr.s_addr = INADDR_ANY;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ client->_local_addr.ip6_addr = in6addr_any;
+ }
+#endif
+ }
+}
-int find_das(
- struct slp_client *client,
- const char *predicate,
- const char *scopes)
+/*
+ Checks where we can converge/local-try the request by taking the address
+ family and target address.
+*/
+static BOOL _slp_can_make_request(struct slp_client *client, int af,
+ char *addr)
{
- converge_srv_req(client, NULL, predicate, scopes);
- time(&(client->_last_da_cycle));
- if (! _LSLP_IS_EMPTY(&(client->das)))
+ // Check if we have direct target_addr
+ if (af == AF_UNSPEC)
{
- client->_use_das = TRUE;
+ if (client->_target_addr_any)
+ {
+ return FALSE;
+ }
+ af = client->_target_addr.af;
+ _slp_set_local_addr(client, af);
}
else
{
- client->_use_das = FALSE;
+ if (!client->_target_addr_any || (!client->_local_addr_any &&
+ client->_local_addr.af != af))
+ {
+ return FALSE;
+ }
+ _slp_set_local_addr(client, af);
+ client->_target_addr.af = af;
+ slp_pton(af, addr, &client->_target_addr.ip4_addr);
}
- return((int) client->_use_das );
-}
+ // Make sure that stack is active for the address family.
+ if ((af == AF_INET && !client->_ip4_stack_active)
+#ifdef PEGASUS_ENABLE_IPV6
+ || (af == AF_INET6 && !client->_ip6_stack_active)
+#endif
+ )
+ {
+ return FALSE;
+ }
-/* smart interface to slp discovery. uses das if they are present, */
-/* convergence otherwise. */
-/* periodically forces an active da discovery cycle */
+ return TRUE;
+}
-void discovery_cycle (
+int find_das(
struct slp_client *client,
- const char *type,
const char *predicate,
const char *scopes)
{
- // see if we have built a cache of directory agents
- if (_LSLP_IS_EMPTY(&(client->das)))
- {
- // we don't know of any directory agents - see if we need to
- // do active da discovery
- if (((time(NULL)) - client->_last_da_cycle ) > (60 * 5))
- {
- find_das(client, NULL, scopes) ;
- }
- }
-
- // if there are das, unicast a srvreq to each da
-
+ converge_srv_req(client, NULL, predicate, scopes);
+ time(&(client->_last_da_cycle));
if (! _LSLP_IS_EMPTY(&(client->das)))
{
- struct da_list *da = client->das.next;
- SOCKADDR_IN addr;
- while (! _LSLP_IS_HEAD(da))
- {
- addr.sin_port = htons(427);
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = inet_addr(da->remote);
- unicast_srv_req(client, type, predicate, scopes, &addr);
- da = da->next;
- }
+ client->_use_das = TRUE;
}
else
{
- // do a convergence request because we don't have any das to use
- converge_srv_req(client, type, predicate, scopes );
+ client->_use_das = FALSE;
}
- return;
+ return((int) client->_use_das );
}
+
/* this request MUST be retried <_convergence> times on EACH interface */
/* regardless of how many responses we have received */
/* it can be VERY time consuming but is the most thorough */
/* discovery method */
-
-void converge_srv_req(
+static void _slp_converge_srv_req(
struct slp_client *client,
const char *type,
const char *predicate,
- const char *scopes)
+ const char *scopes,
+ int xid)
{
- uint32 old_local_addr;
- uint32 *p_addr ;
+ struct slp_if_addr *p_addr, local_addr_save;
uint16 convergence;
- uint32 loopback ;
+ int idx;
+ int af = client->_target_addr.af;
DEBUG_PRINT((DEBUG_ENTER, "converge_srv_req "));
- // old_target_addr = client->_target_addr;
- old_local_addr = client->_local_addr;
- // client->_target_addr = inet_addr( "239.255.255.253" ) ;
+ local_addr_save = client->_local_addr;
- p_addr = client->_local_addr_list;
- loopback = inet_addr("127.0.0.1");
+ idx = af == AF_INET ? 0 : 1;
+ p_addr = client->_local_addr_list[idx];
+ PEGASUS_ASSERT(p_addr);
do
{
- if (*p_addr == loopback)
+ // Don't converge on loop-back address, we shall try local requaet
+ // later.
+ if (slp_is_loop_back(af, &p_addr->ip4_addr))
{
p_addr++;
continue;
convergence = 1;
}
- if (prepare_query( client, client->_xid + 1, type, scopes, predicate))
+ if (prepare_query( client, client->_xid + xid, type, scopes, predicate))
{
_LSLP_SETFLAGS(client->_msg_buf, LSLP_FLAGS_MCAST);
send_rcv_udp( client , TRUE);
}
}
p_addr++;
- }while (*p_addr != INADDR_ANY);
+ }while (p_addr->af != AF_UNSPEC);
- // always try a local request
- local_srv_req(client, type, predicate, scopes);
- // client->_target_addr = old_target_addr;
- client->_local_addr = old_local_addr;
+ client->_local_addr = local_addr_save;
+
DEBUG_PRINT((DEBUG_EXIT, "converge_srv_req "));
return ;
}
+void converge_srv_req(
+ struct slp_client *client,
+ const char *type,
+ const char *predicate,
+ const char *scopes)
+{
+ int xid = 1;
+#ifdef PEGASUS_ENABLE_IPV6
+ unsigned long hash;
+ char addr[PEGASUS_INET6_ADDRSTR_LEN];
+#endif
+ if (_slp_can_make_request(client, AF_UNSPEC, 0))
+ {
+ _slp_converge_srv_req(client, type, predicate, scopes, xid);
+ }
+ else
+ {
+ // Try with ip4 first
+ if (_slp_can_make_request(client, AF_INET, "239.255.255.253"))
+ {
+ _slp_converge_srv_req(client, type, predicate, scopes, xid);
+ xid = 0;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ if (type)
+ {
+ hash = 1000 + slp_hash(type, (unsigned long)strlen(type));
+ // Try on Link local scope
+ sprintf(addr,"FF02::1:%lu",hash);
+ if (_slp_can_make_request(client, AF_INET6, addr))
+ {
+ _slp_converge_srv_req(client, type, predicate, scopes, xid);
+ xid = 0;
+ }
+ // Try on Site local scope
+ sprintf(addr,"FF05::1:%lu",hash);
+ if (_slp_can_make_request(client, AF_INET6, addr))
+ {
+ _slp_converge_srv_req(client, type, predicate, scopes, xid);
+ }
+ }
+ else
+ {
+ if (_slp_can_make_request(client, AF_INET6, SLP_MC_LINK_SVRLOC_DA))
+ {
+ _slp_converge_srv_req(client, type, predicate, scopes, xid);
+ xid = 0;
+ }
+ if (_slp_can_make_request(client, AF_INET6, SLP_MC_SITE_SVRLOC_DA))
+ {
+ _slp_converge_srv_req(client, type, predicate, scopes, xid);
+ }
+ }
+#endif
+ }
+
+ // always try a local request
+ local_srv_req(client, type, predicate, scopes);
+}
+
+/*
+ Sets local and target addresses of slp_client from remote address.
+*/
+static void _slp_fill_local_target_addr(
+ struct slp_client *client,
+ SOCKADDR *addr,
+ uint16 port)
+{
+ if (addr->sa_family == AF_INET)
+ {
+ client->_local_addr.ip4_addr.s_addr = INADDR_ANY;
+ client->_local_addr.af = AF_INET;
+ if (addr)
+ {
+ client->_target_addr.ip4_addr = ((SOCKADDR_IN*)addr)->sin_addr;
+ }
+ else
+ {
+ client->_target_addr.ip4_addr.s_addr = inet_addr("127.0.0.1");
+ }
+ client->_target_addr.af = AF_INET;
+ client->_target_port =
+ addr ? ((SOCKADDR_IN*)addr)->sin_port : htons(port);
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ client->_local_addr.ip6_addr = in6addr_any;
+ client->_local_addr.af = AF_INET6;
+ if (addr)
+ {
+ client->_target_addr.ip6_addr =
+ ((SOCKADDR_IN6*)addr)->sin6_addr;
+ }
+ else
+ {
+ slp_pton(AF_INET6, "::1",
+ &client->_target_addr.ip6_addr);
+ }
+ client->_target_addr.af = AF_INET6;
+ client->_target_port =
+ addr ? ((SOCKADDR_IN6*)addr)->sin6_port : htons(port);
+ }
+#endif
+}
+
// this request will be retried MAX <_retries> times
// but will always end when the first response is received
// This request is best when using a directory agent
const char *type,
const char *predicate,
const char *scopes,
- SOCKADDR_IN *addr)
+ SOCKADDR *addr)
{
-
- uint32 target_addr_save, local_addr_save;
+ struct slp_if_addr target_addr_save, local_addr_save;
uint16 target_port_save;
struct timeval tv_save;
int retries ;
tv_save.tv_sec = client->_tv.tv_sec;
client->_tv.tv_sec = 1;
- // let the host decide which interface to use
- client->_local_addr = INADDR_ANY;
- client->_target_addr = addr->sin_addr.s_addr;
- client->_target_port = addr->sin_port;
+ _slp_fill_local_target_addr(client, addr, 0);
retries = client->_retries;
srv_req(client, type, predicate, scopes, FALSE);
retries--;
}
+
client->_target_addr = target_addr_save;
client->_local_addr = local_addr_save;
client->_target_port = target_port_save;
client->_tv.tv_sec = tv_save.tv_sec;
+
DEBUG_PRINT((DEBUG_EXIT, "unicast_srv_req "));
return;
}
const char *predicate,
const char *scopes)
{
-
- uint32 target_addr_save, local_addr_save;
+ struct slp_if_addr target_addr_save, local_addr_save;
uint16 target_port_save;
-
struct timeval tv_save;
+ BOOL local_any_save, target_any_save;
DEBUG_PRINT((DEBUG_ENTER, "local_srv_req "));
target_addr_save = client->_target_addr;
target_port_save = client->_target_port;
local_addr_save = client->_local_addr;
+ local_any_save = client->_local_addr_any;
+ target_any_save = client->_target_addr_any;
tv_save.tv_sec = client->_tv.tv_sec;
tv_save.tv_usec = client->_tv.tv_usec;
client->_tv.tv_sec = 0;
client->_tv.tv_usec = 10000;
- // let the host decide which interface to use
- client->_local_addr = INADDR_ANY;
- client->_target_addr = inet_addr("127.0.0.1");
- client->_target_port = htons(427);
- srv_req(client, type, predicate, scopes, FALSE) ;
+ client->_local_addr_any = client->_target_addr_any = TRUE;
+
+ // Try first on ip4 interface. This should get all ip4 URLs.
+ if (_slp_can_make_request(client, AF_INET, "127.0.0.1"))
+ {
+ srv_req(client, type, predicate, scopes, TRUE);
+ }
+
+ // Try on ip6 interface. This should get all ip6 URLs.
+#ifdef PEGASUS_ENABLE_IPV6
+ if (_slp_can_make_request(client, AF_INET6, "::1"))
+ {
+ srv_req(client, type, predicate, scopes, TRUE);
+ }
+#endif
client->_target_addr = target_addr_save;
client->_target_port = target_port_save;
client->_local_addr = local_addr_save;
- client->_tv.tv_sec = tv_save.tv_sec;
+ client->_local_addr_any = local_any_save;
+ client->_target_addr_any = target_any_save;
client->_tv.tv_sec = tv_save.tv_sec;
client->_tv.tv_usec = tv_save.tv_usec;
return;
}
-
// workhorse request function
void srv_req(
struct slp_client *client,
scopes,
predicate)))
{
- if (client->_target_addr == _LSLP_MCAST ||
- client->_target_addr == _LSLP_LOCAL_BCAST)
+ PEGASUS_ASSERT(client->_target_addr.af != AF_UNSPEC);
+
+ if ( (client->_target_addr.af == AF_INET &&
+ (client->_target_addr.ip4_addr.s_addr == _LSLP_MCAST ||
+ client->_target_addr.ip4_addr.s_addr == _LSLP_LOCAL_BCAST))
+#ifdef PEGASUS_ENBALE_IPV6
+ || (client->_target_addr.af == AF_INET6 &&
+ IN6_IS_ADDR_MULTICAST(&client->_target_addr.ip6_addr))
+#endif
+ )
{
_LSLP_SETFLAGS(client->_msg_buf, LSLP_FLAGS_MCAST);
}
return ;
}
-
/* this request MUST be retried <_convergence> times on EACH interface */
/* regardless of how many responses we have received */
/* it can be VERY time consuming but is the most thorough */
/* discovery method */
-void converge_attr_req(
+static void _slp_converge_attr_req(
struct slp_client *client,
const char *url,
const char *scopes,
- const char *tags)
+ const char *tags,
+ int xid)
{
- uint32 old_local_addr;
- uint32 *p_addr ;
+ struct slp_if_addr *p_addr;
+ struct slp_if_addr old_target_addr, old_local_addr;
uint16 convergence;
- uint32 loopback ;
+ int idx;
+ int af = client->_target_addr.af;
DEBUG_PRINT((DEBUG_ENTER, "converge_attr_req "));
+ PEGASUS_ASSERT(af != AF_UNSPEC);
- // old_target_addr = client->_target_addr;
- old_local_addr = client->_local_addr;
+ idx = af == AF_INET ? 0 : 1;
- p_addr = client->_local_addr_list;
- loopback = inet_addr("127.0.0.1");
+ old_target_addr = client->_target_addr;
+ old_local_addr = client->_local_addr;
+ p_addr = client->_local_addr_list[idx];
do
{
- if (*p_addr == loopback)
+ if (slp_is_loop_back(af, &p_addr->ip4_addr))
{
p_addr++;
continue;
convergence = 1;
}
- if (prepare_attr_query( client, client->_xid + 1, url, scopes, tags))
+ if (prepare_attr_query( client, client->_xid + xid, url, scopes, tags))
{
_LSLP_SETFLAGS(client->_msg_buf, LSLP_FLAGS_MCAST) ;
send_rcv_udp( client, FALSE );
}
}
p_addr++;
- }while (*p_addr != INADDR_ANY);
+ }while (p_addr->af != AF_UNSPEC);
- // always try a local request
- local_attr_req(client, url, scopes, tags);
- // client->_target_addr = old_target_addr;
+ client->_target_addr = old_target_addr;
client->_local_addr = old_local_addr;
+
DEBUG_PRINT((DEBUG_EXIT, "converge_attr_req "));
return ;
}
+
+void converge_attr_req(
+ struct slp_client *client,
+ const char *url,
+ const char *scopes,
+ const char *tags)
+{
+ int xid = 1;
+
+ if (_slp_can_make_request(client, AF_UNSPEC, 0))
+ {
+ _slp_converge_attr_req(client, url, scopes, tags, xid);
+ }
+ else
+ {
+ // Try with ip4 first
+ if (_slp_can_make_request(client, AF_INET, "239.255.255.253") &&
+ _slp_check_url_addr(url, AF_INET, 0))
+ {
+ _slp_converge_attr_req(client, url, scopes, tags, xid);
+ xid = 0;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ if (_slp_can_make_request(client, AF_INET6, SLP_MC_LINK_SVRLOC) &&
+ _slp_check_url_addr(url, AF_INET6, 0))
+ {
+ _slp_converge_attr_req(client, url, scopes, tags, xid);
+ xid = 0;
+ }
+ if (_slp_can_make_request(client, AF_INET6, SLP_MC_SITE_SVRLOC) &&
+ _slp_check_url_addr(url, AF_INET6, 0))
+ {
+ _slp_converge_attr_req(client, url, scopes, tags, xid);
+ }
+#endif
+ }
+ // always try a local request
+ local_attr_req(client, url, scopes, tags);
+}
+
// this request will be retried MAX <_retries> times
// but will always end when the first response is received
// This request is best when using a directory agent
const char *url,
const char *scopes,
const char *tags,
- SOCKADDR_IN *addr)
+ SOCKADDR *addr)
{
- uint32 target_addr_save, local_addr_save;
+ struct slp_if_addr target_addr_save, local_addr_save;
uint16 target_port_save;
struct timeval tv_save;
int retries ;
tv_save.tv_sec = client->_tv.tv_sec;
client->_tv.tv_sec = 1;
- // let the host decide which interface to use
- client->_local_addr = INADDR_ANY;
- client->_target_addr = addr->sin_addr.s_addr;
- client->_target_port = addr->sin_port;
+ _slp_fill_local_target_addr(client, addr, 0);
retries = client->_retries;
const char *scopes,
const char *tags )
{
- uint32 target_addr_save, local_addr_save;
+ struct slp_if_addr target_addr_save, local_addr_save;
uint16 target_port_save;
+ BOOL local_any_save, target_any_save;
struct timeval tv_save;
target_addr_save = client->_target_addr;
target_port_save = client->_target_port;
local_addr_save = client->_local_addr;
+ local_any_save = client->_local_addr_any;
+ target_any_save = client->_target_addr_any;
tv_save.tv_sec = client->_tv.tv_sec;
tv_save.tv_usec = client->_tv.tv_usec;
client->_tv.tv_sec = 0;
client->_tv.tv_usec = 10000;
- // let the host decide which interface to use
- client->_local_addr = INADDR_ANY;
- client->_target_addr = inet_addr("127.0.0.1");
- client->_target_port = htons(427);
+ client->_local_addr_any = client->_target_addr_any = TRUE;
+
+ if (_slp_can_make_request(client, AF_INET, "127.0.0.1") &&
+ _slp_check_url_addr(url, AF_INET, 0))
+ {
+ attr_req(client, url, scopes, tags, TRUE) ;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else if (_slp_can_make_request(client, AF_INET6, "::1") &&
+ _slp_check_url_addr(url, AF_INET6, 0))
+ {
+ attr_req(client, url, scopes, tags, TRUE) ;
+ }
+#endif
- attr_req(client, url, scopes, tags, FALSE) ;
client->_target_addr = target_addr_save;
client->_target_port = target_port_save;
client->_local_addr = local_addr_save;
- client->_tv.tv_sec = tv_save.tv_sec;
+ client->_local_addr_any = local_any_save;
+ client->_target_addr_any = target_any_save;
client->_tv.tv_sec = tv_save.tv_sec;
client->_tv.tv_usec = tv_save.tv_usec;
{
// check for the multicast address and set the mcast flag if necessary
- if (client->_target_addr == _LSLP_MCAST ||
- client->_target_addr == _LSLP_LOCAL_BCAST)
+ if ( (client->_target_addr.af == AF_INET &&
+ (client->_target_addr.ip4_addr.s_addr == _LSLP_MCAST ||
+ client->_target_addr.ip4_addr.s_addr == _LSLP_LOCAL_BCAST))
+#ifdef PEGASUS_ENBALE_IPV6
+ || (client->_target_addr.af == AF_INET6 &&
+ IN6_IS_ADDR_MULTICAST(&client->_target_addr.ip6_addr))
+#endif
+ )
{
_LSLP_SETFLAGS(client->_msg_buf, LSLP_FLAGS_MCAST) ;
}
/* |# of AttrAuths | Attribute Authentication Block (if present) \ */
/* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */
-void decode_attr_rply(struct slp_client *client, SOCKADDR_IN *remote)
+void decode_attr_rply(struct slp_client *client, SOCKADDR *remote)
{
char *bptr;
}
+/*
+ Returns ip addr in text form that is present in remote addr.
+*/
+static char *_slp_get_text_ip(SOCKADDR *remote)
+{
+ static char buff[PEGASUS_INET6_ADDRSTR_LEN];
+ int af = remote->sa_family;
+ void *addr;
+
+ if (af == AF_INET)
+ {
+ addr = &((SOCKADDR_IN*)remote)->sin_addr;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ addr = &((SOCKADDR_IN6*)remote)->sin6_addr;
+ }
+#endif
+ slp_ntop(af, addr, buff, sizeof(buff));
+ return buff;
+}
-void decode_msg(struct slp_client *client, SOCKADDR_IN *remote)
+void decode_msg(struct slp_client *client, SOCKADDR *remote)
{
char function, response;
function == LSLP_ATTRRPLY ||
function == LSLP_SRVTYPERPLY)
{
- prepare_pr_buf(client, inet_ntoa(remote->sin_addr));
+ prepare_pr_buf(client, _slp_get_text_ip(remote));
}
}
// <<< Fri Dec 21 15:47:06 2001 mdd >>>
// increment the correct function counters
-
switch (function)
{
case LSLP_DAADVERT:
/* this is a hack. but it will be consistent with the changes I envision */
/* for auth blocks and authenticated url entries */
-void decode_srvreg(struct slp_client *client, SOCKADDR_IN *remote)
+void decode_srvreg(struct slp_client *client, SOCKADDR *remote)
{
char *bptr, *url_string, *attr_string, *type_string, *scopes;
uint16 lifetime ;
}
-void decode_srvrply(struct slp_client *client, SOCKADDR_IN *remote)
+void decode_srvrply(struct slp_client *client, SOCKADDR *remote)
{
char *bptr, *xtptr, *xtn_limit;
lslpMsg *reply;
DEBUG_PRINT((DEBUG_ENTER, "decode_srvrply "));
+ xtn_limit = 0;
bptr = client->_rcv_buf;
purported_len = _LSLP_GETLENGTH(bptr);
memcpy(url_buf, xtptr + 7, url_len);
while (! _LSLP_IS_HEAD(rply_url))
{
- if (TRUE == lslp_pattern_match(
+ if (TRUE == lslp_pattern_match2(
url_buf, rply_url->url, FALSE))
{
/* this is the correct url to associate with
return;
}
-void decode_daadvert(struct slp_client *client, SOCKADDR_IN *remote)
+void decode_daadvert(struct slp_client *client, SOCKADDR *remote)
{
char *bptr;
int16 str_len;
free_da_list_node(exists);
}
/* need code here to handle authenticated urls */
- strcpy(&(adv->remote[0]), inet_ntoa(remote->sin_addr));
+ strcpy(&(adv->remote[0]), _slp_get_text_ip(remote));
_LSLP_INSERT(adv, &(client->das))
DEBUG_PRINT((DEBUG_EXIT, "decode_daadvert:1 "));
return;
}
-void decode_srvreq(struct slp_client *client, SOCKADDR_IN *remote)
+void decode_srvreq(struct slp_client *client, SOCKADDR *remote)
{
char *bptr, *bptrSave;
int32 total_len, purported_len;
BOOL mcast;
- uint32 local_address;
+ struct slp_if_addr local_address;
struct lslp_srv_rply_out *rp_out = NULL;
struct lslp_srv_req *rq = NULL;
int16 str_len, buf_len, err = LSLP_PARSE_ERROR;
+ size_t addr_len;
+ int idx;
DEBUG_PRINT((DEBUG_ENTER, "decode_srvreq "));
bptr += (total_len = _LSLP_HDRLEN(bptr));
if (purported_len < LSLP_MTU && (total_len < purported_len))
{
- if (! _LSLP_IS_EMPTY((lslpSrvRegList *)&(client->regs)))
+ if (! _LSLP_IS_EMPTY((lslpSrvRegList *)client->regs))
{
// advance past the slp v2 header
// get the previous responder list
if ((str_len + total_len + 2) < purported_len)
{
if (FALSE == slp_previous_responder(
- client, (str_len ? bptr + 2 : NULL )))
+ client, (str_len ? bptr + 2 : NULL ), remote->sa_family))
{
rq = (struct lslp_srv_req *)calloc(
1, sizeof(struct lslp_srv_req));
*(rq->srvcType + str_len) = 0x00;
bptr += 2 + str_len;
total_len += 2 + str_len;
-
bptrSave = bptr;
buf_len = LSLP_MTU - total_len;
rq->scopeList =
client->_scratch,
0x00000000,
2);
- rp_out = _lslpProcessSrvReq(client, rq, 0);
+ rp_out = _lslpProcessSrvReq(client, rq, 0,
+ remote);
} /* sanity check on remaining buffer */
} /* my scopes intersect */
} /* service type sanity check */
_LSLP_SET3BYTES(client->_scratch, 0x00000000, 2);
// client->_msg_buf is stuffed with the service reply. now we need
// to allocate a socket and send it back to the requesting node
- local_address = client->_local_addr;
+
+ if (remote->sa_family == AF_INET)
+ {
+ addr_len = sizeof(SOCKADDR_IN);
+ idx = 0;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ addr_len = sizeof(SOCKADDR_IN6);
+ idx = 1;
+ }
+#endif
+
+ if (client->_local_addr_any)
+ {
+ local_address.af = remote->sa_family;
+ if (local_address.af == AF_INET)
+ {
+ local_address.ip4_addr.s_addr = INADDR_ANY;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ local_address.ip6_addr = in6addr_any;
+ }
+#endif
+ }
+ else
+ {
+ PEGASUS_ASSERT(remote->sa_family == client->_local_addr.af);
+ local_address = client->_local_addr;
+ }
+
#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
- uint32* ptr_addr;
- ptr_addr = client->_local_addr_list;
+ struct slp_if_addr *ptr_addr;
+ ptr_addr = client->_local_addr_list[idx];
- while (*ptr_addr != INADDR_ANY)
+ while (ptr_addr->af != AF_UNSPEC)
{
local_address = *ptr_addr;
#endif
- if (INVALID_SOCKET !=
- (sock = _LSLP_SOCKET(AF_INET, SOCK_DGRAM, 0)))
+ if (-1 != _slp_create_bind_socket (&sock, local_address.af, 427,
+ &local_address.ip4_addr, TRUE))
{
- SOCKADDR_IN local;
- int err = 1;
- _LSLP_SETSOCKOPT(
- sock,
- SOL_SOCKET,
- LSLP_REUSEADDR,
- (const char *)&err,
- sizeof(err));
- local.sin_family = AF_INET;
- local.sin_port = client->_target_port ;
- local.sin_addr.s_addr = local_address;
- if (SOCKET_ERROR !=
- _LSLP_BIND(sock, &local, sizeof(local)))
+ if (mcast == TRUE)
{
- if (mcast == TRUE)
- {
- _LSLP_SLEEP(rand() % 30);
- }
- _LSLP_SENDTO(
- sock,
- client->_msg_buf,
- total_len,
- 0,
- remote,
- sizeof(SOCKADDR_IN ));
- } // successfully bound this socket
- _LSLP_CLOSESOCKET(sock);
- } // successfully opened this socket
+ _LSLP_SLEEP(rand() % 30);
+ }
+ _LSLP_SENDTO(
+ sock,
+ client->_msg_buf,
+ total_len,
+ 0,
+ remote,
+ addr_len);
+ }
+ _LSLP_CLOSESOCKET(sock);
#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
ptr_addr++;
} // end of while loop around all local network interfaces
BOOL send_rcv_udp(struct slp_client *client, BOOL retry)
{
+#ifdef PEGASUS_ENABLE_IPV6
+ SOCKADDR_IN6 ip6;
+#endif
+ SOCKADDR_IN ip4;
SOCKETD sock; //jeb
- SOCKADDR_IN target, local;
+ void * target;
BOOL ccode = FALSE;
+ int af;
+ size_t addr_len;
+ int err;
DEBUG_PRINT((DEBUG_ENTER, "send_rcv_udp "));
- if (INVALID_SOCKET != (sock = _LSLP_SOCKET(AF_INET, SOCK_DGRAM, 0)))
- {
- int err = 1;
- _LSLP_SETSOCKOPT(
- sock,
- SOL_SOCKET,
- LSLP_REUSEADDR,
- (const char *)&err,
- sizeof(err));
- local.sin_port = 0;
- local.sin_family = AF_INET;
+ af = client->_target_addr.af;
-//jeb
- local.sin_addr.s_addr = client->_local_addr;
- if (SOCKET_ERROR != _LSLP_BIND(sock, &local, sizeof(local)))
- {
+ if (-1 != _slp_create_bind_socket(&sock, af, 0,
+ &client->_local_addr.ip4_addr, TRUE))
+ {
int bcast =
((_LSLP_GETFLAGS(client->_msg_buf)) & LSLP_FLAGS_MCAST) ? 1:0;
if (bcast)
int sockopt = 0;
unsigned char my_ttl = 128;
ttl = _LSLP_SET_TTL(sock, my_ttl);
- sockopt = _LSLP_SETSOCKOPT(
- sock,
- SOL_SOCKET,
- SO_BROADCAST,
- (const char *) &bcast,
- sizeof(bcast));
+ // Broadcast messages are not supported by IPv6.
+ if (af == AF_INET)
+ {
+ sockopt = _LSLP_SETSOCKOPT(
+ sock,
+ SOL_SOCKET,
+ SO_BROADCAST,
+ (const char *) &bcast,
+ sizeof(bcast));
+ }
if ((SOCKET_ERROR == ttl ) || (SOCKET_ERROR == sockopt))
{
#else
- if ((SOCKET_ERROR == _LSLP_SET_TTL(sock, client->_ttl)) ||
- (SOCKET_ERROR == _LSLP_SETSOCKOPT(
+ if (af == AF_INET && (SOCKET_ERROR ==
+ _LSLP_SET_TTL(sock, client->_ttl) ||
+ SOCKET_ERROR == _LSLP_SETSOCKOPT(
sock,
SOL_SOCKET,
SO_BROADCAST,
DEBUG_PRINT((DEBUG_EXIT, "send_rcv_udp:err "));
return(FALSE);
}
- if (client->_local_addr != INADDR_ANY)
+
+ if (af == AF_INET &&
+ client->_local_addr.ip4_addr.s_addr != INADDR_ANY)
{
-//#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
struct in_addr ma;
memset(&ma, 0x00, sizeof(ma));
- ma.s_addr = client->_local_addr;
+ ma.s_addr = client->_local_addr.ip4_addr.s_addr;
if ((SOCKET_ERROR == _LSLP_SETSOCKOPT(
sock,
IPPROTO_IP,
(const char *)&ma,
sizeof(ma))))
{
-/*
-#else
- SOCKADDR_IN ma;
- memset(&ma, 0x00, sizeof(ma));
- ma.sin_addr.s_addr = client->_local_addr;
- if( (SOCKET_ERROR == _LSLP_SETSOCKOPT(sock, IPPROTO_IP, IP_MULTICAST_IF,
- (const char *)&ma, sizeof(SOCKADDR_IN))) ) {
-#endif
-*/
_LSLP_CLOSESOCKET(sock);
DEBUG_PRINT((DEBUG_EXIT, "send_rcv_udp:err2 "));
return(FALSE);
}
}
+ else
+ {
+ /* ATTN: implement for IPv6 */
+ }
}
- target.sin_family = AF_INET;
- target.sin_port = client->_target_port;
- target.sin_addr.s_addr = client->_target_addr;
-
+ if (af == AF_INET)
+ {
+ ip4.sin_family = AF_INET;
+ ip4.sin_port = client->_target_port;
+ ip4.sin_addr = client->_target_addr.ip4_addr;
+ addr_len = sizeof(ip4);
+ target = &ip4;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ addr_len = sizeof(ip6);
+ memset(&ip6, 0, addr_len);
+ ip6.sin6_family = AF_INET6;
+ ip6.sin6_port = client->_target_port;
+ ip6.sin6_addr = client->_target_addr.ip6_addr;
+ target = &ip6;
+ }
+#endif
if (SOCKET_ERROR == (err = _LSLP_SENDTO(
sock,
client->_msg_buf,
_LSLP_GETLENGTH(client->_msg_buf),
0,
- &target,
- sizeof(target))))
+ target,
+ addr_len)))
{
_LSLP_CLOSESOCKET(sock);
DEBUG_PRINT((DEBUG_EXIT, "send_rcv_udp "));
}
#endif
}
- } // bound the socket
- _LSLP_CLOSESOCKET(sock);
- } /* got the socket */
+ _LSLP_CLOSESOCKET(sock);
+ }
DEBUG_PRINT(
(DEBUG_EXIT, "send_rcv_udp:%s",
(ccode == FALSE ? "err3" : "ok")));
- return(ccode);
-}
-
-
-int32 service_listener_wait(
- struct slp_client *client,
- time_t wait,
- SOCKETD extra_sock,
- BOOL one_only,
- lslpMsg *list)
-{
- int32 ccode = 0;
-
- DEBUG_PRINT((DEBUG_ENTER, "service_listener_wait "));
-
- if (list != NULL)
- {
- list->isHead = TRUE;
- list->prev = list->next = list;
- ccode = __service_listener_wait(client, wait, extra_sock, one_only);
- get_response(client, list);
- }
- DEBUG_PRINT((DEBUG_EXIT, "service_listener_wait ccode = %d", ccode));
return(ccode);
}
-
-int32 __service_listener_wait(
- struct slp_client *client,
- time_t wait,
- SOCKETD extra_sock,
- BOOL one_only) //jeb
-{
- int32 rcv = 0;
- time_t now;
- time_t start = time(NULL);
-
- DEBUG_PRINT((DEBUG_ENTER, "__service_listener_wait "));
-
- while (time(&now) && ((now - wait ) <= start))
- {
- rcv += __service_listener(client, extra_sock);
- if (rcv > 0)
- {
- if (one_only == TRUE)
- {
- DEBUG_PRINT((DEBUG_EXIT, "__service_listener_wait1 rcv = %d",
- rcv));
- return(rcv);
- }
- }
- _LSLP_SLEEP(10);
- }
- rcv += __service_listener(client, extra_sock);
-
- DEBUG_PRINT((DEBUG_EXIT, "__service_listener_wait rcv = %d", rcv));
- return(rcv);
-}
-
-
int32 service_listener(
struct slp_client *client,
SOCKETD extra_sock,
{
int32 ccode = 0;
- DEBUG_PRINT((DEBUG_ENTER, "service_listener "));
+// DEBUG_PRINT((DEBUG_ENTER, "service_listener "));
if (list != NULL)
{
get_response(client, list);
}
- DEBUG_PRINT((DEBUG_EXIT, "service_listener ccode = %d", ccode));
+// DEBUG_PRINT((DEBUG_EXIT, "service_listener ccode = %d", ccode));
return(ccode);
}
struct slp_client *client,
SOCKETD extra_sock ) //jeb
{
-
struct timeval tv;
int32 err;
+ SOCKETD max_sock = -1;
+
LSLP_FD_SET fds;
_LSLP_FD_ZERO(&fds);
- DEBUG_PRINT((DEBUG_ENTER, "__service_listener "));
+// DEBUG_PRINT((DEBUG_ENTER, "__service_listener "));
- if (client->_rcv_sock != INVALID_SOCKET)
+ if (client->_rcv_sock[0] != INVALID_SOCKET)
+ {
+ _LSLP_FD_SET(client->_rcv_sock[0], &fds);
+ max_sock = client->_rcv_sock[0];
+ }
+ if (client->_rcv_sock[1] != INVALID_SOCKET)
{
- _LSLP_FD_SET(client->_rcv_sock, &fds);
+ _LSLP_FD_SET(client->_rcv_sock[1], &fds);
+ if (max_sock < client->_rcv_sock[1])
+ {
+ max_sock = client->_rcv_sock[1];
+ }
}
+
if (extra_sock)
{
_LSLP_FD_SET( extra_sock, &fds);
+ if (max_sock < extra_sock)
+ {
+ max_sock = extra_sock;
+ }
+
}
do
{
tv.tv_sec = client->_tv.tv_sec;
tv.tv_usec = client->_tv.tv_usec;
- err = _LSLP_SELECT(((client->_rcv_sock != INVALID_SOCKET) &&
- (client->_rcv_sock > extra_sock)) ?
- client->_rcv_sock + 1 : extra_sock + 1, &fds, NULL, NULL, &tv);
+ err = _LSLP_SELECT(max_sock + 1, &fds, NULL, NULL, &tv);
}while ((err < 0 ) && (errno == EINTR));
if (0 < err)
{
+#ifdef PEGASUS_ENABLE_IPV6
+ SOCKADDR_STORAGE remote;
+#else
SOCKADDR_IN remote;
- int size = sizeof(SOCKADDR_IN);
- if (client->_rcv_sock != INVALID_SOCKET)
+#endif
+ int size = sizeof(remote);
+ int i;
+ for (i = 0; i < 2 ; ++i)
{
- if (_LSLP_FD_ISSET(client->_rcv_sock, &fds))
+ if (client->_rcv_sock[i] != INVALID_SOCKET &&
+ _LSLP_FD_ISSET(client->_rcv_sock[i], &fds))
{
err = _LSLP_RECV_FROM(
- client->_rcv_sock,
+ client->_rcv_sock[i],
client->_rcv_buf,
LSLP_MTU,
0,
&remote,
&size);
- decode_msg(client, &remote);
+ decode_msg(client, (SOCKADDR*)&remote);
}
}
0,
&remote,
&size);
- decode_msg(client, &remote);
+ decode_msg(client, (SOCKADDR*)&remote);
}
}
{
// our interfaces could be disconnected or we could be a laptop that
// just got pulled from the network, etc.
- _LSLP_CLOSESOCKET(client->_rcv_sock);
- if (0 < slp_get_local_interfaces( &(client->_local_addr_list) ))
- {
- if (client->_rcv_sock != INVALID_SOCKET)
- {
- client->_rcv_sock = slp_open_listen_sock();
- }
- }
+ slp_get_local_interfaces(client);
+ slp_open_listen_socks(client);
+#ifdef PEGASUS_ENABLE_IPV6
+ slp_join_ip6_service_type_multicast_group(client, client->_srv_type);
+#endif
}
- DEBUG_PRINT((DEBUG_EXIT, "__service_listener err = %d", err));
+// DEBUG_PRINT((DEBUG_EXIT, "__service_listener err = %d", err));
return(err);
}
const char *scopes,
int16 lifetime)
{
- uint32 target_addr_save;
int convergence_save;
+ int af;
// keep track of how many times we register
int registrations = 0;
return(0);
}
- // save target and convergence parameters
- target_addr_save = client->_target_addr;
+ // save convergence parameter
convergence_save = client->_convergence;
client->_convergence = 0;
struct da_list *da = client->das.next;
while (! _LSLP_IS_HEAD(da))
{
- client->_target_addr = inet_addr(da->remote);
- if (TRUE == srv_reg(
+ if (slp_is_valid_ip4_addr(da->remote))
+ {
+ af = AF_INET;
+ client->_target_addr.ip4_addr.s_addr =
+ inet_addr(da->remote);
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else if (slp_is_valid_ip6_addr(da->remote))
+ {
+ af = AF_INET6;
+ slp_pton(AF_INET6,da->remote,
+ &client->_target_addr.ip6_addr);
+ }
+#endif
+ else
+ {
+ PEGASUS_ASSERT(0);
+ }
+
+ if (client->_local_addr_any)
+ {
+ client->_local_addr.af = af;
+ if (af == AF_INET)
+ {
+ client->_local_addr.ip4_addr.s_addr = INADDR_ANY;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ client->_local_addr.ip6_addr = in6addr_any;
+ }
+#endif
+ }
+ if (client->_target_addr.af == client->_local_addr.af &&
+ TRUE == srv_reg(
client,
url,
attributes,
}
// restore parameters
client->_convergence = convergence_save;
- client->_target_addr = target_addr_save;
+
+ af = client->_target_addr.af;
+
+ if (client->_local_addr_any)
+ {
+ client->_local_addr.af = af;
+ if (af == AF_INET)
+ {
+ client->_local_addr.ip4_addr.s_addr = INADDR_ANY;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ client->_local_addr.ip6_addr = in6addr_any;
+ }
+#endif
+ }
+
/* do a unicast srvreg if we have the target set */
- if (client->_target_addr != _LSLP_MCAST)
+ if ( client->_target_addr.af == client->_local_addr.af &&
+ !((af == AF_INET &&
+ client->_target_addr.ip4_addr.s_addr == _LSLP_MCAST)
+#ifdef PEGASUS_ENBALE_IPV6
+ || (af == AF_INET6 &&
+ IN6_IS_ADDR_MULTICAST(&client->_target_addr.ip6_addr))
+#endif
+ ))
{
if (TRUE == srv_reg(
client,
registrations++;
}
}
+
DEBUG_PRINT((DEBUG_EXIT, "srv_reg_all:ok "));
return(registrations);
}
{
int count = 0;
- uint32 target_addr_save;
+ struct slp_if_addr target_addr_save, local_addr_save;
int convergence_save;
+ BOOL local_any_save, target_any_save;
DEBUG_PRINT((DEBUG_ENTER, "srv_reg_local "));
PEGASUS_ASSERT(client != NULL && url != NULL && attributes != NULL &&
service_type != NULL && scopes != NULL);
}
target_addr_save = client->_target_addr;
+ local_addr_save = client->_local_addr;
convergence_save = client->_convergence;
client->_convergence = 0;
- client->_target_addr = inet_addr("127.0.0.1");
- if (TRUE == srv_reg(
- client,
- url,
- attributes,
- service_type,
- scopes,
- lifetime))
+ local_any_save = client->_local_addr_any;
+ target_any_save = client->_target_addr_any;
+
+ client->_local_addr_any = client->_target_addr_any = TRUE;
+
+ if (_slp_can_make_request(client, AF_INET, "127.0.0.1") &&
+ _slp_check_url_addr(url, AF_INET, 0))
{
- count = 1;
+ if (TRUE == srv_reg(client, url, attributes, service_type,
+ scopes, lifetime))
+ {
+ count = 1;
+ }
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else if (_slp_can_make_request(client, AF_INET6, "::1") &&
+ _slp_check_url_addr(url, AF_INET6, 0))
+ {
+ if (TRUE == srv_reg(client, url, attributes, service_type,
+ scopes, lifetime))
+ {
+ count = 1;
+ }
}
+#endif
+
client->_convergence = convergence_save;
client->_target_addr = target_addr_save;
+ client->_local_addr = local_addr_save;
+ client->_local_addr_any = local_any_save;
+ client->_target_addr_any = target_any_save;
DEBUG_PRINT((DEBUG_ENTER, "srv_reg_local count=%d", count));
return count;
exit(1);
}
+ // Join ip6 service location multicast group if it is new service here.
+#ifdef PEGASUS_ENABLE_IPV6
+ slp_join_ip6_service_type_multicast_group(client, service_type);
+#endif
+
/* update the attributes if an existing registration */
- reg = client->regs.next;
+ reg = client->regs->next;
while (! _LSLP_IS_HEAD(reg))
{
if (0 == lslp_string_compare(url_copy, reg->url->url))
reg->scopeList = lslpScopeStringToList(scopes, len);
len = (int16)strlen(attributes);
reg->attrList = _lslpDecodeAttrString((char *)attributes);
- _LSLP_INSERT(reg, (lslpSrvRegList *)&(client->regs));
+ _LSLP_INSERT(reg, (lslpSrvRegList *)client->regs);
}
DEBUG_PRINT((DEBUG_ENTER, "srv_reg_local %s", "3 "));
return;
}
-BOOL slp_previous_responder(struct slp_client *client, char *pr_list)
+BOOL slp_previous_responder(struct slp_client *client, char *pr_list, int af)
{
char *a, *s = NULL;
- uint32 addr, *list_addr;
+ struct slp_if_addr *list_addr;
if (pr_list == NULL || 0 == strlen(pr_list))
{
return(FALSE);
a = _LSLP_STRTOK(pr_list, ",", &s);
while (NULL != a)
{
- if (INADDR_NONE != (addr = inet_addr(a)))
+ if (af == AF_INET && slp_is_valid_ip4_addr(a))
+ {
+ list_addr = client->_local_addr_list[0];
+ while (list_addr->af != AF_UNSPEC)
+ {
+ if (list_addr->ip4_addr.s_addr == inet_addr(a))
+ {
+ return(TRUE);
+ }
+ list_addr++;
+ }
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else if(af == AF_INET6 && slp_is_valid_ip6_addr(a))
{
- list_addr = client->_local_addr_list;
- while (INADDR_ANY != *list_addr)
+ struct in6_addr t;
+ list_addr = client->_local_addr_list[1];
+ while (list_addr->af != AF_UNSPEC)
{
- if (*list_addr == addr)
+ slp_pton(AF_INET6, a, &t);
+ if (slp_addr_equal(AF_INET6, &list_addr->ip6_addr, &t))
{
return(TRUE);
}
list_addr++;
}
+
+ }
+#endif
+ else
+ {
+ return FALSE;
}
a = _LSLP_STRTOK(NULL, ",", &s);
}
const char *spi,
const char *scopes,
BOOL should_listen,
- BOOL use_das)
+ BOOL use_das,
+ const char *srv_type)
{
int16 len;
struct slp_client *client;
+ int target_af = AF_UNSPEC;
+ int local_af = AF_UNSPEC;
DEBUG_PRINT((DEBUG_ENTER, "create_slp_client "));
return NULL;
}
+ if (target_addr)
+ {
+ if (slp_is_valid_ip4_addr(target_addr))
+ {
+ target_af = AF_INET;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else if ((slp_is_valid_ip6_addr(target_addr)))
+ {
+ target_af = AF_INET6;
+ }
+#endif
+ else
+ {
+ DEBUG_PRINT((DEBUG_EXIT, "create_slp_client:err2 "));
+ return NULL;
+ }
+ }
+
+ if (local_interface)
+ {
+ if (slp_is_valid_ip4_addr(local_interface))
+ {
+ local_af = AF_INET;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else if ((slp_is_valid_ip6_addr(local_interface)))
+ {
+ local_af = AF_INET6;
+ }
+#endif
+ else
+ {
+ DEBUG_PRINT((DEBUG_EXIT, "create_slp_client:err3 "));
+ return NULL;
+ }
+ }
+
+ // Don't allow having local_interface and target_addr of different address
+ // types.
+ if (local_af != AF_UNSPEC && local_af != AF_UNSPEC)
+ {
+ // We can not have ipv4 interface sending datagrams to ip6 interface or
+ // vice-versa.
+ if (local_af != target_af)
+ {
+ DEBUG_PRINT((DEBUG_EXIT, "create_slp_client:err4 "));
+ return NULL;
+ }
+ }
+
client = (struct slp_client *)calloc(1, sizeof(struct slp_client)); //jeb
if (client == NULL)
{
- DEBUG_PRINT((DEBUG_EXIT, "create_slp_client:err2 "));
+ DEBUG_PRINT((DEBUG_EXIT, "create_slp_client:err5 "));
return NULL;
}
client->_scratch = (char* )calloc(LSLP_MTU, sizeof(char));
client->_err_buf = (char* )calloc(255, sizeof(char));
+ client->_target_addr_any = target_af == AF_UNSPEC ? TRUE : FALSE;
+ client->_local_addr_any = local_af == AF_UNSPEC ? TRUE : FALSE;
+
client->_buf_len = LSLP_MTU;
client->_version = 1;
client->_xid = 1;
client->_target_port = htons(target_port);
+ client->_ip4_stack_active = slp_is_ip4_stack_active();
+
+#ifdef PEGASUS_ENABLE_IPV6
+ client->_ip6_stack_active = slp_is_ip6_stack_active();
+#endif
+
if (target_addr == NULL)
{
- client->_target_addr = inet_addr("239.255.255.253");
+ client->_target_addr_any = TRUE;
}
else
{
- client->_target_addr = inet_addr(target_addr);
+ client->_target_addr.af = target_af;
+ if (target_af == AF_INET)
+ {
+ client->_target_addr.ip4_addr.s_addr = inet_addr(target_addr);
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ slp_pton(target_af, target_addr, &client->_target_addr.ip4_addr);
+ }
+#endif
}
if (local_interface == NULL)
{
- client->_local_addr = INADDR_ANY;
+ client->_local_addr_any = TRUE;
}
else
{
- client->_local_addr = inet_addr(local_interface);
+ client->_local_addr.af = local_af;
+ if (local_af == AF_INET)
+ {
+ client->_local_addr.ip4_addr.s_addr = inet_addr(local_interface);
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ slp_pton(local_af, local_interface, &client->_local_addr.ip6_addr);
+ }
+#endif
}
if (spi == NULL)
client->replies.isHead = TRUE;
client->replies.next = client->replies.prev = &(client->replies);
- client->regs.isHead = TRUE;
- client->regs.next = client->regs.prev = (lslpSrvRegList *)&(client->regs);
+ client->regs = (lslpSrvRegHead*)malloc(sizeof(lslpSrvRegHead));
+ client->regs->isHead = TRUE;
+ client->regs->next = client->regs->prev = (lslpSrvRegList *)client->regs;
+
+ client->_local_addr_list[0] = client->_local_addr_list[1] = NULL;
- client->_local_addr_list = NULL;
- slp_get_local_interfaces(&(client->_local_addr_list));
+ // Get both ip4 and ip6 interfaces
+ slp_get_local_interfaces(client);
/* see if we can use a local DA. If not, open up the listen socket */
- client->_rcv_sock = INVALID_SOCKET;
+ client->_rcv_sock[0] = client->_rcv_sock[1] = INVALID_SOCKET;
+
if (should_listen == TRUE)
{
- client->_rcv_sock = slp_open_listen_sock();
+ slp_open_listen_socks(client);
+#ifdef PEGASUS_ENABLE_IPV6
+ if (srv_type)
+ {
+ client->_srv_type = (char*)malloc(strlen(srv_type) + 1);
+ strcpy(client->_srv_type, srv_type);
+ slp_join_ip6_service_type_multicast_group(client, srv_type);
+ }
+#endif
}
if (client->_use_das == TRUE)
local_srv_req(client, NULL, NULL, "DEFAULT");
if (! _LSLP_IS_EMPTY(&(client->das)))
{
- client->_rcv_sock = INVALID_SOCKET;
+ _LSLP_CLOSESOCKET(client->_rcv_sock[0]);
+ _LSLP_CLOSESOCKET(client->_rcv_sock[1]);
+ client->_rcv_sock[0] = client->_rcv_sock[1] = INVALID_SOCKET;
client->_use_das = TRUE;
client->_da_target_port = htons(427);
- client->_da_target_addr = inet_addr("127.0.0.1");
+ if (client->_ip4_stack_active)
+ {
+ client->_da_target_addr.ip4_addr.s_addr =
+ inet_addr("127.0.0.1");
+ client->_da_target_addr.af = AF_INET;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ slp_pton(AF_INET6, "::1", &client->_da_target_addr.ip6_addr);
+ client->_da_target_addr.af = AF_INET6;
+ }
+#endif
}
}
client->get_response = get_response;
client->find_das = find_das;
- client->discovery_cycle = discovery_cycle;
client->converge_srv_req = converge_srv_req;
client->unicast_srv_req = unicast_srv_req;
client->local_srv_req = local_srv_req;
client->decode_daadvert = decode_daadvert;
client->send_rcv_udp = send_rcv_udp;
- client->service_listener_wait = service_listener_wait;
client->slp_previous_responder = slp_previous_responder;
DEBUG_PRINT((DEBUG_EXIT, "create_slp_client:ok "));
return;
}
- _LSLP_CLOSESOCKET(client->_rcv_sock);
- _LSLP_FREE_DEINIT(client->_local_addr_list);
+ _LSLP_CLOSESOCKET(client->_rcv_sock[0]);
+ _LSLP_CLOSESOCKET(client->_rcv_sock[1]);
+
+ _LSLP_FREE_DEINIT(client->_local_addr_list[0]);
+ _LSLP_FREE_DEINIT(client->_local_addr_list[1]);
+
lslpFreeScopeList((lslpScopeList *)(client->_spi));
lslpFreeScopeList(client->_scopes);
_LSLP_FREE_DEINIT(client->_crypto_context);
free(client->_rcv_buf);
free(client->_scratch);
free(client->_err_buf);
+ free(client->_srv_type);
//Freeing memory allocated for regs in __srv_reg_local
- lslpFreeSrvRegList(&client->regs);
-
+ lslpFreeSrvRegList(client->regs);
+ free(client->regs);
free(client);
DEBUG_PRINT((DEBUG_EXIT, "destroy_slp_client:ok "));
return;
/* right now we don't support the attr request unless
it specifies a complete url. */
-void decode_attrreq(struct slp_client *client, SOCKADDR_IN *remote)
+void decode_attrreq(struct slp_client *client, SOCKADDR *remote)
{
char *bptr;
lslpURL *url;
lslpScopeList *scopes;
lslpAttrList *attr_tags, *attr_return;
lslpSrvRegList *regs;
-
+ size_t addr_len;
+ int idx;
int16 str_len, buf_len, err = 0, parse_err;
int32 total_len, purported_len;
- uint32 local_address;
+ struct slp_if_addr local_address;
DEBUG_PRINT((DEBUG_ENTER, "decode_attrreq "));
{
if (FALSE == slp_previous_responder(
client,
- (str_len ? bptr + 2 : NULL)))
+ (str_len ? bptr + 2 : NULL), remote->sa_family))
{
bptr += str_len + 2;
total_len += str_len + 2;
&parse_err);
/* see if we have url match */
total_len += str_len + 2;
- regs = client->regs.next;
+ regs = client->regs->next;
attr_return = NULL;
while (! _LSLP_IS_HEAD(regs))
/* only send the response if there is an
attribute or if this is a unicast */
+ if (remote->sa_family == AF_INET)
+ {
+ addr_len = sizeof(SOCKADDR_IN);
+ idx = 0;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ addr_len = sizeof(SOCKADDR_IN6);
+ idx = 1;
+ }
+#endif
+
+ if (client->_local_addr_any)
+ {
+ local_address.af = remote->sa_family;
+ if (local_address.af == AF_INET)
+ {
+ local_address.ip4_addr.s_addr =
+ INADDR_ANY;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ local_address.ip6_addr = in6addr_any;
+ }
+#endif
+ }
+ else
+ {
+ PEGASUS_ASSERT(remote->sa_family ==
+ client->_local_addr.af);
+ local_address = client->_local_addr;
+ }
- local_address = client->_local_addr;
#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
- uint32* ptr_addr;
- ptr_addr = client->_local_addr_list;
- while (*ptr_addr != INADDR_ANY)
+ struct slp_if_addr* ptr_addr;
+ ptr_addr = client->_local_addr_list[idx];
+ while (ptr_addr->af != AF_UNSPEC)
{
- local_address = *ptr_addr;
+ local_address = *ptr_addr;
#endif
- if (INVALID_SOCKET != (sock =
- _LSLP_SOCKET(AF_INET, SOCK_DGRAM, 0)))
+ if (-1 != _slp_create_bind_socket (&sock,
+ local_address.af, 427,
+ &local_address.ip4_addr, TRUE))
{
- SOCKADDR_IN local;
- int err = 1;
- _LSLP_SETSOCKOPT(
- sock,
- SOL_SOCKET,
- LSLP_REUSEADDR,
- (const char *)&err,
- sizeof(err) );
- local.sin_family = AF_INET;
- local.sin_port = client->_target_port;
- local.sin_addr.s_addr = local_address;
- if (SOCKET_ERROR !=
- _LSLP_BIND(
- sock,
- &local,
- sizeof(local)))
- {
_LSLP_SENDTO(
sock,
client->_msg_buf,
total_len,
0,
(remote),
- sizeof(SOCKADDR_IN));
- } /* successfully bound this socket */
- _LSLP_CLOSESOCKET(sock);
- } /* successfully opened this socket */
- // }
+ addr_len);
+ }
+ _LSLP_CLOSESOCKET(sock);
#ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
ptr_addr++;
{
/* advance to a matching attribute name if it exists */
while ((! _LSLP_IS_HEAD(attrs )) &&
- (FALSE == lslp_pattern_match(filter->attrs.next->name,
+ (FALSE == lslp_pattern_match2(filter->attrs.next->name,
attrs->name, FALSE)))
{
attrs = attrs->next ;
PEGASUS_ASSERT(s2 != NULL);
lslp_foldString(s1);
lslp_foldString(s2);
- if (TRUE == lslp_pattern_match(s1, s2, FALSE))
+ if (TRUE == lslp_pattern_match2(s1, s2, FALSE))
{
return 0;
}
struct lslp_srv_rply_out *_lslpProcessSrvReq(
struct slp_client *client,
struct lslp_srv_req *msg,
- int16 errCode)
+ int16 errCode,
+ SOCKADDR *remote)
{
char *buf;
int16 bufLen, avail;
int16 ext_offset;
char *extptr, *next_extptr;
BOOL pile_up_attrs = FALSE;
+ char url_addr[PEGASUS_IN6_ADDR_SIZE];
struct lslp_srv_rply_out *temp_rply =
(struct lslp_srv_rply_out *)calloc(
} /* if there is an extension */
- reg = client->regs.next;
+ reg = client->regs->next;
extptr = client->_scratch;
next_extptr = extptr + 2;
ext_offset = 0;
lslpFreeSrvReg(temp_reg);
continue;
}
+ // Match the remote address family. Send ip4 URLs to ip4
+ // remote addrs and ip6 URLs to ip6 remote addrs.
+ if (!_slp_check_url_addr(reg->url->url, remote->sa_family,
+ url_addr))
+ {
+ reg = reg->next;
+ continue;
+ }
+
+ // Determine whether we have correct ip6 SCOPES.
+/*
+ Request Source Address Scope
+ +------------+------------+---------+
+ | Link-Local | Site-Local | Global |
+ +-------------+------------+------------+---------+
+ Service | Link-Local | Respond | Drop | Drop |
+ Address +-------------+------------+------------+---------+
+ Scope | Site-Local | Respond | Respond | Drop |
+ +-------------+------------+------------+---------+
+ | Global | Respond | Respond | Respond |
+ +-------------+------------+------------+---------+
+
+ Out-of-Scope Rules
+*/
+#ifdef PEGASUS_ENABLE_IPV6
+ if (remote->sa_family == AF_INET6)
+ {
+ struct in6_addr src_addr =
+ ((SOCKADDR_IN6*)remote)->sin6_addr;
+ // Site local source address
+ if (IN6_IS_ADDR_SITELOCAL(&src_addr))
+ {
+ // Drop if Link local.
+ if (IN6_IS_ADDR_LINKLOCAL(
+ (struct in6_addr*)&url_addr))
+ {
+ reg = reg->next;
+ continue;
+ }
+ }
+ // Global source address
+ else if (!IN6_IS_ADDR_SITELOCAL(&src_addr) &&
+ !IN6_IS_ADDR_LINKLOCAL(&src_addr))
+ {
+ // Drop if Link or Site local.
+ if (IN6_IS_ADDR_SITELOCAL(
+ (struct in6_addr*)&url_addr) ||
+ IN6_IS_ADDR_LINKLOCAL(
+ (struct in6_addr*)&url_addr))
+ {
+ reg = reg->next;
+ continue;
+ }
+ }
+ }
+#endif
if (TRUE == lslp_srvtype_match(
reg->srvType,
msg->srvcType))
#define lslp_to_lower(c) (((c) > 0x40 && (c) < 0x5b) ? ((c) + 0x20) : (c))
/* based upon TclStringCaseMatch */
#define MAX_RECURSION 10
-BOOL lslp_pattern_match(
+static BOOL _lslp_pattern_match(
const char *string,
const char *pattern,
- BOOL case_sensitive)
+ BOOL case_sensitive,
+ BOOL eb)
{
char s, p;
}
while (1)
{
- if ((p != '[') && (p != '?') && (p != '\\'))
+ if ((!eb && p != '[') && (p != '?') && (p != '\\'))
{
/* advance the string until there is a match */
while (*string)
}
}
if (TRUE ==
- lslp_pattern_match(string, pattern, case_sensitive))
+ _lslp_pattern_match(string, pattern, case_sensitive, eb))
{
recursion_level--;
return TRUE;
continue;
}
- if (p == '[')
+ if (!eb && p == '[')
{
char start, end;
pattern++;
}
while (1)
{
- if (*pattern == ']' || *pattern == '\0')
+ if ((!eb && *pattern == ']') || *pattern == '\0')
{
recursion_level--;
return FALSE ;
break;
}
}
- while (*pattern != ']')
+ while (!eb && *pattern != ']')
{
if (*pattern == '\0')
{
}
}
+BOOL lslp_pattern_match(
+ const char *string,
+ const char *pattern,
+ BOOL case_sensitive)
+{
+ return _lslp_pattern_match(string, pattern, case_sensitive, FALSE);
+}
+
+/*
+ Matches the pattern by treating brackets([]) as part regualr expression
+ expansion and also not treating them as part of reaular expressions.
+ Used for IPv6 addrss URLs.
+*/
+BOOL lslp_pattern_match2(
+ const char *string,
+ const char *pattern,
+ BOOL case_sensitive)
+{
+ if ( TRUE == _lslp_pattern_match(string, pattern, case_sensitive, TRUE))
+ {
+ return TRUE;
+ }
+ return _lslp_pattern_match(string, pattern, case_sensitive, FALSE);
+}
char * lslp_get_next_ext(char *hdr_buf)
{
"DSA",
"DEFAULT, TEST SCOPE",
TRUE,
- TRUE);
+ TRUE,
+ 0);
if (client != NULL)
{
#define SLP_CLIENT_INC
#include <Pegasus/Common/Config.h>
+#include "slp_utils.h"
#ifndef NUCLEUS
#include "lslp-common-defs.h"
#define SA_SCOPE "DEFAULT"
#define SA_SCOPELEN 7
+#define SERVICE_WBEM "service:wbem"
+
#define TYPE_UNKKNOWN 0
#define TYPE_DA_LIST 1
#define TYPE_RPLY_LIST 2
#undef LSLP_WAIT_OK
#define LSLP_WAIT_OK 0
+// IPv6 multicast groups
+#ifdef PEGASUS_ENABLE_IPV6
+
+// SVRLOC multicast groups for LINK, ADMIN, SITE and ORGANIZATION local
+// scopes. These groups are used to receive Service-Type and Attribute
+// Request messages.
+
+#define SLP_MC_LINK_SVRLOC "FF02::116"
+#define SLP_MC_ADMIN_SVRLOC "FF04::116"
+#define SLP_MC_SITE_SVRLOC "FF05::116"
+#define SLP_MC_ORG_SVRLOC "FF08::116"
+
+// SVRLOC-DA multicast groups for LINK, ADMIN, SITE and ORGANIZATION local
+// scopes. These groups are used to receive DA advertisements.
+
+#define SLP_MC_LINK_SVRLOC_DA "FF02::123"
+#define SLP_MC_ADMIN_SVRLOC_DA "FF04::123"
+#define SLP_MC_SITE_SVRLOC_DA "FF05::123"
+#define SLP_MC_ORG_SVRLOC "FF08::116"
+
+#endif
+
#define slp_safe_free(a) if(a != NULL) {free(a);}
#ifdef SLP_LIB_IMPORT
char *spi;
char auth_blocks;
char *auth;
- char remote[16];
+#ifdef PEGASUS_ENABLE_IPV6
+ char remote[PEGASUS_INET6_ADDRSTR_LEN];
+#else
+ char remote[PEGASUS_INET_ADDRSTR_LEN];
+#endif
};
struct rply_list
char *url;
char auth_blocks;
char *auth;
- char remote[16];
+#ifdef PEGASUS_ENABLE_IPV6
+ char remote[PEGASUS_INET6_ADDRSTR_LEN];
+#else
+ char remote[PEGASUS_INET_ADDRSTR_LEN];
+#endif
};
struct reg_list
char *auth_blocks;
};
+ /* Represents Interface address either IPv4 or IPv6 */
+ struct slp_if_addr
+ {
+ uint16 af; // Address family
+ union
+ {
+ struct in_addr ip4_addr;
+#ifdef PEGASUS_ENABLE_IPV6
+ struct in6_addr ip6_addr;
+#endif
+ };
+ };
+
struct slp_client
{
uint16 _pr_buf_len;
char _version;
uint16 _xid;
uint16 _target_port;
- uint32 _target_addr;
- uint32 _local_addr;
- uint32 *_local_addr_list;
+
+ struct slp_if_addr _target_addr;
+ struct slp_if_addr _local_addr;
+ struct slp_if_addr *_local_addr_list[2];
+
+ BOOL _ip4_stack_active;
+ BOOL _ip6_stack_active;
+ BOOL _local_addr_any;
+ BOOL _target_addr_any;
+
uint32 _msg_counts[12];
lslpSPIList *_spi;
lslpScopeList *_scopes;
-/* char _pr_buf[LSLP_MTU]; */
-/* char _msg_buf[LSLP_MTU]; */
-/* char _rcv_buf[LSLP_MTU]; */
-/* char _scratch[LSLP_MTU]; */
-/* char _err_buf[255]; */
char* _pr_buf;
char* _msg_buf;
char* _rcv_buf;
char* _scratch;
char* _err_buf;
+ char* _srv_type;
BOOL _use_das;
uint16 _da_target_port;
- uint32 _da_target_addr;
+ struct slp_if_addr _da_target_addr;
/* add field and record separators for shell scripting */
BOOL _use_separators;
int _ttl;
int _convergence;
void *_crypto_context;
- SOCKETD _rcv_sock; //jeb
+
+ SOCKETD _rcv_sock[2];
+
#if defined(PEGASUS_OS_TYPE_WINDOWS)
int _winsock_count ;
WSADATA _wsa_data;
#endif
struct da_list das;
lslpMsg replies;
- lslpSrvRegHead regs;
+ lslpSrvRegHead *regs;
+
+ void (*slp_open_listen_socks)(struct slp_client *client);
lslpMsg *(*get_response) (struct slp_client *, lslpMsg *);
int (*find_das)(
struct slp_client *,
const char *,
const char *);
- void (*discovery_cycle) (
- struct slp_client *,
- const char *,
- const char *,
- const char *);
void (*converge_srv_req)(
struct slp_client *,
const char *,
const char *,
const char *,
const char *,
- SOCKADDR_IN *);
+ SOCKADDR *);
void (*local_srv_req)(
struct slp_client *,
const char *,
const char *,
const char *,
const char *,
- SOCKADDR_IN *);
+ SOCKADDR *);
void (*local_attr_req)(
struct slp_client *,
const char *,
BOOL);
- void (*decode_attr_rply)( struct slp_client *, SOCKADDR_IN * );
+ void (*decode_attr_rply)( struct slp_client *, SOCKADDR * );
/** <<< Sat Jul 24 15:10:07 2004 mdd >>> end **/
BOOL (*srv_reg)(
const char *,
const char *);
- void (*decode_msg)(struct slp_client *client, SOCKADDR_IN *remote);
+ void (*decode_msg)(struct slp_client *client, SOCKADDR *remote);
- void (*decode_srvreq)(struct slp_client *, SOCKADDR_IN *);
+ void (*decode_srvreq)(struct slp_client *, SOCKADDR *);
- void (*decode_srvrply)(struct slp_client *, SOCKADDR_IN *);
+ void (*decode_srvrply)(struct slp_client *, SOCKADDR *);
- void (*decode_daadvert)( struct slp_client *, SOCKADDR_IN *);
+ void (*decode_daadvert)( struct slp_client *, SOCKADDR *);
- void (*decode_attrreq)(struct slp_client *, SOCKADDR_IN *);
+ void (*decode_attrreq)(struct slp_client *, SOCKADDR *);
BOOL (*send_rcv_udp)(struct slp_client *, BOOL) ;
BOOL,
lslpMsg *);
- BOOL (*slp_previous_responder)(struct slp_client *, char *);
-
+ BOOL (*slp_previous_responder)(struct slp_client *, char *, int);
};
struct da_list *da_node_exists(struct da_list *head, const void *key);
void free_da_list_members(struct da_list *da);
void free_da_list_node(struct da_list *da);
- void free_da_list(struct da_list *list);
- struct rply_list *alloc_rply_list(BOOL head);
- struct rply_list *rpl_node_exists(struct rply_list *head, const void *key);
- void free_rply_list_members(struct rply_list *rply);
- void free_rply_list_node(struct rply_list *rply);
- void free_rply_list(struct rply_list *list);
- struct reg_list *alloc_reg_list(BOOL head);
- struct reg_list *reg_node_exists(struct reg_list *head, const void *key);
- void free_reg_list_members(struct reg_list *reg);
- void free_reg_list_node(struct reg_list *reg);
- void free_reg_list(struct reg_list *list);
- struct url_entry *alloc_url_entry(BOOL head);
- struct url_entry *url_node_exists(struct url_entry *head, const void *key);
- void free_url_entry_members(struct url_entry *url);
- void free_url_node(struct url_entry *node);
- void free_url_list(struct url_entry *list);
- char *slp_get_host_name( char *buf, int buf_size);
#if defined(PEGASUS_OS_TYPE_WINDOWS) || \
defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined(_NUCLEUS)
int *errnop);
#endif
- char *slp_get_addr_string_from_url(
- const char *url,
- char *addr,
- int addr_len);
- char *slp_get_host_string_from_url(
- const char *url,
- char *host,
- int host_len);
- BOOL get_addr_from_url(const char *url, SOCKADDR_IN *addr, char **host);
- int slp_get_local_interfaces(uint32 **list);
- BOOL slp_join_multicast(SOCKETD sock, uint32 addr) ; //jeb
- int slp_join_multicast_all(SOCKETD sock); //jeb
- SOCKETD slp_open_listen_sock( void ); //jeb
+ void slp_get_local_interfaces(struct slp_client *client);
+ BOOL slp_join_multicast(SOCKETD sock, struct slp_if_addr addr) ;
+ int slp_join_multicast_all(SOCKETD sock, int af);
+ void slp_open_listen_sock(struct slp_client *client);
void make_srv_ack(
struct slp_client *client,
- SOCKADDR_IN *remote,
+ SOCKADDR *remote,
char response,
int16 code);
void prepare_pr_buf(struct slp_client *client, const char *address);
const char *scopes,
const char *predicate);
lslpMsg *get_response(struct slp_client *client , lslpMsg *head);
- void discovery_cycle (
- struct slp_client *client,
- const char *type,
- const char *predicate,
- const char *scopes) ;
void converge_srv_req(
struct slp_client *client,
const char *type,
const char *predicate,
const char *scopes,
- SOCKADDR_IN *addr );
+ SOCKADDR *addr );
void local_srv_req(
struct slp_client *client,
const char *type,
const char *url,
const char *scopes,
const char *tags,
- SOCKADDR_IN *addr);
+ SOCKADDR *addr);
void local_attr_req(
struct slp_client *client,
const char *tags,
BOOL retry);
- void decode_attr_rply( struct slp_client *client, SOCKADDR_IN *remote);
+ void decode_attr_rply( struct slp_client *client, SOCKADDR *remote);
/** <<< Sat Jul 24 15:10:07 2004 mdd >>> end **/
- void decode_srvreg(struct slp_client *client, SOCKADDR_IN *remote);
+ void decode_srvreg(struct slp_client *client, SOCKADDR *remote);
- void decode_msg(struct slp_client *client, SOCKADDR_IN *remote);
- void decode_srvrply( struct slp_client *client, SOCKADDR_IN *remote);
- void decode_attrreq(struct slp_client *client, SOCKADDR_IN *remote);
- void decode_daadvert(struct slp_client *client, SOCKADDR_IN *remote);
- void decode_srvreq(struct slp_client *client, SOCKADDR_IN *remote);
+ void decode_msg(struct slp_client *client, SOCKADDR *remote);
+ void decode_srvrply( struct slp_client *client, SOCKADDR *remote);
+ void decode_attrreq(struct slp_client *client, SOCKADDR *remote);
+ void decode_daadvert(struct slp_client *client, SOCKADDR *remote);
+ void decode_srvreq(struct slp_client *client, SOCKADDR *remote);
BOOL srv_reg(
struct slp_client *client,
BOOL send_rcv_udp(struct slp_client *client , BOOL retry);
- int32 __service_listener_wait(
- struct slp_client *client,
- time_t wait,
- SOCKETD extra_sock, //jeb
- BOOL one_only);
-
- int32 service_listener_wait(
- struct slp_client *client,
- time_t wait,
- SOCKETD extra_sock, //jeb
- BOOL one_only,
- lslpMsg *);
-
int32 __service_listener(
struct slp_client *client,
SOCKETD extra_sock); //jeb
const char *scopes,
uint16 lifetime); //jeb int16 to uint16
- BOOL slp_previous_responder(struct slp_client *client, char *pr_list);
+ BOOL slp_previous_responder(struct slp_client *client, char *pr_list,
+ int af);
struct lslp_srv_rply_out *_lslpProcessSrvReq(
struct slp_client *client,
struct lslp_srv_req *msg,
- int16 errCode);
+ int16 errCode,
+ SOCKADDR *remote);
/* a is an attribute list, while b is a string representation
of an ldap filter */
BOOL lslp_predicate_match(lslpAttrList *a, char *b);
const char *p,
BOOL case_sensitive);
+ SLP_STORAGE_DECL BOOL lslp_pattern_match2(
+ const char *s,
+ const char *p,
+ BOOL case_sensitive);
+
SLP_STORAGE_DECL struct slp_client *create_slp_client(
const char *target_addr,
const char *local_interface,
const char *spi,
const char *scopes,
BOOL should_listen,
- BOOL use_das);
+ BOOL use_das,
+ const char *srv_type);
SLP_STORAGE_DECL void destroy_slp_client(struct slp_client *client);
SLP_STORAGE_DECL char *encode_opaque(void *buffer, int16 length);
--- /dev/null
+//%2007////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// 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 "slp_utils.h"
+
+#include <ctype.h>
+
+#define AT_IPV4 AF_INET
+#ifdef PEGASUS_ENABLE_IPV6
+#define AT_IPV6 AF_INET6
+#else
+#define AT_IPV6 0xA
+#endif
+
+#if defined (PEGASUS_OS_TYPE_WINDOWS) || !defined (PEGASUS_ENABLE_IPV6)
+
+/*
+ Address conversion utility functions.
+*/
+
+/*
+ Converts given "src" text address (Ex: 127.0.0.1) to equivalent binary form
+ and stores in "dst" buffer (Ex 0x7f000001). Returns 1 if given ipv4 address
+ is valid or returns -1 if invalid. Returns value in network byte order.
+*/
+
+static int _inet_ptonv4(const char *src, void *dst)
+{
+ BOOL isValid = 1;
+ uint16 octetValue[4] = {0};
+ int octet, i;
+ int value;
+
+ // Check for valid IPV4 address.
+ for (octet = 1, i = 0; octet <= 4; octet++)
+ {
+ int j = 0;
+ if (!(isascii(src[i]) && isdigit(src[i])))
+ {
+ isValid = 0;
+ break;
+ }
+ while (isascii(src[i]) && isdigit(src[i]))
+ {
+ if (j == 3)
+ {
+ isValid = 0;
+ break;
+ }
+ octetValue[octet-1] = octetValue[octet-1]*10 + (src[i] - '0');
+ i++;
+ j++;
+ }
+ if (octetValue[octet-1] > 255)
+ {
+ isValid = 0;
+ break;
+ }
+ // Check for invalid character in IP address
+ if ((octet != 4) && (src[i++] != '.'))
+ {
+ isValid = 0;
+ break;
+ }
+ // Check for the case where it's a valid host name that happens
+ // to have 4 (or more) leading all-numeric host segments.
+ if ((octet == 4) && (src[i] != ':') &&
+ src[i] != 0)
+ {
+ isValid = 0;
+ break;
+ }
+ }
+ if (!isValid)
+ {
+ return 0;
+ }
+
+ // Return the value in network byte order.
+ value = octetValue[0];
+ value = (value << 8) + octetValue[1];
+ value = (value << 8) + octetValue[2];
+ value = (value << 8) + octetValue[3];
+ value = htonl(value);
+ memcpy (dst, &value, sizeof(int));
+
+ return 1;
+}
+
+/*
+ Converts given ipv6 text address (ex. ::1) to binary form and stroes
+ in "dst" buffer (ex. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1). Returns 1
+ if src ipv6 address is valid or returns -1 if invalid. Returns value
+ in network byte order.
+*/
+static int _inet_ptonv6(const char *src, void *dst)
+{
+ int ccIndex = -1;
+ int sNumber = 0;
+ uint16 sValues[8] = {0};
+ BOOL ipv4Mapped = 0;
+ int chars;
+ int i,j;
+
+ while (*src && sNumber < 8)
+ {
+ if (*src == ':')
+ {
+ if (!*++src)
+ {
+ return 0;
+ }
+ if (*src == ':')
+ {
+ if (ccIndex != -1)
+ {
+ return 0;
+ }
+ ccIndex = sNumber;
+ if (!*++src)
+ {
+ break;
+ }
+ }
+ }
+ if ((isalpha(*src) && tolower(*src) <= 'f') || isdigit(*src))
+ {
+ // Check for ipv4 compatible ipv6 or ipv4 mapped ipv6 addresses
+ if(!strchr(src, ':') && strchr(src, '.'))
+ {
+ if ( _inet_ptonv4 (src, sValues + sNumber) != 1)
+ {
+ return 0;
+ }
+ sNumber += 2;
+ ipv4Mapped = 1;
+ break;
+ }
+ chars = 0;
+ while (*src && *src != ':')
+ {
+ if (chars++ == 4)
+ {
+ return 0;
+ }
+ if (!((isalpha(*src) && tolower(*src) <= 'f') || isdigit(*src)))
+ {
+ return 0;
+ }
+ sValues[sNumber] = sValues[sNumber] * 16 +
+ (isdigit(*src) ? *src - '0' : (tolower(*src) - 'a' + 10));
+ ++src;
+ }
+ sValues[sNumber] = htons(sValues[sNumber]);
+ ++sNumber;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
+ if ((!ipv4Mapped &&*src) || (ccIndex == -1 && sNumber < 8) ||
+ (ccIndex != -1 && sNumber == 8) )
+ {
+ return 0;
+ }
+ memset(dst, 0, PEGASUS_IN6_ADDR_SIZE);
+ for (i = 0, j = 0; i < 8 ; ++i)
+ {
+ if (ccIndex == i)
+ {
+ i += 7 - sNumber;
+ }
+ else
+ {
+ memcpy ((char*) dst + i * 2, sValues + j++ , 2);
+ }
+ }
+ return 1;
+}
+
+/*
+ Converts given ipv4 address in binary form to text form. Ex. 0x7f000001
+ to 127.0.0.1.
+*/
+static const char *_inet_ntopv4(const void *src, char *dst, int size)
+{
+
+ int n;
+
+ memset(dst, 0, size);
+ memcpy(&n, src, sizeof (int));
+ n = ntohl(n);
+ sprintf(dst, "%u.%u.%u.%u", n >> 24 & 0xFF ,
+ n >> 16 & 0xFF, n >> 8 & 0xFF, n & 0xFF);
+
+ return dst;
+}
+
+/*
+ Converts given ipv6 address in binary form to text form. Ex.
+ 0000000000000001 to ::1.
+*/
+static const char *_inet_ntopv6(const void *src, char *dst, int size)
+{
+
+ uint16 n[8];
+ int ccIndex = -1;
+ int maxZeroCnt = 0;
+ int zeroCnt = 0;
+ int index = 0;
+ int i;
+ char tmp[50];
+ BOOL mapped;
+
+ memcpy (n, src, PEGASUS_IN6_ADDR_SIZE);
+ memset(dst, 0, size);
+ for (i = 0; i < 8 ; ++i)
+ {
+ if (n[i])
+ {
+ if (zeroCnt)
+ {
+ if (zeroCnt > maxZeroCnt)
+ {
+ ccIndex = index;
+ maxZeroCnt = zeroCnt;
+ }
+ zeroCnt = index = 0;
+ }
+ n[i] = ntohs (n[i]);
+ }
+ else
+ {
+ if(!zeroCnt++)
+ {
+ if (ccIndex == -1)
+ {
+ ccIndex = i;
+ }
+ index = i;
+ }
+ }
+ }
+ *dst = 0;
+ zeroCnt = 0;
+
+ for (i = 0; i < 8 ; ++i)
+ {
+ if (i == ccIndex)
+ {
+ sprintf(tmp, "::");
+ while ( i < 8 && !n[i])
+ {
+ ++i;
+ ++zeroCnt;
+ }
+ --i;
+ }
+ else
+ {
+ mapped = FALSE;
+ if (ccIndex == 0 && zeroCnt > 4)
+ {
+ // check for ipv4 mapped ipv6 and ipv4 compatible ipv6
+ // addresses.
+ if (zeroCnt == 5 && n[i] == 0xffff)
+ {
+ strcat(dst,"ffff:");
+ mapped = 1;
+ }
+ else if (zeroCnt == 6 && n[6])
+ {
+ mapped = 1;
+ }
+ }
+ if (mapped)
+ {
+ int m;
+ m = htons(n[7]);
+ m = (m << 16) + htons(n[6]);
+ slp_ntop(AF_INET, &m, tmp, 50);
+ i += 2;
+ }
+ else
+ {
+ sprintf(tmp, i < 7 && ccIndex != i + 1 ? "%x:" : "%x", n[i]);
+ }
+ }
+ strcat(dst,tmp);
+ }
+
+ return dst;
+}
+#endif // defined (PEGASUS_OS_TYPE_WINDOWS) || !defined (PEGASUS_ENABLE_IPV6)
+
+BOOL slp_addr_equal(int af, void *p1, void *p2)
+{
+ switch (af)
+ {
+ case AT_IPV6:
+ return !memcmp(p1, p2, PEGASUS_IN6_ADDR_SIZE);
+ case AT_IPV4:
+ return !memcmp(p1, p2, sizeof(struct in_addr));
+ }
+
+ return FALSE;
+}
+
+BOOL slp_is_loop_back(int af, void *addr)
+{
+#ifdef PEGASUS_ENABLE_IPV6
+ struct in6_addr ip6 = PEGASUS_IPV6_LOOPBACK_INIT;
+#endif
+ uint32 ip4 = PEGASUS_IPV4_LOOPBACK_INIT;
+ if (!addr)
+ {
+ return FALSE;
+ }
+ switch (af)
+ {
+#ifdef PEGASUS_ENABLE_IPV6
+ case AF_INET6:
+ return !memcmp(&ip6, addr, sizeof (ip6));
+#endif
+ case AF_INET:
+ {
+ uint32 n = ntohl( *(uint32*)addr);
+ return !memcmp(&ip4, &n, sizeof (ip4));
+ }
+ }
+
+ return FALSE;
+}
+
+BOOL slp_is_valid_ip6_addr(const char *ip6_addr)
+{
+ const char* p = ip6_addr;
+ int numColons = 0;
+
+#ifdef PEGASUS_ENABLE_IPV6
+ struct in6_addr iaddr;
+#else
+ char iaddr[PEGASUS_IN6_ADDR_SIZE];
+#endif
+
+ while (*p)
+ {
+ if (*p == ':')
+ numColons++;
+
+ p++;
+ }
+
+ // No need to check whether IPV6 if no colons found.
+
+ if (numColons == 0)
+ return 0;
+
+ return slp_pton(AT_IPV6,
+ (const char*)ip6_addr, (void*)&iaddr) == 1;
+}
+
+BOOL slp_is_valid_ip4_addr(const char *ip4_addr)
+{
+ const char* src = ip4_addr;
+ int octetValue[4] = {0};
+ int octet;
+ int i;
+
+ for (octet = 1, i = 0; octet <= 4; octet++)
+ {
+ int j = 0;
+
+ if (!(isascii(src[i]) && isdigit(src[i])))
+ return 0;
+
+ while (isascii(src[i]) && isdigit(src[i]))
+ {
+ if (j == 3)
+ return 0;
+
+ octetValue[octet-1] = octetValue[octet-1] * 10 + (src[i] - '0');
+ i++;
+ j++;
+ }
+
+ if (octetValue[octet-1] > 255)
+ return 0;
+
+ if ((octet != 4) && (src[i++] != '.'))
+ return 0;
+
+ if ((octet == 4) && (src[i] != ':') && src[i] != 0)
+ return 0;
+ }
+
+ return 1;
+}
+
+BOOL slp_is_valid_host_name(const char *host)
+{
+ const char *hostName = host;
+
+ int i = 0;
+ int expectHostSegment = 1;
+ int hostSegmentIsNumeric;
+ while (expectHostSegment)
+ {
+ expectHostSegment = 0;
+ hostSegmentIsNumeric = 1; // assume all-numeric host segment
+ if (!(isascii(hostName[i]) &&
+ (isalnum(hostName[i]) || (hostName[i] == '_'))))
+ {
+ return 0;
+ }
+ while (isascii(hostName[i]) &&
+ (isalnum(hostName[i]) || (hostName[i] == '-') ||
+ (hostName[i] == '_')))
+ {
+ // If a non-digit is encountered, set "all-numeric"
+ // flag to 0
+ if (isalpha(hostName[i]) || (hostName[i] == '-') ||
+ (hostName[i] == '_'))
+ {
+ hostSegmentIsNumeric = 0;
+ }
+ i++;
+ }
+ if (hostName[i] == '.')
+ {
+ i++;
+ expectHostSegment = 1;
+ }
+ }
+ // If the last Host Segment is all numeric, then return 0.
+ // RFC 1123 says "highest-level component label will be alphabetic".
+ if (hostSegmentIsNumeric || hostName[i] != 0)
+ {
+ return 0;
+ }
+
+ return 1;
+}
+
+
+int slp_pton(int af, const char *src, void *dst)
+{
+#if defined (PEGASUS_OS_TYPE_WINDOWS) || !defined (PEGASUS_ENABLE_IPV6)
+ if (af == AT_IPV4)
+ {
+ return _inet_ptonv4(src, dst);
+ }
+ else if(af == AT_IPV6 || af == 0xA)
+ {
+ return _inet_ptonv6(src, dst);
+ }
+ return -1; // Unsupported address family.
+#else
+ return inet_pton(af, src, dst);
+#endif
+}
+
+const char * slp_ntop(int af, const void *src, char *dst, int size)
+{
+#if defined (PEGASUS_OS_TYPE_WINDOWS) || !defined (PEGASUS_ENABLE_IPV6)
+ if (af == AT_IPV4)
+ {
+ return _inet_ntopv4(src, dst, size);
+ }
+ else if (af == AT_IPV6 || af == 0xA)
+ {
+ return _inet_ntopv6(src, dst, size);
+ }
+ return 0; // Unsupported address family.
+#else
+ return inet_ntop(af, src, dst, size);
+#endif
+}
+
+static int _slp_get_socket_error()
+{
+#ifdef PEGASUS_OS_TYPE_WINDOWS
+ return WSAGetLastError();
+#else
+ return errno;
+#endif
+}
+
+#ifdef PEGASUS_OS_TYPE_WINDOWS
+# define PEGASUS_INVALID_SOCKET INVALID_SOCKET
+#else
+# define PEGASUS_INVALID_SOCKET (-1)
+#endif
+
+static BOOL _slp_is_stack_active(int af)
+{
+ SOCKETD sock;
+ if ((sock = _LSLP_SOCKET(af, SOCK_STREAM, IPPROTO_TCP))
+ == SLP_INVALID_SOCKET)
+ {
+ if (_slp_get_socket_error() == SLP_INVALID_ADDRESS_FAMILY)
+ {
+ return FALSE;
+ }
+ }
+ else
+ {
+ _LSLP_CLOSESOCKET(sock);
+ }
+
+ return TRUE;
+}
+
+BOOL slp_is_ip4_stack_active()
+{
+ return _slp_is_stack_active(AF_INET);
+}
+
+#ifdef PEGASUS_ENABLE_IPV6
+BOOL slp_is_ip6_stack_active()
+{
+ return _slp_is_stack_active(AF_INET6);
+}
+
+// See RFC 3111, section 4.1
+unsigned long slp_hash(const char *pc, unsigned int len)
+{
+ unsigned long h = 0;
+ while (len-- != 0)
+ {
+ h *= 33;
+ h += *pc++;
+ }
+ return (0x3FF & h); /* round to a range of 0-1023 */
+}
+#endif
+
+BOOL slp_is_loop_back_addr(char *addr)
+{
+ char buff[PEGASUS_INET6_ADDRSTR_LEN];
+
+ if (!addr)
+ {
+ return FALSE;
+ }
+ if (slp_is_valid_ip4_addr(addr))
+ {
+ slp_pton(AF_INET, addr, buff);
+ return slp_is_loop_back(AF_INET, buff);
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ if (slp_is_valid_ip6_addr(addr))
+ {
+ slp_pton(AF_INET6, addr, buff);
+ return slp_is_loop_back(AF_INET6, buff);
+ }
+#endif
+ return FALSE;
+}
+
--- /dev/null
+//%2007////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
+// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
+// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation, The Open Group.
+// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
+// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; VERITAS Software Corporation; The Open Group.
+// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
+// EMC Corporation; Symantec Corporation; The Open Group.
+//
+// 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 Pegasus_SLP_Utils_h
+#define Pegasus_SLP_Utils_h
+
+#include <Pegasus/Common/Config.h>
+
+#ifndef NUCLEUS
+#include "lslp-common-defs.h"
+#include "lslp.h"
+#endif
+
+#ifdef PEGASUS_OS_VMS
+#include <netinet/in6.h>
+#endif
+
+# ifdef PEGASUS_OS_TYPE_WINDOWS
+# define SLP_INVALID_ADDRESS_FAMILY WSAEAFNOSUPPORT
+# elif defined(PEGASUS_OS_HPUX)
+# define SLP_INVALID_ADDRESS_FAMILY EPROTONOSUPPORT
+# else
+# define SLP_INVALID_ADDRESS_FAMILY EAFNOSUPPORT
+# endif
+
+#ifdef PEGASUS_OS_TYPE_WINDOWS
+# define SLP_INVALID_SOCKET INVALID_SOCKET
+#else
+# define SLP_INVALID_SOCKET (-1)
+#endif
+
+#ifdef PEGASUS_ENABLE_IPV6
+
+#define SOCKADDR_IN6 struct sockaddr_in6
+#define SOCKADDR_STORAGE struct sockaddr_storage
+
+#ifdef PEGASUS_HAS_GETIFADDRS
+#include <net/if.h>
+#include <ifaddrs.h> // for getifaddrs() function
+#endif
+
+#endif
+
+#ifdef SLP_LIB_IMPORT
+# define SLP_STORAGE_DECL PEGASUS_IMPORT
+#else
+# define SLP_STORAGE_DECL PEGASUS_EXPORT
+#endif
+
+#ifdef INET_ADDRSTRLEN
+#define PEGASUS_INET_ADDRSTR_LEN INET_ADDRSTRLEN
+#else
+#define PEGASUS_INET_ADDRSTR_LEN 16
+#endif
+
+#ifdef INET6_ADDRSTRLEN
+#define PEGASUS_INET6_ADDRSTR_LEN INET6_ADDRSTRLEN
+#else
+#define PEGASUS_INET6_ADDRSTR_LEN 46
+#endif
+
+#ifdef IN6ADDR_LOOPBACK_INIT
+#define PEGASUS_IPV6_LOOPBACK_INIT IN6ADDR_LOOPBACK_INIT
+#else
+#define PEGASUS_IPV6_LOOPBACK_INIT {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}
+#endif
+
+
+#ifdef INADDR_LOOPBACK
+#define PEGASUS_IPV4_LOOPBACK_INIT INADDR_LOOPBACK
+#else
+#define PEGASUS_IPV4_LOOPBACK_INIT 0x7F000001
+#endif
+
+#ifdef PEGASUS_ENABLE_IPV6
+#define PEGASUS_IN6_ADDR_SIZE (sizeof (struct in6_addr))
+#else
+#define PEGASUS_IN6_ADDR_SIZE 0x10
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+ Verifies given IPv4 Address and returns true if it is valid.
+*/
+SLP_STORAGE_DECL BOOL slp_is_valid_ip4_addr(const char *ipv4_addr);
+
+/**
+ Verifies given IPv6 Address (without brackets) and returns
+ true if it is valid.
+*/
+SLP_STORAGE_DECL BOOL slp_is_valid_ip6_addr(const char *ip6_addr);
+
+/**
+ Verifies given hostName and returns true if it is valid.
+*/
+SLP_STORAGE_DECL BOOL slp_is_valid_host_name(const char *host);
+
+/**
+ The slp_ntop (inet_ntop()) function shall convert a numeric
+ address into a text string suitable for presentation. The af argument
+ shall specify the family of the address.
+*/
+SLP_STORAGE_DECL const char *slp_ntop(int af, const void *src,
+ char *dst, int size);
+
+/*
+ The slp_pton (inet_pton()) function shall convert an
+ address in its standard text presentation form into its numeric
+ binary form.
+*/
+SLP_STORAGE_DECL int slp_pton(int af, const char *src, void *dst);
+
+/**
+ Checks whether the two addresses in binary form are equal based on
+ address family. af can be AF_INET or AF_INET6.
+*/
+SLP_STORAGE_DECL BOOL slp_addr_equal(int af, void *p1, void *p2);
+
+SLP_STORAGE_DECL BOOL slp_is_loop_back(int af, void *addr);
+
+SLP_STORAGE_DECL BOOL slp_is_loop_back_addr(char *addr);
+
+// See RFC 3111 sec 4.1
+unsigned long slp_hash(const char *pc, unsigned int len);
+
+SLP_STORAGE_DECL BOOL slp_is_ip4_stack_active();
+SLP_STORAGE_DECL BOOL slp_is_ip6_stack_active();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //Pegasus_SLP_Utils_h
-/*//%2006////////////////////////////////////////////////////////////////////////
+/*//%2006///////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//============================================================================*/
+/* NOCHKSRC */
/*****************************************************************************
* Description: encode/decode attribute urls
*
* Original Author: Mike Day md@soft-hackle.net
* mdd@us.ibm.com
*
- * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/url.l,v 1.3 2006/01/31 15:03:55 karl Exp $
+ * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/url.l,v 1.3.46.1 2008/03/20 06:16:44 s.kodali Exp $
*
* Copyright (c) 2001 - 2003 IBM
* Copyright (c) 2000 - 2003 Michael Day
*****************************************************************************/
-
%{
-
#undef YYLMAX
#define YYLMAX 2048
#define YY_NEVER_INTERACTIVE 1
reserved [;/?:@&=+$,]
uric ({reserved} | {unreserved} | {escaped})
+ /* IPv6 definitions */
+hex4 ({hex}{1,4})
+hexseq {hex4}|{hex4}(":"{hex4})*
+hexpart {hexseq}|{hexseq}"::"({hexseq})*|"::"({hexseq})*
+ip6prefix {hexpart}"/"{1}{digit}{2}
+ip4addr ({digit}{1,3})"."({digit}{1,3})"."({digit}{1,3})"."({digit}{1,3})
+ip6addr {hexpart}|{hexpart}":"{ip4addr}
+
%x IP_SITE
%x AT_SITE
%x ATTRIBUTE
/* this next rule needs to kick in even if it matches a zero-length string */
/* i.e., it needs to be guaranteed even if there is no user @ host production */
-<IP_SITE>[-_.!~*'()a-zA-Z0-9;+&=\%]* {
+<IP_SITE>[-_.!~*'()a-zA-Z0-9;+&=\%]*|"["{ip6addr}"]" {
BEGIN INITIAL;
if (urlleng > 0)
{
}
/* an ipv4 address */
-({hex}{1,3})"."({hex}{1,3})"."({hex}{1,3})"."({hex}{1,3}) {
+({hex}{1,3})"."({hex}{1,3})"."({hex}{1,3})"."({hex}{1,3})|"["{ip6addr}"]" {
if(NULL != (urllval._s = _lslp_strdup(urltext)))
return(_IPADDR);
else
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//==============================================================================
+/* NOCHKSRC */
/*****************************************************************************
* Description: encode/decode attribute urls
*
* Original Author: Mike Day md@soft-hackle.net
* mdd@us.ibm.com
*
- * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/url.y,v 1.4 2007/02/15 08:25:59 mreddy Exp $
+ * $Header: /cvs/MSB/pegasus/src/slp/slp_client/src/cmd-utils/slp_client/url.y,v 1.4.12.1 2008/03/20 06:16:44 s.kodali Exp $
*
* Copyright (c) 2001 - 2003 IBM
* Copyright (c) 2000 - 2003 Michael Day
void url_close_lexer(uint32 handle);
size_t url_init_lexer(const char *s);
-lslpAtomizedURL urlHead =
-{
- &urlHead, &urlHead, TRUE, NULL, 0
-};
static lslpAtomList srvcHead = {&srvcHead, &srvcHead, TRUE, NULL, 0};
static lslpAtomList siteHead = {&siteHead, &siteHead, TRUE, NULL, 0};
static lslpAtomList pathHead = {&pathHead, &pathHead, TRUE, NULL, 0};
static lslpAtomList attrHead = {&attrHead, &attrHead, TRUE, NULL, 0};
+lslpAtomizedURL urlHead =
+{
+ &urlHead,
+ &urlHead,
+ TRUE,
+ NULL,
+ 0,
+ {&srvcHead, &srvcHead, TRUE, NULL, 0},
+ {&siteHead, &siteHead, TRUE, NULL, 0},
+ {&pathHead, &pathHead, TRUE, NULL, 0},
+ {&attrHead, &attrHead, TRUE, NULL, 0}
+};
+
%}
/* definitions for ytab.h */
;
hostport: host {
- $$ = $1;
+ if (NULL != ($$ = (char *)calloc(strlen($1) + 2, sizeof(char))))
+ {
+ strcpy($$, $1);
+ }
}
| host ':' _HEXDIG {
if ($1 != NULL)
// 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.
//
-//==============================================================================
-/* A Bison parser, made by GNU Bison 1.875c. */
+//=============================================================================
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+//NOCHKSRC
+
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
-/* Written by Richard Stallman by simplifying the original so called
- ``semantic'' parser. */
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+ simplifying the original so-called "semantic" parser. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
/* Identify Bison output. */
#define YYBISON 1
+/* Bison version. */
+#define YYBISON_VERSION "2.3"
+
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Using locations. */
#define YYLSP_NEEDED 0
-/* If NAME_PREFIX is specified substitute the variables and functions
- names. */
+/* Substitute the variable and function names. */
#define yyparse attrparse
#define yylex attrlex
#define yyerror attrerror
_OPAQUE = 265
};
#endif
+/* Tokens. */
#define _TRUE 258
#define _FALSE 259
#define _MULTIVAL 260
/* Copy the first part of user declarations. */
-#line 66 "attr.y"
+#line 68 "attr.y"
#include "slp_client.h"
void attrerror(const char *, ...);
lslpAttrList attrHead =
{
- &attrHead, &attrHead, TRUE
+ &attrHead, &attrHead, TRUE, 0, 0, 0, 0, 0, 0
};
lslpAttrList inProcessAttr =
{
- &inProcessAttr, &inProcessAttr, TRUE
+ &inProcessAttr, &inProcessAttr, TRUE, 0, 0, 0, 0, 0, 0
};
lslpAttrList inProcessTag =
{
- &inProcessTag, &inProcessTag, TRUE
+ &inProcessTag, &inProcessTag, TRUE, 0, 0, 0, 0, 0, 0
};
# define YYERROR_VERBOSE 0
#endif
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 97 "attr.y"
-typedef union YYSTYPE {
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 99 "attr.y"
+{
int32 _i;
char *_s;
lslpAttrList *_atl;
-} YYSTYPE;
-/* Line 191 of yacc.c. */
-#line 139 "y_attr.c"
+}
+/* Line 193 of yacc.c. */
+#line 158 "y_attr.c"
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
/* Copy the second part of user declarations. */
-/* Line 214 of yacc.c. */
-#line 151 "y_attr.c"
+/* Line 216 of yacc.c. */
+#line 171 "y_attr.c"
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+# define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+# define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# else
+# define YYSIZE_T unsigned int
+# endif
+#endif
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-# ifndef YYFREE
-# define YYFREE free
+#ifndef YY_
+# if YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# endif
# endif
-# ifndef YYMALLOC
-# define YYMALLOC malloc
+# ifndef YY_
+# define YY_(msgid) msgid
# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E. */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions. */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+ int i;
+#endif
+{
+ return i;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
# ifdef YYSTACK_USE_ALLOCA
# if YYSTACK_USE_ALLOCA
-# define YYSTACK_ALLOC alloca
-# endif
-# else
-# if defined (alloca) || defined (_ALLOCA_H)
-# define YYSTACK_ALLOC alloca
-# else
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
+# elif defined __BUILTIN_VA_ARG_INCR
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+# elif defined _AIX
+# define YYSTACK_ALLOC __alloca
+# elif defined _MSC_VER
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+# define alloca _alloca
+# else
+# define YYSTACK_ALLOC alloca
+# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
+# endif
+# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# else
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+# ifndef YYSTACK_ALLOC_MAXIMUM
+ /* The OS might guarantee only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
+ to allow for a few compiler-allocated temporary stack slots. */
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
# endif
+# else
# define YYSTACK_ALLOC YYMALLOC
# define YYSTACK_FREE YYFREE
+# ifndef YYSTACK_ALLOC_MAXIMUM
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+# endif
+# if (defined __cplusplus && ! defined _STDLIB_H \
+ && ! ((defined YYMALLOC || defined malloc) \
+ && (defined YYFREE || defined free)))
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
+# endif
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# ifndef YYFREE
+# define YYFREE free
+# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
# endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+#if (! defined yyoverflow \
+ && (! defined __cplusplus \
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- short yyss;
+ yytype_int16 yyss;
YYSTYPE yyvs;
};
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
-# if defined (__GNUC__) && 1 < __GNUC__
+# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
- register YYSIZE_T yyi; \
+ YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
- while (0)
+ while (YYID (0))
# endif
# endif
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
- while (0)
+ while (YYID (0))
#endif
-#if defined (__STDC__) || defined (__cplusplus)
- typedef signed char yysigned_char;
-#else
- typedef short yysigned_char;
-#endif
-
-/* YYFINAL -- State number of the termination state. */
+/* YYFINAL -- State number of the termination state. */
#define YYFINAL 6
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 24
-/* YYNTOKENS -- Number of terminals. */
+/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 15
-/* YYNNTS -- Number of nonterminals. */
+/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 5
-/* YYNRULES -- Number of rules. */
+/* YYNRULES -- Number of rules. */
#define YYNRULES 14
-/* YYNRULES -- Number of states. */
+/* YYNRULES -- Number of states. */
#define YYNSTATES 22
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 265
-#define YYTRANSLATE(YYX) \
+#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const unsigned char yytranslate[] =
+static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
-static const unsigned char yyprhs[] =
+static const yytype_uint8 yyprhs[] =
{
0, 0, 3, 5, 9, 11, 15, 20, 26, 28,
32, 34, 36, 38, 40
};
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yytype_int8 yyrhs[] =
{
16, 0, -1, 17, -1, 16, 11, 17, -1, 8,
-1, 12, 8, 13, -1, 12, 8, 14, 13, -1,
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const unsigned char yyrline[] =
+static const yytype_uint8 yyrline[] =
{
- 0, 113, 113, 123, 135, 142, 149, 157, 169, 176,
- 183, 186, 189, 192, 206
+ 0, 115, 115, 125, 137, 144, 151, 159, 171, 178,
+ 185, 188, 191, 194, 208
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE
-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "_TRUE", "_FALSE", "_MULTIVAL", "_INT",
# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
token YYLEX-NUM. */
-static const unsigned short yytoknum[] =
+static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 44, 40, 41, 61
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const unsigned char yyr1[] =
+static const yytype_uint8 yyr1[] =
{
0, 15, 16, 16, 17, 17, 17, 17, 18, 18,
19, 19, 19, 19, 19
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const unsigned char yyr2[] =
+static const yytype_uint8 yyr2[] =
{
0, 2, 1, 3, 1, 3, 4, 5, 1, 3,
1, 1, 1, 1, 1
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
-static const unsigned char yydefact[] =
+static const yytype_uint8 yydefact[] =
{
0, 4, 0, 0, 2, 0, 1, 0, 5, 0,
3, 10, 11, 14, 12, 13, 6, 0, 8, 0,
7, 9
};
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int8 yydefgoto[] =
{
-1, 3, 4, 17, 18
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -13
-static const yysigned_char yypact[] =
+static const yytype_int8 yypact[] =
{
12, -13, 2, 0, -13, 8, -13, 12, -13, -1,
-13, -13, -13, -13, -13, -13, -13, -4, -13, 10,
};
/* YYPGOTO[NTERM-NUM]. */
-static const yysigned_char yypgoto[] =
+static const yytype_int8 yypgoto[] =
{
-13, -13, -3, -13, -12
};
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -1
-static const unsigned char yytable[] =
+static const yytype_uint8 yytable[] =
{
6, 19, 11, 12, 10, 13, 14, 21, 15, 20,
5, 7, 16, 11, 12, 0, 13, 14, 0, 15,
1, 8, 9, 0, 2
};
-static const yysigned_char yycheck[] =
+static const yytype_int8 yycheck[] =
{
0, 5, 3, 4, 7, 6, 7, 19, 9, 13,
8, 11, 13, 3, 4, -1, 6, 7, -1, 9,
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
-static const unsigned char yystos[] =
+static const yytype_uint8 yystos[] =
{
0, 8, 12, 16, 17, 8, 0, 11, 13, 14,
17, 3, 4, 6, 7, 9, 13, 18, 19, 5,
13, 19
};
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
-#endif
-
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY (-2)
yychar = (Token); \
yylval = (Value); \
yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
+ YYPOPSTACK (1); \
goto yybackup; \
} \
else \
- { \
- yyerror ("syntax error: cannot back up");\
+ { \
+ yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
-while (0)
+while (YYID (0))
+
#define YYTERROR 1
#define YYERRCODE 256
-/* YYLLOC_DEFAULT -- Compute the default location (before the actions
- are run). */
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+ If N is 0, then set CURRENT to the empty location which ends
+ the previous symbol: RHS[0] (always defined). */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- ((Current).first_line = (Rhs)[1].first_line, \
- (Current).first_column = (Rhs)[1].first_column, \
- (Current).last_line = (Rhs)[N].last_line, \
- (Current).last_column = (Rhs)[N].last_column)
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (YYID (N)) \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
+ while (YYID (0))
#endif
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+ This macro was not mandated originally: define only if we know
+ we won't break user code: when these are the locations we know. */
+
+#ifndef YY_LOCATION_PRINT
+# if YYLTYPE_IS_TRIVIAL
+# define YY_LOCATION_PRINT(File, Loc) \
+ fprintf (File, "%d.%d-%d.%d", \
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
/* YYLEX -- calling `yylex' with the right arguments. */
#ifdef YYLEX_PARAM
do { \
if (yydebug) \
YYFPRINTF Args; \
-} while (0)
+} while (YYID (0))
-# define YYDSYMPRINT(Args) \
-do { \
- if (yydebug) \
- yysymprint Args; \
-} while (0)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (YYID (0))
-# define YYDSYMPRINTF(Title, Token, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
- Token, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (0)
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE const * const yyvaluep;
+#endif
+{
+ if (!yyvaluep)
+ return;
+# ifdef YYPRINT
+ if (yytype < YYNTOKENS)
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+ YYUSE (yyoutput);
+# endif
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE const * const yyvaluep;
+#endif
+{
+ if (yytype < YYNTOKENS)
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+ else
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+ YYFPRINTF (yyoutput, ")");
+}
/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included). |
`------------------------------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (short *bottom, short *top)
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
#else
static void
yy_stack_print (bottom, top)
- short *bottom;
- short *top;
+ yytype_int16 *bottom;
+ yytype_int16 *top;
#endif
{
YYFPRINTF (stderr, "Stack now");
- for (/* Nothing. */; bottom <= top; ++bottom)
+ for (; bottom <= top; ++bottom)
YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
-} while (0)
+} while (YYID (0))
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (int yyrule)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
#else
static void
-yy_reduce_print (yyrule)
+yy_reduce_print (yyvsp, yyrule)
+ YYSTYPE *yyvsp;
int yyrule;
#endif
{
+ int yynrhs = yyr2[yyrule];
int yyi;
- unsigned int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
- yyrule - 1, yylno);
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
- YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
- YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+ unsigned long int yylno = yyrline[yyrule];
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ yyrule - 1, yylno);
+ /* The symbols being reduced. */
+ for (yyi = 0; yyi < yynrhs; yyi++)
+ {
+ fprintf (stderr, " $%d = ", yyi + 1);
+ yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ );
+ fprintf (stderr, "\n");
+ }
}
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
- yy_reduce_print (Rule); \
-} while (0)
+ yy_reduce_print (yyvsp, Rule); \
+} while (YYID (0))
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
-# define YYDSYMPRINT(Args)
-# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
if the built-in stack extension method is used).
Do not make this value too large; the results are undefined if
- SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */
-#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
-# undef YYMAXDEPTH
-#endif
-
#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif
#if YYERROR_VERBOSE
# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
+# if defined __GLIBC__ && defined _STRING_H
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
-# else
+#else
+static YYSIZE_T
yystrlen (yystr)
- const char *yystr;
-# endif
+ const char *yystr;
+#endif
{
- register const char *yys = yystr;
-
- while (*yys++ != '\0')
+ YYSIZE_T yylen;
+ for (yylen = 0; yystr[yylen]; yylen++)
continue;
-
- return yys - yystr - 1;
+ return yylen;
}
# endif
# endif
# ifndef yystpcpy
-# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static char *
-# if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
-# else
+#else
+static char *
yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
+ char *yydest;
+ const char *yysrc;
+#endif
{
- register char *yyd = yydest;
- register const char *yys = yysrc;
+ char *yyd = yydest;
+ const char *yys = yysrc;
while ((*yyd++ = *yys++) != '\0')
continue;
# endif
# endif
-#endif /* !YYERROR_VERBOSE */
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+ quotes and backslashes, so that it's suitable for yyerror. The
+ heuristic is that double-quoting is unnecessary unless the string
+ contains an apostrophe, a comma, or backslash (other than
+ backslash-backslash). YYSTR is taken from yytname. If YYRES is
+ null, do not copy; instead, return the length of what the result
+ would have been. */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+ if (*yystr == '"')
+ {
+ YYSIZE_T yyn = 0;
+ char const *yyp = yystr;
+
+ for (;;)
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
+ do_not_strip_quotes: ;
+ }
-\f
+ if (! yyres)
+ return yystrlen (yystr);
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+ return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
+/* Copy into YYRESULT an error message about the unexpected token
+ YYCHAR while in state YYSTATE. Return the number of bytes copied,
+ including the terminating null byte. If YYRESULT is null, do not
+ copy anything; just return the number of bytes that would be
+ copied. As a special case, return 0 if an ordinary "syntax error"
+ message will do. Return YYSIZE_MAXIMUM if overflow occurs during
+ size calculation. */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
+ int yyn = yypact[yystate];
- if (yytype < YYNTOKENS)
- {
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-# ifdef YYPRINT
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- }
+ if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+ return 0;
else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
- switch (yytype)
{
- default:
- break;
+ int yytype = YYTRANSLATE (yychar);
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ int yysize_overflow = 0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ int yyx;
+
+# if 0
+ /* This is so xgettext sees the translatable formats that are
+ constructed on the fly. */
+ YY_("syntax error, unexpected %s");
+ YY_("syntax error, unexpected %s, expecting %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+ char *yyfmt;
+ char const *yyf;
+ static char const yyunexpected[] = "syntax error, unexpected %s";
+ static char const yyexpecting[] = ", expecting %s";
+ static char const yyor[] = " or %s";
+ char yyformat[sizeof yyunexpected
+ + sizeof yyexpecting - 1
+ + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+ * (sizeof yyor - 1))];
+ char const *yyprefix = yyexpecting;
+
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 1;
+
+ yyarg[0] = yytname[yytype];
+ yyfmt = yystpcpy (yyformat, yyunexpected);
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ yyformat[sizeof yyunexpected - 1] = '\0';
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+ yyfmt = yystpcpy (yyfmt, yyprefix);
+ yyprefix = yyor;
+ }
+
+ yyf = YY_(yyformat);
+ yysize1 = yysize + yystrlen (yyf);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+
+ if (yysize_overflow)
+ return YYSIZE_MAXIMUM;
+
+ if (yyresult)
+ {
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ char *yyp = yyresult;
+ int yyi = 0;
+ while ((*yyp = *yyf) != '\0')
+ {
+ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyf += 2;
+ }
+ else
+ {
+ yyp++;
+ yyf++;
+ }
+ }
+ }
+ return yysize;
}
- YYFPRINTF (yyoutput, ")");
}
+#endif /* YYERROR_VERBOSE */
+\f
-#endif /* ! YYDEBUG */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yydestruct (int yytype, YYSTYPE *yyvaluep)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#else
static void
-yydestruct (yytype, yyvaluep)
+yydestruct (yymsg, yytype, yyvaluep)
+ const char *yymsg;
int yytype;
YYSTYPE *yyvaluep;
#endif
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
+ YYUSE (yyvaluep);
+
+ if (!yymsg)
+ yymsg = "Deleting";
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
switch (yytype)
{
default:
- break;
+ break;
}
}
\f
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
-# else
+#else
int yyparse ();
-# endif
+#endif
#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
-/* The lookahead symbol. */
+/* The look-ahead symbol. */
int yychar;
-/* The semantic value of the lookahead symbol. */
+/* The semantic value of the look-ahead symbol. */
YYSTYPE yylval;
/* Number of syntax errors so far. */
`----------*/
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-# endif
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+ void *YYPARSE_PARAM;
+#endif
#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
int
yyparse (void)
#else
#endif
{
- register int yystate;
- register int yyn;
+ int yystate;
+ int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
- /* Lookahead token as an internal (translated) token number. */
+ /* Look-ahead token as an internal (translated) token number. */
int yytoken = 0;
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
/* Three stacks and their tools:
`yyss': related to states,
to reallocate them elsewhere. */
/* The state stack. */
- short yyssa[YYINITDEPTH];
- short *yyss = yyssa;
- register short *yyssp;
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss = yyssa;
+ yytype_int16 *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
- register YYSTYPE *yyvsp;
+ YYSTYPE *yyvsp;
-#define YYPOPSTACK (yyvsp--, yyssp--)
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
YYSIZE_T yystacksize = YYINITDEPTH;
YYSTYPE yyval;
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
- int yylen;
+ /* The number of symbols on the RHS of the reduced rule.
+ Keep to zero when no symbol should be popped. */
+ int yylen = 0;
YYDPRINTF ((stderr, "Starting parse\n"));
`------------------------------------------------------------*/
yynewstate:
/* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks.
- */
+ have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
yysetstate:
#ifdef yyoverflow
{
- /* Give user a chance to reallocate the stack. Use copies of
+ /* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
+ yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
- yyoverflow ("parser stack overflow",
+ yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
- goto yyoverflowlab;
+ goto yyexhaustedlab;
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyoverflowlab;
+ goto yyexhaustedlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH;
{
- short *yyss1 = yyss;
+ yytype_int16 *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
- goto yyoverflowlab;
+ goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs);
`-----------*/
yybackup:
-/* Do appropriate processing given the current state. */
-/* Read a lookahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to lookahead token. */
+ /* Do appropriate processing given the current state. Read a
+ look-ahead token if we need one and don't already have one. */
+ /* First try to decide what to do without reference to look-ahead token. */
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
- /* Not known => get a lookahead token if don't already have one. */
+ /* Not known => get a look-ahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
else
{
yytoken = YYTRANSLATE (yychar);
- YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
}
/* If the proper action on seeing token YYTOKEN is to reduce or to
if (yyn == YYFINAL)
YYACCEPT;
- /* Shift the lookahead token. */
- YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-
-
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
+ /* Shift the look-ahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+ /* Discard the shifted token unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
yystate = yyn;
+ *++yyvsp = yylval;
+
goto yynewstate;
switch (yyn)
{
case 2:
-#line 113 "attr.y"
+#line 115 "attr.y"
{
while (! _LSLP_IS_HEAD(inProcessAttr.next))
{
- yyval._atl = inProcessAttr.next;
- _LSLP_UNLINK(yyval._atl);
- _LSLP_INSERT_BEFORE(yyval._atl, &attrHead);
+ (yyval._atl) = inProcessAttr.next;
+ _LSLP_UNLINK((yyval._atl));
+ _LSLP_INSERT_BEFORE((yyval._atl), &attrHead);
}
/* all we really want to do here is link each attribute */
/* to the global list head. */
break;
case 3:
-#line 123 "attr.y"
+#line 125 "attr.y"
{
/* both of these non-terminals are really lists */
/* ignore the first non-terminal */
while (! _LSLP_IS_HEAD(inProcessAttr.next))
{
- yyval._atl = inProcessAttr.next;
- _LSLP_UNLINK(yyval._atl);
- _LSLP_INSERT_BEFORE(yyval._atl, &attrHead);
+ (yyval._atl) = inProcessAttr.next;
+ _LSLP_UNLINK((yyval._atl));
+ _LSLP_INSERT_BEFORE((yyval._atl), &attrHead);
}
;}
break;
case 4:
-#line 135 "attr.y"
+#line 137 "attr.y"
{
- yyval._atl = lslpAllocAttr(yyvsp[0]._s, tag, NULL, 0);
- if (NULL != yyval._atl)
+ (yyval._atl) = lslpAllocAttr((yyvsp[(1) - (1)]._s), tag, NULL, 0);
+ if (NULL != (yyval._atl))
{
- _LSLP_INSERT_BEFORE(yyval._atl, &inProcessAttr);
+ _LSLP_INSERT_BEFORE((yyval._atl), &inProcessAttr);
}
;}
break;
case 5:
-#line 142 "attr.y"
+#line 144 "attr.y"
{
- yyval._atl = lslpAllocAttr(yyvsp[-1]._s, tag, NULL, 0);
- if (NULL != yyval._atl)
+ (yyval._atl) = lslpAllocAttr((yyvsp[(2) - (3)]._s), tag, NULL, 0);
+ if (NULL != (yyval._atl))
{
- _LSLP_INSERT_BEFORE(yyval._atl, &inProcessAttr);
+ _LSLP_INSERT_BEFORE((yyval._atl), &inProcessAttr);
}
;}
break;
case 6:
-#line 149 "attr.y"
+#line 151 "attr.y"
{
- yyval._atl = lslpAllocAttr(yyvsp[-2]._s, tag, NULL, 0);
- if (NULL != yyval._atl)
+ (yyval._atl) = lslpAllocAttr((yyvsp[(2) - (4)]._s), tag, NULL, 0);
+ if (NULL != (yyval._atl))
{
- _LSLP_INSERT_BEFORE(yyval._atl, &inProcessAttr);
+ _LSLP_INSERT_BEFORE((yyval._atl), &inProcessAttr);
}
;}
break;
case 7:
-#line 157 "attr.y"
+#line 159 "attr.y"
{
- yyval._atl = inProcessTag.next;
- while (! _LSLP_IS_HEAD(yyval._atl))
+ (yyval._atl) = inProcessTag.next;
+ while (! _LSLP_IS_HEAD((yyval._atl)))
{
- yyval._atl->name = strdup(yyvsp[-3]._s);
- _LSLP_UNLINK(yyval._atl);
- _LSLP_INSERT_BEFORE(yyval._atl, &inProcessAttr);
- yyval._atl = inProcessTag.next;
+ (yyval._atl)->name = strdup((yyvsp[(2) - (5)]._s));
+ _LSLP_UNLINK((yyval._atl));
+ _LSLP_INSERT_BEFORE((yyval._atl), &inProcessAttr);
+ (yyval._atl) = inProcessTag.next;
}
;}
break;
case 8:
-#line 169 "attr.y"
+#line 171 "attr.y"
{
- if(NULL != yyvsp[0]._atl)
+ if(NULL != (yyvsp[(1) - (1)]._atl))
{
- _LSLP_INSERT(yyvsp[0]._atl, &inProcessTag);
+ _LSLP_INSERT((yyvsp[(1) - (1)]._atl), &inProcessTag);
}
;}
break;
case 9:
-#line 176 "attr.y"
+#line 178 "attr.y"
{
- if (NULL != yyvsp[0]._atl)
+ if (NULL != (yyvsp[(3) - (3)]._atl))
{
- _LSLP_INSERT_BEFORE(yyvsp[0]._atl, &inProcessTag);
+ _LSLP_INSERT_BEFORE((yyvsp[(3) - (3)]._atl), &inProcessTag);
}
;}
break;
case 10:
-#line 183 "attr.y"
+#line 185 "attr.y"
{
- yyval._atl = lslpAllocAttr(NULL, bool_type, &bt, sizeof(BOOL));
+ (yyval._atl) = lslpAllocAttr(NULL, bool_type, &bt, sizeof(BOOL));
;}
break;
case 11:
-#line 186 "attr.y"
+#line 188 "attr.y"
{
- yyval._atl = lslpAllocAttr(NULL, bool_type, &bf, sizeof(BOOL));
+ (yyval._atl) = lslpAllocAttr(NULL, bool_type, &bf, sizeof(BOOL));
;}
break;
case 12:
-#line 189 "attr.y"
+#line 191 "attr.y"
{
- yyval._atl = lslpAllocAttr(NULL, opaque, yyvsp[0]._s, (int16)(strlen(yyvsp[0]._s) + 1));
+ (yyval._atl) = lslpAllocAttr(NULL, opaque, (yyvsp[(1) - (1)]._s), (int16)(strlen((yyvsp[(1) - (1)]._s)) + 1));
;}
break;
case 13:
-#line 192 "attr.y"
+#line 194 "attr.y"
{
- if(strlen(yyvsp[0]._s) > 5 ) {
- if( *(yyvsp[0]._s) == '\\' && ((*(yyvsp[0]._s + 1) == 'f') || (*(yyvsp[0]._s + 1) == 'F')) && ((*(yyvsp[0]._s + 2) == 'f') || (*(yyvsp[0]._s + 2) == 'F'))) {
- yyval._atl = lslpAllocAttr(NULL, opaque, yyvsp[0]._s, (int16)(strlen(yyvsp[0]._s) + 1));
+ if(strlen((yyvsp[(1) - (1)]._s)) > 5 ) {
+ if( *((yyvsp[(1) - (1)]._s)) == '\\' && ((*((yyvsp[(1) - (1)]._s) + 1) == 'f') || (*((yyvsp[(1) - (1)]._s) + 1) == 'F')) && ((*((yyvsp[(1) - (1)]._s) + 2) == 'f') || (*((yyvsp[(1) - (1)]._s) + 2) == 'F'))) {
+ (yyval._atl) = lslpAllocAttr(NULL, opaque, (yyvsp[(1) - (1)]._s), (int16)(strlen((yyvsp[(1) - (1)]._s)) + 1));
} else {
- yyval._atl = lslpAllocAttr(NULL, string, yyvsp[0]._s, (int16)(strlen(yyvsp[0]._s) + 1));
+ (yyval._atl) = lslpAllocAttr(NULL, string, (yyvsp[(1) - (1)]._s), (int16)(strlen((yyvsp[(1) - (1)]._s)) + 1));
}
}
else {
- yyval._atl = lslpAllocAttr(NULL, string, yyvsp[0]._s, (int16)(strlen(yyvsp[0]._s) + 1));
+ (yyval._atl) = lslpAllocAttr(NULL, string, (yyvsp[(1) - (1)]._s), (int16)(strlen((yyvsp[(1) - (1)]._s)) + 1));
}
;}
break;
case 14:
-#line 206 "attr.y"
+#line 208 "attr.y"
{
- yyval._atl = lslpAllocAttr(NULL, integer, &(yyvsp[0]._i), sizeof(int32));
+ (yyval._atl) = lslpAllocAttr(NULL, integer, &((yyvsp[(1) - (1)]._i)), sizeof(int32));
;}
break;
+/* Line 1267 of yacc.c. */
+#line 1512 "y_attr.c"
+ default: break;
}
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-/* Line 1000 of yacc.c. */
-#line 1181 "y_attr.c"
-\f
- yyvsp -= yylen;
- yyssp -= yylen;
-
-
+ YYPOPSTACK (yylen);
+ yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
if (!yyerrstatus)
{
++yynerrs;
-#if YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (YYPACT_NINF < yyn && yyn < YYLAST)
- {
- YYSIZE_T yysize = 0;
- int yytype = YYTRANSLATE (yychar);
- const char* yyprefix;
- char *yymsg;
- int yyx;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 0;
-
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+#if ! YYERROR_VERBOSE
+ yyerror (YY_("syntax error"));
+#else
+ {
+ YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+ if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+ {
+ YYSIZE_T yyalloc = 2 * yysize;
+ if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+ yyalloc = YYSTACK_ALLOC_MAXIMUM;
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+ if (yymsg)
+ yymsg_alloc = yyalloc;
+ else
{
- yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
- yycount += 1;
- if (yycount == 5)
- {
- yysize = 0;
- break;
- }
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
}
- yysize += (sizeof ("syntax error, unexpected ")
- + yystrlen (yytname[yytype]));
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg != 0)
- {
- char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
- yyp = yystpcpy (yyp, yytname[yytype]);
-
- if (yycount < 5)
- {
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- yyp = yystpcpy (yyp, yyprefix);
- yyp = yystpcpy (yyp, yytname[yyx]);
- yyprefix = " or ";
- }
- }
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
- }
- else
- yyerror ("syntax error; also virtual memory exhausted");
- }
- else
-#endif /* YYERROR_VERBOSE */
- yyerror ("syntax error");
+ }
+
+ if (0 < yysize && yysize <= yymsg_alloc)
+ {
+ (void) yysyntax_error (yymsg, yystate, yychar);
+ yyerror (yymsg);
+ }
+ else
+ {
+ yyerror (YY_("syntax error"));
+ if (yysize != 0)
+ goto yyexhaustedlab;
+ }
+ }
+#endif
}
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse lookahead token after an
+ /* If just tried and failed to reuse look-ahead token after an
error, discard it. */
if (yychar <= YYEOF)
- {
- /* If at end of input, pop the error token,
- then the rest of the stack, then return failure. */
+ {
+ /* Return failure if at end of input. */
if (yychar == YYEOF)
- for (;;)
- {
- YYPOPSTACK;
- if (yyssp == yyss)
- YYABORT;
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[*yyssp], yyvsp);
- }
- }
+ YYABORT;
+ }
else
{
- YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
- yydestruct (yytoken, &yylval);
+ yydestruct ("Error: discarding",
+ yytoken, &yylval);
yychar = YYEMPTY;
-
}
}
- /* Else will try to reuse lookahead token after shifting the error
+ /* Else will try to reuse look-ahead token after shifting the error
token. */
goto yyerrlab1;
`---------------------------------------------------*/
yyerrorlab:
-#ifdef __GNUC__
- /* Pacify GCC when the user code never invokes YYERROR and the label
- yyerrorlab therefore never appears in user code. */
- if (0)
+ /* Pacify compilers like GCC when the user code never invokes
+ YYERROR and the label yyerrorlab therefore never appears in user
+ code. */
+ if (/*CONSTCOND*/ 0)
goto yyerrorlab;
-#endif
- yyvsp -= yylen;
- yyssp -= yylen;
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYERROR. */
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
yystate = *yyssp;
goto yyerrlab1;
if (yyssp == yyss)
YYABORT;
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[yystate], yyvsp);
- YYPOPSTACK;
+
+ yydestruct ("Error: popping",
+ yystos[yystate], yyvsp);
+ YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
if (yyn == YYFINAL)
YYACCEPT;
- YYDPRINTF ((stderr, "Shifting error token, "));
-
*++yyvsp = yylval;
+ /* Shift the error token. */
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
yystate = yyn;
goto yynewstate;
goto yyreturn;
#ifndef yyoverflow
-/*----------------------------------------------.
-| yyoverflowlab -- parser overflow comes here. |
-`----------------------------------------------*/
-yyoverflowlab:
- yyerror ("parser stack overflow");
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here. |
+`-------------------------------------------------*/
+yyexhaustedlab:
+ yyerror (YY_("memory exhausted"));
yyresult = 2;
/* Fall through. */
#endif
yyreturn:
+ if (yychar != YYEOF && yychar != YYEMPTY)
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval);
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYABORT or YYACCEPT. */
+ YYPOPSTACK (yylen);
+ YY_STACK_PRINT (yyss, yyssp);
+ while (yyssp != yyss)
+ {
+ yydestruct ("Cleanup: popping",
+ yystos[*yyssp], yyvsp);
+ YYPOPSTACK (1);
+ }
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
- return yyresult;
+#if YYERROR_VERBOSE
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+#endif
+ /* Make sure YYID is used. */
+ return YYID (yyresult);
}
-#line 211 "attr.y"
+#line 213 "attr.y"
void _lslpInitInternalAttrList(void)
// 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.
//
-//==============================================================================
-/* A Bison parser, made by GNU Bison 1.875c. */
+//=============================================================================
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+//NOCHKSRC
+
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
_OPAQUE = 265
};
#endif
+/* Tokens. */
#define _TRUE 258
#define _FALSE 259
#define _MULTIVAL 260
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 97 "attr.y"
-typedef union YYSTYPE {
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 99 "attr.y"
+{
int32 _i;
char *_s;
lslpAttrList *_atl;
-} YYSTYPE;
-/* Line 1275 of yacc.c. */
-#line 63 "y_attr.h"
+}
+/* Line 1529 of yacc.c. */
+#line 75 "y_attr.h"
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
extern YYSTYPE attrlval;
-
-
// 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.
//
-//==============================================================================
+//=============================================================================
Terminals which are not used
_OPAQUE
// 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.
//
-//==============================================================================
-/* A Bison parser, made by GNU Bison 1.875c. */
+//=============================================================================
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+//NOCHKSRC
+
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
-/* Written by Richard Stallman by simplifying the original so called
- ``semantic'' parser. */
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+ simplifying the original so-called "semantic" parser. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
/* Identify Bison output. */
#define YYBISON 1
+/* Bison version. */
+#define YYBISON_VERSION "2.3"
+
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Using locations. */
#define YYLSP_NEEDED 0
-/* If NAME_PREFIX is specified substitute the variables and functions
- names. */
+/* Substitute the variable and function names. */
#define yyparse filterparse
#define yylex filterlex
#define yyerror filtererror
OPERAND = 270
};
#endif
+/* Tokens. */
#define L_PAREN 258
#define R_PAREN 259
#define OP_AND 260
/* Copy the first part of user declarations. */
-#line 65 "filter.y"
+#line 68 "filter.y"
#include "slp_client.h"
/* need to free is available from the list heads below. */
/* listhead for reduced filters until the parser is finished */
- filterHead reducedFilters = { &reducedFilters, &reducedFilters, TRUE } ;
+ filterHead reducedFilters = { &reducedFilters, &reducedFilters, TRUE, FALSE};
int nesting_level;
# define YYERROR_VERBOSE 0
#endif
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 91 "filter.y"
-typedef union YYSTYPE {
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 94 "filter.y"
+{
int32 filter_int;
char *filter_string;
lslpLDAPFilter *filter_filter;
-} YYSTYPE;
-/* Line 191 of yacc.c. */
-#line 144 "y_filter.c"
+}
+/* Line 193 of yacc.c. */
+#line 163 "y_filter.c"
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
/* Copy the second part of user declarations. */
-/* Line 214 of yacc.c. */
-#line 156 "y_filter.c"
+/* Line 216 of yacc.c. */
+#line 176 "y_filter.c"
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+# define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+# define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# else
+# define YYSIZE_T unsigned int
+# endif
+#endif
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-# ifndef YYFREE
-# define YYFREE free
+#ifndef YY_
+# if YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# endif
# endif
-# ifndef YYMALLOC
-# define YYMALLOC malloc
+# ifndef YY_
+# define YY_(msgid) msgid
# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E. */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions. */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+ int i;
+#endif
+{
+ return i;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
# ifdef YYSTACK_USE_ALLOCA
# if YYSTACK_USE_ALLOCA
-# define YYSTACK_ALLOC alloca
-# endif
-# else
-# if defined (alloca) || defined (_ALLOCA_H)
-# define YYSTACK_ALLOC alloca
-# else
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
+# elif defined __BUILTIN_VA_ARG_INCR
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+# elif defined _AIX
+# define YYSTACK_ALLOC __alloca
+# elif defined _MSC_VER
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+# define alloca _alloca
+# else
+# define YYSTACK_ALLOC alloca
+# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
+# endif
+# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# else
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+# ifndef YYSTACK_ALLOC_MAXIMUM
+ /* The OS might guarantee only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
+ to allow for a few compiler-allocated temporary stack slots. */
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
# endif
+# else
# define YYSTACK_ALLOC YYMALLOC
# define YYSTACK_FREE YYFREE
+# ifndef YYSTACK_ALLOC_MAXIMUM
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+# endif
+# if (defined __cplusplus && ! defined _STDLIB_H \
+ && ! ((defined YYMALLOC || defined malloc) \
+ && (defined YYFREE || defined free)))
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
+# endif
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# ifndef YYFREE
+# define YYFREE free
+# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
# endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+#if (! defined yyoverflow \
+ && (! defined __cplusplus \
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- short yyss;
+ yytype_int16 yyss;
YYSTYPE yyvs;
};
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
-# if defined (__GNUC__) && 1 < __GNUC__
+# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
- register YYSIZE_T yyi; \
+ YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
- while (0)
+ while (YYID (0))
# endif
# endif
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
- while (0)
+ while (YYID (0))
#endif
-#if defined (__STDC__) || defined (__cplusplus)
- typedef signed char yysigned_char;
-#else
- typedef short yysigned_char;
-#endif
-
-/* YYFINAL -- State number of the termination state. */
+/* YYFINAL -- State number of the termination state. */
#define YYFINAL 5
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 22
-/* YYNTOKENS -- Number of terminals. */
+/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 16
-/* YYNNTS -- Number of nonterminals. */
+/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 8
-/* YYNRULES -- Number of rules. */
+/* YYNRULES -- Number of rules. */
#define YYNRULES 18
-/* YYNRULES -- Number of states. */
+/* YYNRULES -- Number of states. */
#define YYNSTATES 26
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 270
-#define YYTRANSLATE(YYX) \
+#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const unsigned char yytranslate[] =
+static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
-static const unsigned char yyprhs[] =
+static const yytype_uint8 yyprhs[] =
{
0, 0, 3, 5, 8, 13, 17, 19, 21, 23,
25, 27, 30, 34, 38, 42, 44, 46, 48
};
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yytype_int8 yyrhs[] =
{
17, 0, -1, 18, -1, 17, 18, -1, 19, 21,
17, 20, -1, 19, 22, 20, -1, 3, -1, 4,
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const unsigned char yyrline[] =
+static const yytype_uint8 yyrline[] =
{
- 0, 110, 110, 111, 114, 132, 141, 144, 147, 148,
- 149, 154, 163, 173, 183, 194, 195, 196, 197
+ 0, 113, 113, 114, 117, 135, 144, 147, 150, 151,
+ 152, 157, 166, 176, 186, 197, 198, 199, 200
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE
-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "L_PAREN", "R_PAREN", "OP_AND", "OP_OR",
# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
token YYLEX-NUM. */
-static const unsigned short yytoknum[] =
+static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const unsigned char yyr1[] =
+static const yytype_uint8 yyr1[] =
{
0, 16, 17, 17, 18, 18, 19, 20, 21, 21,
21, 22, 22, 22, 22, 23, 23, 23, 23
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const unsigned char yyr2[] =
+static const yytype_uint8 yyr2[] =
{
0, 2, 1, 2, 4, 3, 1, 1, 1, 1,
1, 2, 3, 3, 3, 1, 1, 1, 1
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
-static const unsigned char yydefact[] =
+static const yytype_uint8 yydefact[] =
{
0, 6, 0, 2, 0, 1, 3, 8, 9, 10,
0, 0, 0, 15, 16, 17, 11, 18, 0, 0,
7, 5, 12, 13, 14, 4
};
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int8 yydefgoto[] =
{
-1, 2, 3, 4, 21, 11, 12, 18
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -5
-static const yysigned_char yypact[] =
+static const yytype_int8 yypact[] =
{
9, -5, 10, -5, -4, -5, -5, -5, -5, -5,
-3, 9, 0, -5, -5, -5, -5, -5, 1, 15,
};
/* YYPGOTO[NTERM-NUM]. */
-static const yysigned_char yypgoto[] =
+static const yytype_int8 yypgoto[] =
{
-5, 11, -2, -5, 2, -5, -5, -5
};
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -1
-static const unsigned char yytable[] =
+static const yytype_uint8 yytable[] =
{
6, 7, 8, 9, 20, 13, 14, 15, 16, 17,
5, 10, 1, 1, 22, 23, 24, 6, 1, 20,
0, 25, 19
};
-static const yysigned_char yycheck[] =
+static const yytype_int8 yycheck[] =
{
2, 5, 6, 7, 4, 8, 9, 10, 11, 12,
0, 15, 3, 3, 13, 14, 15, 19, 3, 4,
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
-static const unsigned char yystos[] =
+static const yytype_uint8 yystos[] =
{
0, 3, 17, 18, 19, 0, 18, 5, 6, 7,
15, 21, 22, 8, 9, 10, 11, 12, 23, 17,
4, 20, 13, 14, 15, 20
};
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
-#endif
-
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY (-2)
yychar = (Token); \
yylval = (Value); \
yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
+ YYPOPSTACK (1); \
goto yybackup; \
} \
else \
- { \
- yyerror ("syntax error: cannot back up");\
+ { \
+ yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
-while (0)
+while (YYID (0))
+
#define YYTERROR 1
#define YYERRCODE 256
-/* YYLLOC_DEFAULT -- Compute the default location (before the actions
- are run). */
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+ If N is 0, then set CURRENT to the empty location which ends
+ the previous symbol: RHS[0] (always defined). */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- ((Current).first_line = (Rhs)[1].first_line, \
- (Current).first_column = (Rhs)[1].first_column, \
- (Current).last_line = (Rhs)[N].last_line, \
- (Current).last_column = (Rhs)[N].last_column)
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (YYID (N)) \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
+ while (YYID (0))
+#endif
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+ This macro was not mandated originally: define only if we know
+ we won't break user code: when these are the locations we know. */
+
+#ifndef YY_LOCATION_PRINT
+# if YYLTYPE_IS_TRIVIAL
+# define YY_LOCATION_PRINT(File, Loc) \
+ fprintf (File, "%d.%d-%d.%d", \
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
#endif
+
/* YYLEX -- calling `yylex' with the right arguments. */
#ifdef YYLEX_PARAM
do { \
if (yydebug) \
YYFPRINTF Args; \
-} while (0)
+} while (YYID (0))
-# define YYDSYMPRINT(Args) \
-do { \
- if (yydebug) \
- yysymprint Args; \
-} while (0)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (YYID (0))
-# define YYDSYMPRINTF(Title, Token, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
- Token, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (0)
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE const * const yyvaluep;
+#endif
+{
+ if (!yyvaluep)
+ return;
+# ifdef YYPRINT
+ if (yytype < YYNTOKENS)
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+ YYUSE (yyoutput);
+# endif
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE const * const yyvaluep;
+#endif
+{
+ if (yytype < YYNTOKENS)
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+ else
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+ YYFPRINTF (yyoutput, ")");
+}
/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included). |
`------------------------------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (short *bottom, short *top)
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
#else
static void
yy_stack_print (bottom, top)
- short *bottom;
- short *top;
+ yytype_int16 *bottom;
+ yytype_int16 *top;
#endif
{
YYFPRINTF (stderr, "Stack now");
- for (/* Nothing. */; bottom <= top; ++bottom)
+ for (; bottom <= top; ++bottom)
YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
-} while (0)
+} while (YYID (0))
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (int yyrule)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
#else
static void
-yy_reduce_print (yyrule)
+yy_reduce_print (yyvsp, yyrule)
+ YYSTYPE *yyvsp;
int yyrule;
#endif
{
+ int yynrhs = yyr2[yyrule];
int yyi;
- unsigned int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
- yyrule - 1, yylno);
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
- YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
- YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+ unsigned long int yylno = yyrline[yyrule];
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ yyrule - 1, yylno);
+ /* The symbols being reduced. */
+ for (yyi = 0; yyi < yynrhs; yyi++)
+ {
+ fprintf (stderr, " $%d = ", yyi + 1);
+ yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ );
+ fprintf (stderr, "\n");
+ }
}
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
- yy_reduce_print (Rule); \
-} while (0)
+ yy_reduce_print (yyvsp, Rule); \
+} while (YYID (0))
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
-# define YYDSYMPRINT(Args)
-# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
if the built-in stack extension method is used).
Do not make this value too large; the results are undefined if
- SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */
-#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
-# undef YYMAXDEPTH
-#endif
-
#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif
#if YYERROR_VERBOSE
# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
+# if defined __GLIBC__ && defined _STRING_H
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
-# else
+#else
+static YYSIZE_T
yystrlen (yystr)
- const char *yystr;
-# endif
+ const char *yystr;
+#endif
{
- register const char *yys = yystr;
-
- while (*yys++ != '\0')
+ YYSIZE_T yylen;
+ for (yylen = 0; yystr[yylen]; yylen++)
continue;
-
- return yys - yystr - 1;
+ return yylen;
}
# endif
# endif
# ifndef yystpcpy
-# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static char *
-# if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
-# else
+#else
+static char *
yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
+ char *yydest;
+ const char *yysrc;
+#endif
{
- register char *yyd = yydest;
- register const char *yys = yysrc;
+ char *yyd = yydest;
+ const char *yys = yysrc;
while ((*yyd++ = *yys++) != '\0')
continue;
# endif
# endif
-#endif /* !YYERROR_VERBOSE */
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+ quotes and backslashes, so that it's suitable for yyerror. The
+ heuristic is that double-quoting is unnecessary unless the string
+ contains an apostrophe, a comma, or backslash (other than
+ backslash-backslash). YYSTR is taken from yytname. If YYRES is
+ null, do not copy; instead, return the length of what the result
+ would have been. */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+ if (*yystr == '"')
+ {
+ YYSIZE_T yyn = 0;
+ char const *yyp = yystr;
+
+ for (;;)
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
+ do_not_strip_quotes: ;
+ }
-\f
+ if (! yyres)
+ return yystrlen (yystr);
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+ return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
+/* Copy into YYRESULT an error message about the unexpected token
+ YYCHAR while in state YYSTATE. Return the number of bytes copied,
+ including the terminating null byte. If YYRESULT is null, do not
+ copy anything; just return the number of bytes that would be
+ copied. As a special case, return 0 if an ordinary "syntax error"
+ message will do. Return YYSIZE_MAXIMUM if overflow occurs during
+ size calculation. */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
+ int yyn = yypact[yystate];
- if (yytype < YYNTOKENS)
- {
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-# ifdef YYPRINT
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- }
+ if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+ return 0;
else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
- switch (yytype)
{
- default:
- break;
+ int yytype = YYTRANSLATE (yychar);
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ int yysize_overflow = 0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ int yyx;
+
+# if 0
+ /* This is so xgettext sees the translatable formats that are
+ constructed on the fly. */
+ YY_("syntax error, unexpected %s");
+ YY_("syntax error, unexpected %s, expecting %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+ char *yyfmt;
+ char const *yyf;
+ static char const yyunexpected[] = "syntax error, unexpected %s";
+ static char const yyexpecting[] = ", expecting %s";
+ static char const yyor[] = " or %s";
+ char yyformat[sizeof yyunexpected
+ + sizeof yyexpecting - 1
+ + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+ * (sizeof yyor - 1))];
+ char const *yyprefix = yyexpecting;
+
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 1;
+
+ yyarg[0] = yytname[yytype];
+ yyfmt = yystpcpy (yyformat, yyunexpected);
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ yyformat[sizeof yyunexpected - 1] = '\0';
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+ yyfmt = yystpcpy (yyfmt, yyprefix);
+ yyprefix = yyor;
+ }
+
+ yyf = YY_(yyformat);
+ yysize1 = yysize + yystrlen (yyf);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+
+ if (yysize_overflow)
+ return YYSIZE_MAXIMUM;
+
+ if (yyresult)
+ {
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ char *yyp = yyresult;
+ int yyi = 0;
+ while ((*yyp = *yyf) != '\0')
+ {
+ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyf += 2;
+ }
+ else
+ {
+ yyp++;
+ yyf++;
+ }
+ }
+ }
+ return yysize;
}
- YYFPRINTF (yyoutput, ")");
}
+#endif /* YYERROR_VERBOSE */
+\f
-#endif /* ! YYDEBUG */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yydestruct (int yytype, YYSTYPE *yyvaluep)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#else
static void
-yydestruct (yytype, yyvaluep)
+yydestruct (yymsg, yytype, yyvaluep)
+ const char *yymsg;
int yytype;
YYSTYPE *yyvaluep;
#endif
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
+ YYUSE (yyvaluep);
+
+ if (!yymsg)
+ yymsg = "Deleting";
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
switch (yytype)
{
default:
- break;
+ break;
}
}
\f
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
-# else
+#else
int yyparse ();
-# endif
+#endif
#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
-/* The lookahead symbol. */
+/* The look-ahead symbol. */
int yychar;
-/* The semantic value of the lookahead symbol. */
+/* The semantic value of the look-ahead symbol. */
YYSTYPE yylval;
/* Number of syntax errors so far. */
`----------*/
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-# endif
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+ void *YYPARSE_PARAM;
+#endif
#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
int
yyparse (void)
#else
#endif
{
- register int yystate;
- register int yyn;
+ int yystate;
+ int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
- /* Lookahead token as an internal (translated) token number. */
+ /* Look-ahead token as an internal (translated) token number. */
int yytoken = 0;
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
/* Three stacks and their tools:
`yyss': related to states,
to reallocate them elsewhere. */
/* The state stack. */
- short yyssa[YYINITDEPTH];
- short *yyss = yyssa;
- register short *yyssp;
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss = yyssa;
+ yytype_int16 *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
- register YYSTYPE *yyvsp;
+ YYSTYPE *yyvsp;
-#define YYPOPSTACK (yyvsp--, yyssp--)
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
YYSIZE_T yystacksize = YYINITDEPTH;
YYSTYPE yyval;
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
- int yylen;
+ /* The number of symbols on the RHS of the reduced rule.
+ Keep to zero when no symbol should be popped. */
+ int yylen = 0;
YYDPRINTF ((stderr, "Starting parse\n"));
`------------------------------------------------------------*/
yynewstate:
/* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks.
- */
+ have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
yysetstate:
#ifdef yyoverflow
{
- /* Give user a chance to reallocate the stack. Use copies of
+ /* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
+ yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
- yyoverflow ("parser stack overflow",
+ yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
- goto yyoverflowlab;
+ goto yyexhaustedlab;
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyoverflowlab;
+ goto yyexhaustedlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH;
{
- short *yyss1 = yyss;
+ yytype_int16 *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
- goto yyoverflowlab;
+ goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs);
`-----------*/
yybackup:
-/* Do appropriate processing given the current state. */
-/* Read a lookahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to lookahead token. */
+ /* Do appropriate processing given the current state. Read a
+ look-ahead token if we need one and don't already have one. */
+ /* First try to decide what to do without reference to look-ahead token. */
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
- /* Not known => get a lookahead token if don't already have one. */
+ /* Not known => get a look-ahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
else
{
yytoken = YYTRANSLATE (yychar);
- YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
}
/* If the proper action on seeing token YYTOKEN is to reduce or to
if (yyn == YYFINAL)
YYACCEPT;
- /* Shift the lookahead token. */
- YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-
-
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
+ /* Shift the look-ahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+ /* Discard the shifted token unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
yystate = yyn;
+ *++yyvsp = yylval;
+
goto yynewstate;
switch (yyn)
{
case 4:
-#line 114 "filter.y"
+#line 117 "filter.y"
{
- if(NULL != (yyval.filter_filter = lslpAllocFilter(yyvsp[-2].filter_int))) {
- yyval.filter_filter->nestingLevel = nesting_level;
+ if(NULL != ((yyval.filter_filter) = lslpAllocFilter((yyvsp[(2) - (4)].filter_int)))) {
+ (yyval.filter_filter)->nestingLevel = nesting_level;
if(! _LSLP_IS_EMPTY(&reducedFilters) ) {
lslpLDAPFilter *temp = (lslpLDAPFilter *)reducedFilters.next;
while(! _LSLP_IS_HEAD(temp)) {
lslpLDAPFilter *nest = temp;
temp = temp->next;
_LSLP_UNLINK(nest);
- _LSLP_INSERT_BEFORE(nest, (lslpLDAPFilter *)&(yyval.filter_filter->children)) ;
+ _LSLP_INSERT_BEFORE(nest, (lslpLDAPFilter *)&((yyval.filter_filter)->children)) ;
} else {temp = temp->next; }
}
- _LSLP_INSERT_BEFORE( (filterHead *)yyval.filter_filter, &reducedFilters);
- } else { lslpFreeFilter(yyval.filter_filter) ; yyval.filter_filter = NULL ; }
+ _LSLP_INSERT_BEFORE( (filterHead *)(yyval.filter_filter), &reducedFilters);
+ } else { lslpFreeFilter((yyval.filter_filter)) ; (yyval.filter_filter) = NULL ; }
}
;}
break;
case 5:
-#line 132 "filter.y"
+#line 135 "filter.y"
{
- yyval.filter_filter = yyvsp[-1].filter_filter;
- if(yyvsp[-1].filter_filter != NULL) {
- yyvsp[-1].filter_filter->nestingLevel = nesting_level;
- _LSLP_INSERT_BEFORE((filterHead *)yyvsp[-1].filter_filter, &reducedFilters) ;
+ (yyval.filter_filter) = (yyvsp[(2) - (3)].filter_filter);
+ if((yyvsp[(2) - (3)].filter_filter) != NULL) {
+ (yyvsp[(2) - (3)].filter_filter)->nestingLevel = nesting_level;
+ _LSLP_INSERT_BEFORE((filterHead *)(yyvsp[(2) - (3)].filter_filter), &reducedFilters) ;
}
;}
break;
case 6:
-#line 141 "filter.y"
+#line 144 "filter.y"
{ nesting_level++; ;}
break;
case 7:
-#line 144 "filter.y"
+#line 147 "filter.y"
{ nesting_level--; ;}
break;
case 10:
-#line 150 "filter.y"
- { yyval.filter_int = filterlval.filter_int; ;}
+#line 153 "filter.y"
+ { (yyval.filter_int) = filterlval.filter_int; ;}
break;
case 11:
-#line 154 "filter.y"
+#line 157 "filter.y"
{ /* presence test binds to single operand */
- if(NULL != (yyval.filter_filter = lslpAllocFilter(expr_present))) {
- lslpAttrList *attr = lslpAllocAttr(yyvsp[-1].filter_string, string, "*", (int16)strlen("*") + 1);
+ if(NULL != ((yyval.filter_filter) = lslpAllocFilter(expr_present))) {
+ lslpAttrList *attr = lslpAllocAttr((yyvsp[(1) - (2)].filter_string), string, "*", (int16)strlen("*") + 1);
if(attr != NULL) {
- _LSLP_INSERT(attr, &(yyval.filter_filter->attrs));
- } else { lslpFreeFilter(yyval.filter_filter); yyval.filter_filter = NULL; }
+ _LSLP_INSERT(attr, &((yyval.filter_filter)->attrs));
+ } else { lslpFreeFilter((yyval.filter_filter)); (yyval.filter_filter) = NULL; }
}
;}
break;
case 12:
-#line 163 "filter.y"
+#line 166 "filter.y"
{ /* must be an int or a bool */
/* remember to touch up the token values to match the enum in lslp.h */
- if(NULL != (yyval.filter_filter = lslpAllocFilter(yyvsp[-1].filter_int))) {
- lslpAttrList *attr = lslpAllocAttr(yyvsp[-2].filter_string, integer, &(yyvsp[0].filter_int), sizeof(yyvsp[0].filter_int));
+ if(NULL != ((yyval.filter_filter) = lslpAllocFilter((yyvsp[(2) - (3)].filter_int)))) {
+ lslpAttrList *attr = lslpAllocAttr((yyvsp[(1) - (3)].filter_string), integer, &((yyvsp[(3) - (3)].filter_int)), sizeof((yyvsp[(3) - (3)].filter_int)));
if(attr != NULL) {
- _LSLP_INSERT(attr, &(yyval.filter_filter->attrs));
- } else { lslpFreeFilter(yyval.filter_filter); yyval.filter_filter = NULL ; }
+ _LSLP_INSERT(attr, &((yyval.filter_filter)->attrs));
+ } else { lslpFreeFilter((yyval.filter_filter)); (yyval.filter_filter) = NULL ; }
}
;}
break;
case 13:
-#line 173 "filter.y"
+#line 176 "filter.y"
{ /* must be an int or a bool */
/* remember to touch up the token values to match the enum in lslp.h */
- if(NULL != (yyval.filter_filter = lslpAllocFilter(yyvsp[-1].filter_int))) {
- lslpAttrList *attr = lslpAllocAttr(yyvsp[-2].filter_string, bool_type, &(yyvsp[0].filter_int), sizeof(yyvsp[0].filter_int));
+ if(NULL != ((yyval.filter_filter) = lslpAllocFilter((yyvsp[(2) - (3)].filter_int)))) {
+ lslpAttrList *attr = lslpAllocAttr((yyvsp[(1) - (3)].filter_string), bool_type, &((yyvsp[(3) - (3)].filter_int)), sizeof((yyvsp[(3) - (3)].filter_int)));
if(attr != NULL) {
- _LSLP_INSERT(attr, &(yyval.filter_filter->attrs));
- } else { lslpFreeFilter(yyval.filter_filter); yyval.filter_filter = NULL ; }
+ _LSLP_INSERT(attr, &((yyval.filter_filter)->attrs));
+ } else { lslpFreeFilter((yyval.filter_filter)); (yyval.filter_filter) = NULL ; }
}
;}
break;
case 14:
-#line 183 "filter.y"
+#line 186 "filter.y"
{ /* both operands are strings */
- if(NULL != (yyval.filter_filter = lslpAllocFilter(yyvsp[-1].filter_int))) {
- lslpAttrList *attr = lslpAllocAttr(yyvsp[-2].filter_string, string, yyvsp[0].filter_string, (int16)strlen(yyvsp[0].filter_string) + 1 );
+ if(NULL != ((yyval.filter_filter) = lslpAllocFilter((yyvsp[(2) - (3)].filter_int)))) {
+ lslpAttrList *attr = lslpAllocAttr((yyvsp[(1) - (3)].filter_string), string, (yyvsp[(3) - (3)].filter_string), (int16)strlen((yyvsp[(3) - (3)].filter_string)) + 1 );
if(attr != NULL) {
- _LSLP_INSERT(attr, &(yyval.filter_filter->attrs));
- } else { lslpFreeFilter(yyval.filter_filter); yyval.filter_filter = NULL ; }
+ _LSLP_INSERT(attr, &((yyval.filter_filter)->attrs));
+ } else { lslpFreeFilter((yyval.filter_filter)); (yyval.filter_filter) = NULL ; }
}
;}
break;
case 18:
-#line 198 "filter.y"
- { yyval.filter_int = filterlval.filter_int; ;}
+#line 201 "filter.y"
+ { (yyval.filter_int) = filterlval.filter_int; ;}
break;
+/* Line 1267 of yacc.c. */
+#line 1480 "y_filter.c"
+ default: break;
}
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-/* Line 1000 of yacc.c. */
-#line 1149 "y_filter.c"
-\f
- yyvsp -= yylen;
- yyssp -= yylen;
-
-
+ YYPOPSTACK (yylen);
+ yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
if (!yyerrstatus)
{
++yynerrs;
-#if YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (YYPACT_NINF < yyn && yyn < YYLAST)
- {
- YYSIZE_T yysize = 0;
- int yytype = YYTRANSLATE (yychar);
- const char* yyprefix;
- char *yymsg;
- int yyx;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 0;
-
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+#if ! YYERROR_VERBOSE
+ yyerror (YY_("syntax error"));
+#else
+ {
+ YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+ if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+ {
+ YYSIZE_T yyalloc = 2 * yysize;
+ if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+ yyalloc = YYSTACK_ALLOC_MAXIMUM;
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+ if (yymsg)
+ yymsg_alloc = yyalloc;
+ else
{
- yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
- yycount += 1;
- if (yycount == 5)
- {
- yysize = 0;
- break;
- }
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
}
- yysize += (sizeof ("syntax error, unexpected ")
- + yystrlen (yytname[yytype]));
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg != 0)
- {
- char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
- yyp = yystpcpy (yyp, yytname[yytype]);
-
- if (yycount < 5)
- {
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- yyp = yystpcpy (yyp, yyprefix);
- yyp = yystpcpy (yyp, yytname[yyx]);
- yyprefix = " or ";
- }
- }
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
- }
- else
- yyerror ("syntax error; also virtual memory exhausted");
- }
- else
-#endif /* YYERROR_VERBOSE */
- yyerror ("syntax error");
+ }
+
+ if (0 < yysize && yysize <= yymsg_alloc)
+ {
+ (void) yysyntax_error (yymsg, yystate, yychar);
+ yyerror (yymsg);
+ }
+ else
+ {
+ yyerror (YY_("syntax error"));
+ if (yysize != 0)
+ goto yyexhaustedlab;
+ }
+ }
+#endif
}
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse lookahead token after an
+ /* If just tried and failed to reuse look-ahead token after an
error, discard it. */
if (yychar <= YYEOF)
- {
- /* If at end of input, pop the error token,
- then the rest of the stack, then return failure. */
+ {
+ /* Return failure if at end of input. */
if (yychar == YYEOF)
- for (;;)
- {
- YYPOPSTACK;
- if (yyssp == yyss)
- YYABORT;
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[*yyssp], yyvsp);
- }
- }
+ YYABORT;
+ }
else
{
- YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
- yydestruct (yytoken, &yylval);
+ yydestruct ("Error: discarding",
+ yytoken, &yylval);
yychar = YYEMPTY;
-
}
}
- /* Else will try to reuse lookahead token after shifting the error
+ /* Else will try to reuse look-ahead token after shifting the error
token. */
goto yyerrlab1;
`---------------------------------------------------*/
yyerrorlab:
-#ifdef __GNUC__
- /* Pacify GCC when the user code never invokes YYERROR and the label
- yyerrorlab therefore never appears in user code. */
- if (0)
+ /* Pacify compilers like GCC when the user code never invokes
+ YYERROR and the label yyerrorlab therefore never appears in user
+ code. */
+ if (/*CONSTCOND*/ 0)
goto yyerrorlab;
-#endif
- yyvsp -= yylen;
- yyssp -= yylen;
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYERROR. */
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
yystate = *yyssp;
goto yyerrlab1;
if (yyssp == yyss)
YYABORT;
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[yystate], yyvsp);
- YYPOPSTACK;
+
+ yydestruct ("Error: popping",
+ yystos[yystate], yyvsp);
+ YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
if (yyn == YYFINAL)
YYACCEPT;
- YYDPRINTF ((stderr, "Shifting error token, "));
-
*++yyvsp = yylval;
+ /* Shift the error token. */
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
yystate = yyn;
goto yynewstate;
goto yyreturn;
#ifndef yyoverflow
-/*----------------------------------------------.
-| yyoverflowlab -- parser overflow comes here. |
-`----------------------------------------------*/
-yyoverflowlab:
- yyerror ("parser stack overflow");
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here. |
+`-------------------------------------------------*/
+yyexhaustedlab:
+ yyerror (YY_("memory exhausted"));
yyresult = 2;
/* Fall through. */
#endif
yyreturn:
+ if (yychar != YYEOF && yychar != YYEMPTY)
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval);
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYABORT or YYACCEPT. */
+ YYPOPSTACK (yylen);
+ YY_STACK_PRINT (yyss, yyssp);
+ while (yyssp != yyss)
+ {
+ yydestruct ("Cleanup: popping",
+ yystos[*yyssp], yyvsp);
+ YYPOPSTACK (1);
+ }
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
- return yyresult;
+#if YYERROR_VERBOSE
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+#endif
+ /* Make sure YYID is used. */
+ return YYID (yyresult);
}
-#line 201 "filter.y"
+#line 204 "filter.y"
// 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.
//
-//==============================================================================
-/* A Bison parser, made by GNU Bison 1.875c. */
+//=============================================================================
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+//NOCHKSRC
+
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
OPERAND = 270
};
#endif
+/* Tokens. */
#define L_PAREN 258
#define R_PAREN 259
#define OP_AND 260
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 91 "filter.y"
-typedef union YYSTYPE {
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 94 "filter.y"
+{
int32 filter_int;
char *filter_string;
lslpLDAPFilter *filter_filter;
-} YYSTYPE;
-/* Line 1275 of yacc.c. */
-#line 73 "y_filter.h"
+}
+/* Line 1529 of yacc.c. */
+#line 85 "y_filter.h"
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
extern YYSTYPE filterlval;
-
-
// 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.
//
-//==============================================================================
+//=============================================================================
Grammar
0 $accept: filter_list $end
// 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.
//
-//==============================================================================
-/* A Bison parser, made by GNU Bison 1.875c. */
+//=============================================================================
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+//NOCHKSRC
+
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
-/* Written by Richard Stallman by simplifying the original so called
- ``semantic'' parser. */
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+ simplifying the original so-called "semantic" parser. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
/* Identify Bison output. */
#define YYBISON 1
+/* Bison version. */
+#define YYBISON_VERSION "2.3"
+
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Using locations. */
#define YYLSP_NEEDED 0
-/* If NAME_PREFIX is specified substitute the variables and functions
- names. */
+/* Substitute the variable and function names. */
#define yyparse urlparse
#define yylex urllex
#define yyerror urlerror
_ZONE = 267
};
#endif
+/* Tokens. */
#define _RESERVED 258
#define _HEXDIG 259
#define _STAG 260
/* Copy the first part of user declarations. */
-#line 66 "url.y"
+#line 67 "url.y"
#include "slp_client.h"
void url_close_lexer(uint32 handle);
size_t url_init_lexer(const char *s);
-lslpAtomizedURL urlHead =
-{
- &urlHead, &urlHead, TRUE, NULL, 0
-};
static lslpAtomList srvcHead = {&srvcHead, &srvcHead, TRUE, NULL, 0};
static lslpAtomList siteHead = {&siteHead, &siteHead, TRUE, NULL, 0};
static lslpAtomList pathHead = {&pathHead, &pathHead, TRUE, NULL, 0};
static lslpAtomList attrHead = {&attrHead, &attrHead, TRUE, NULL, 0};
+lslpAtomizedURL urlHead =
+{
+ &urlHead,
+ &urlHead,
+ TRUE,
+ NULL,
+ 0,
+ {&srvcHead, &srvcHead, TRUE, NULL, 0},
+ {&siteHead, &siteHead, TRUE, NULL, 0},
+ {&pathHead, &pathHead, TRUE, NULL, 0},
+ {&attrHead, &attrHead, TRUE, NULL, 0}
+};
+
/* Enabling traces. */
# define YYERROR_VERBOSE 0
#endif
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 95 "url.y"
-typedef union YYSTYPE {
+/* Enabling the token table. */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 105 "url.y"
+{
int32 _i;
char *_s;
lslpAtomList *_atl;
lslpAtomizedURL *_aturl;
-} YYSTYPE;
-/* Line 191 of yacc.c. */
-#line 142 "y_url.c"
+}
+/* Line 193 of yacc.c. */
+#line 170 "y_url.c"
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
/* Copy the second part of user declarations. */
-/* Line 214 of yacc.c. */
-#line 154 "y_url.c"
+/* Line 216 of yacc.c. */
+#line 183 "y_url.c"
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+# define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+# define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# else
+# define YYSIZE_T unsigned int
+# endif
+#endif
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
-# ifndef YYFREE
-# define YYFREE free
+#ifndef YY_
+# if YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# endif
# endif
-# ifndef YYMALLOC
-# define YYMALLOC malloc
+# ifndef YY_
+# define YY_(msgid) msgid
# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E. */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions. */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+ int i;
+#endif
+{
+ return i;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
# ifdef YYSTACK_USE_ALLOCA
# if YYSTACK_USE_ALLOCA
-# define YYSTACK_ALLOC alloca
-# endif
-# else
-# if defined (alloca) || defined (_ALLOCA_H)
-# define YYSTACK_ALLOC alloca
-# else
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
+# elif defined __BUILTIN_VA_ARG_INCR
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+# elif defined _AIX
+# define YYSTACK_ALLOC __alloca
+# elif defined _MSC_VER
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+# define alloca _alloca
+# else
+# define YYSTACK_ALLOC alloca
+# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
+# endif
+# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# else
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+# ifndef YYSTACK_ALLOC_MAXIMUM
+ /* The OS might guarantee only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
+ to allow for a few compiler-allocated temporary stack slots. */
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
# endif
+# else
# define YYSTACK_ALLOC YYMALLOC
# define YYSTACK_FREE YYFREE
+# ifndef YYSTACK_ALLOC_MAXIMUM
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+# endif
+# if (defined __cplusplus && ! defined _STDLIB_H \
+ && ! ((defined YYMALLOC || defined malloc) \
+ && (defined YYFREE || defined free)))
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
+# endif
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# ifndef YYFREE
+# define YYFREE free
+# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
# endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+#if (! defined yyoverflow \
+ && (! defined __cplusplus \
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- short yyss;
+ yytype_int16 yyss;
YYSTYPE yyvs;
};
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
-# if defined (__GNUC__) && 1 < __GNUC__
+# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
- register YYSIZE_T yyi; \
+ YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
- while (0)
+ while (YYID (0))
# endif
# endif
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
- while (0)
-
-#endif
+ while (YYID (0))
-#if defined (__STDC__) || defined (__cplusplus)
- typedef signed char yysigned_char;
-#else
- typedef short yysigned_char;
#endif
-/* YYFINAL -- State number of the termination state. */
+/* YYFINAL -- State number of the termination state. */
#define YYFINAL 7
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 43
-/* YYNTOKENS -- Number of terminals. */
+/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 19
-/* YYNNTS -- Number of nonterminals. */
+/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 17
-/* YYNRULES -- Number of rules. */
+/* YYNRULES -- Number of rules. */
#define YYNRULES 35
-/* YYNRULES -- Number of states. */
+/* YYNRULES -- Number of states. */
#define YYNSTATES 52
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 267
-#define YYTRANSLATE(YYX) \
+#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const unsigned char yytranslate[] =
+static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
-static const unsigned char yyprhs[] =
+static const yytype_uint8 yyprhs[] =
{
0, 0, 3, 6, 8, 11, 14, 19, 21, 24,
26, 28, 30, 32, 35, 39, 45, 47, 49, 56,
83, 86, 89, 91, 94, 97
};
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yytype_int8 yyrhs[] =
{
20, 0, -1, 21, 23, -1, 22, -1, 21, 22,
-1, 6, 13, -1, 6, 14, 6, 13, -1, 24,
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const unsigned short yyrline[] =
+static const yytype_uint16 yyrline[] =
{
- 0, 115, 115, 209, 217, 226, 244, 266, 273, 282,
- 295, 308, 322, 340, 343, 352, 363, 368, 373, 386,
- 389, 404, 407, 412, 415, 418, 423, 430, 440, 444,
- 462, 479, 497, 504, 513, 530
+ 0, 125, 125, 219, 227, 236, 254, 276, 283, 292,
+ 305, 318, 332, 350, 353, 362, 373, 378, 383, 396,
+ 402, 417, 420, 425, 428, 431, 436, 443, 453, 457,
+ 475, 492, 510, 517, 526, 543
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE
-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "_RESERVED", "_HEXDIG", "_STAG",
# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
token YYLEX-NUM. */
-static const unsigned short yytoknum[] =
+static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 58, 46, 47, 64, 59, 61
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const unsigned char yyr1[] =
+static const yytype_uint8 yyr1[] =
{
0, 19, 20, 21, 21, 22, 22, 23, 23, 24,
24, 24, 24, 25, 25, 25, 26, 27, 28, 29,
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const unsigned char yyr2[] =
+static const yytype_uint8 yyr2[] =
{
0, 2, 2, 1, 2, 2, 4, 1, 2, 1,
1, 1, 1, 2, 3, 5, 1, 1, 6, 1,
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
-static const unsigned char yydefact[] =
+static const yytype_uint8 yydefact[] =
{
0, 0, 0, 0, 3, 5, 0, 1, 16, 17,
0, 0, 4, 2, 7, 9, 12, 10, 11, 0,
35, 18
};
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int8 yydefgoto[] =
{
-1, 2, 3, 4, 13, 14, 15, 16, 17, 18,
33, 34, 24, 25, 26, 27, 28
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -28
-static const yysigned_char yypact[] =
+static const yytype_int8 yypact[] =
{
-3, 5, 16, -5, -28, -28, 2, -28, 5, -28,
9, 7, -28, -28, -13, -28, -28, -28, -28, 10,
};
/* YYPGOTO[NTERM-NUM]. */
-static const yysigned_char yypgoto[] =
+static const yytype_int8 yypgoto[] =
{
-28, -28, -28, 25, -28, -28, -28, -28, -28, -28,
-16, -28, -28, -28, 4, 18, -27
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -1
-static const unsigned char yytable[] =
+static const yytype_uint8 yytable[] =
{
41, 8, 22, 1, 23, 9, 10, 35, 19, 36,
11, 37, 31, 41, 47, 32, 7, 32, 5, 6,
0, 0, 0, 40
};
-static const yysigned_char yycheck[] =
+static const yytype_int8 yycheck[] =
{
27, 6, 15, 6, 17, 10, 11, 4, 6, 6,
15, 8, 6, 40, 6, 9, 0, 9, 13, 14,
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
-static const unsigned char yystos[] =
+static const yytype_uint8 yystos[] =
{
0, 6, 20, 21, 22, 13, 14, 0, 6, 10,
11, 15, 22, 23, 24, 25, 26, 27, 28, 6,
8, 12
};
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-# endif
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
-#endif
-
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY (-2)
yychar = (Token); \
yylval = (Value); \
yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
+ YYPOPSTACK (1); \
goto yybackup; \
} \
else \
- { \
- yyerror ("syntax error: cannot back up");\
+ { \
+ yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
-while (0)
+while (YYID (0))
+
#define YYTERROR 1
#define YYERRCODE 256
-/* YYLLOC_DEFAULT -- Compute the default location (before the actions
- are run). */
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+ If N is 0, then set CURRENT to the empty location which ends
+ the previous symbol: RHS[0] (always defined). */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- ((Current).first_line = (Rhs)[1].first_line, \
- (Current).first_column = (Rhs)[1].first_column, \
- (Current).last_line = (Rhs)[N].last_line, \
- (Current).last_column = (Rhs)[N].last_column)
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (YYID (N)) \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
+ while (YYID (0))
+#endif
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+ This macro was not mandated originally: define only if we know
+ we won't break user code: when these are the locations we know. */
+
+#ifndef YY_LOCATION_PRINT
+# if YYLTYPE_IS_TRIVIAL
+# define YY_LOCATION_PRINT(File, Loc) \
+ fprintf (File, "%d.%d-%d.%d", \
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
+# else
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
#endif
+
/* YYLEX -- calling `yylex' with the right arguments. */
#ifdef YYLEX_PARAM
do { \
if (yydebug) \
YYFPRINTF Args; \
-} while (0)
+} while (YYID (0))
-# define YYDSYMPRINT(Args) \
-do { \
- if (yydebug) \
- yysymprint Args; \
-} while (0)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (YYID (0))
-# define YYDSYMPRINTF(Title, Token, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
- Token, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (0)
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE const * const yyvaluep;
+#endif
+{
+ if (!yyvaluep)
+ return;
+# ifdef YYPRINT
+ if (yytype < YYNTOKENS)
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+ YYUSE (yyoutput);
+# endif
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE const * const yyvaluep;
+#endif
+{
+ if (yytype < YYNTOKENS)
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+ else
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+ YYFPRINTF (yyoutput, ")");
+}
/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included). |
`------------------------------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (short *bottom, short *top)
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
#else
static void
yy_stack_print (bottom, top)
- short *bottom;
- short *top;
+ yytype_int16 *bottom;
+ yytype_int16 *top;
#endif
{
YYFPRINTF (stderr, "Stack now");
- for (/* Nothing. */; bottom <= top; ++bottom)
+ for (; bottom <= top; ++bottom)
YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
-} while (0)
+} while (YYID (0))
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (int yyrule)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
#else
static void
-yy_reduce_print (yyrule)
+yy_reduce_print (yyvsp, yyrule)
+ YYSTYPE *yyvsp;
int yyrule;
#endif
{
+ int yynrhs = yyr2[yyrule];
int yyi;
- unsigned int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
- yyrule - 1, yylno);
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
- YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
- YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+ unsigned long int yylno = yyrline[yyrule];
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ yyrule - 1, yylno);
+ /* The symbols being reduced. */
+ for (yyi = 0; yyi < yynrhs; yyi++)
+ {
+ fprintf (stderr, " $%d = ", yyi + 1);
+ yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ );
+ fprintf (stderr, "\n");
+ }
}
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
- yy_reduce_print (Rule); \
-} while (0)
+ yy_reduce_print (yyvsp, Rule); \
+} while (YYID (0))
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
-# define YYDSYMPRINT(Args)
-# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
if the built-in stack extension method is used).
Do not make this value too large; the results are undefined if
- SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */
-#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
-# undef YYMAXDEPTH
-#endif
-
#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif
#if YYERROR_VERBOSE
# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
+# if defined __GLIBC__ && defined _STRING_H
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
-# else
+#else
+static YYSIZE_T
yystrlen (yystr)
- const char *yystr;
-# endif
+ const char *yystr;
+#endif
{
- register const char *yys = yystr;
-
- while (*yys++ != '\0')
+ YYSIZE_T yylen;
+ for (yylen = 0; yystr[yylen]; yylen++)
continue;
-
- return yys - yystr - 1;
+ return yylen;
}
# endif
# endif
# ifndef yystpcpy
-# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static char *
-# if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
-# else
+#else
+static char *
yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
+ char *yydest;
+ const char *yysrc;
+#endif
{
- register char *yyd = yydest;
- register const char *yys = yysrc;
+ char *yyd = yydest;
+ const char *yys = yysrc;
while ((*yyd++ = *yys++) != '\0')
continue;
# endif
# endif
-#endif /* !YYERROR_VERBOSE */
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+ quotes and backslashes, so that it's suitable for yyerror. The
+ heuristic is that double-quoting is unnecessary unless the string
+ contains an apostrophe, a comma, or backslash (other than
+ backslash-backslash). YYSTR is taken from yytname. If YYRES is
+ null, do not copy; instead, return the length of what the result
+ would have been. */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+ if (*yystr == '"')
+ {
+ YYSIZE_T yyn = 0;
+ char const *yyp = yystr;
+
+ for (;;)
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
+ do_not_strip_quotes: ;
+ }
-\f
+ if (! yyres)
+ return yystrlen (yystr);
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+ return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
+/* Copy into YYRESULT an error message about the unexpected token
+ YYCHAR while in state YYSTATE. Return the number of bytes copied,
+ including the terminating null byte. If YYRESULT is null, do not
+ copy anything; just return the number of bytes that would be
+ copied. As a special case, return 0 if an ordinary "syntax error"
+ message will do. Return YYSIZE_MAXIMUM if overflow occurs during
+ size calculation. */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
+ int yyn = yypact[yystate];
- if (yytype < YYNTOKENS)
- {
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-# ifdef YYPRINT
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- }
+ if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+ return 0;
else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
- switch (yytype)
{
- default:
- break;
+ int yytype = YYTRANSLATE (yychar);
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ int yysize_overflow = 0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ int yyx;
+
+# if 0
+ /* This is so xgettext sees the translatable formats that are
+ constructed on the fly. */
+ YY_("syntax error, unexpected %s");
+ YY_("syntax error, unexpected %s, expecting %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+ YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+ char *yyfmt;
+ char const *yyf;
+ static char const yyunexpected[] = "syntax error, unexpected %s";
+ static char const yyexpecting[] = ", expecting %s";
+ static char const yyor[] = " or %s";
+ char yyformat[sizeof yyunexpected
+ + sizeof yyexpecting - 1
+ + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+ * (sizeof yyor - 1))];
+ char const *yyprefix = yyexpecting;
+
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 1;
+
+ yyarg[0] = yytname[yytype];
+ yyfmt = yystpcpy (yyformat, yyunexpected);
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ yyformat[sizeof yyunexpected - 1] = '\0';
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+ yyfmt = yystpcpy (yyfmt, yyprefix);
+ yyprefix = yyor;
+ }
+
+ yyf = YY_(yyformat);
+ yysize1 = yysize + yystrlen (yyf);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
+
+ if (yysize_overflow)
+ return YYSIZE_MAXIMUM;
+
+ if (yyresult)
+ {
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ char *yyp = yyresult;
+ int yyi = 0;
+ while ((*yyp = *yyf) != '\0')
+ {
+ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyf += 2;
+ }
+ else
+ {
+ yyp++;
+ yyf++;
+ }
+ }
+ }
+ return yysize;
}
- YYFPRINTF (yyoutput, ")");
}
+#endif /* YYERROR_VERBOSE */
+\f
-#endif /* ! YYDEBUG */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yydestruct (int yytype, YYSTYPE *yyvaluep)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#else
static void
-yydestruct (yytype, yyvaluep)
+yydestruct (yymsg, yytype, yyvaluep)
+ const char *yymsg;
int yytype;
YYSTYPE *yyvaluep;
#endif
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
+ YYUSE (yyvaluep);
+
+ if (!yymsg)
+ yymsg = "Deleting";
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
switch (yytype)
{
default:
- break;
+ break;
}
}
\f
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
-# else
+#else
int yyparse ();
-# endif
+#endif
#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
-/* The lookahead symbol. */
+/* The look-ahead symbol. */
int yychar;
-/* The semantic value of the lookahead symbol. */
+/* The semantic value of the look-ahead symbol. */
YYSTYPE yylval;
/* Number of syntax errors so far. */
`----------*/
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-# endif
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+ void *YYPARSE_PARAM;
+#endif
#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
int
yyparse (void)
#else
#endif
{
- register int yystate;
- register int yyn;
+ int yystate;
+ int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
- /* Lookahead token as an internal (translated) token number. */
+ /* Look-ahead token as an internal (translated) token number. */
int yytoken = 0;
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
/* Three stacks and their tools:
`yyss': related to states,
to reallocate them elsewhere. */
/* The state stack. */
- short yyssa[YYINITDEPTH];
- short *yyss = yyssa;
- register short *yyssp;
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss = yyssa;
+ yytype_int16 *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
- register YYSTYPE *yyvsp;
+ YYSTYPE *yyvsp;
-#define YYPOPSTACK (yyvsp--, yyssp--)
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
YYSIZE_T yystacksize = YYINITDEPTH;
YYSTYPE yyval;
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
- int yylen;
+ /* The number of symbols on the RHS of the reduced rule.
+ Keep to zero when no symbol should be popped. */
+ int yylen = 0;
YYDPRINTF ((stderr, "Starting parse\n"));
`------------------------------------------------------------*/
yynewstate:
/* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks.
- */
+ have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
yysetstate:
#ifdef yyoverflow
{
- /* Give user a chance to reallocate the stack. Use copies of
+ /* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
YYSTYPE *yyvs1 = yyvs;
- short *yyss1 = yyss;
+ yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
- yyoverflow ("parser stack overflow",
+ yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
- goto yyoverflowlab;
+ goto yyexhaustedlab;
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyoverflowlab;
+ goto yyexhaustedlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH;
{
- short *yyss1 = yyss;
+ yytype_int16 *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
- goto yyoverflowlab;
+ goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs);
`-----------*/
yybackup:
-/* Do appropriate processing given the current state. */
-/* Read a lookahead token if we need one and don't already have one. */
-/* yyresume: */
-
- /* First try to decide what to do without reference to lookahead token. */
+ /* Do appropriate processing given the current state. Read a
+ look-ahead token if we need one and don't already have one. */
+ /* First try to decide what to do without reference to look-ahead token. */
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
- /* Not known => get a lookahead token if don't already have one. */
+ /* Not known => get a look-ahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
else
{
yytoken = YYTRANSLATE (yychar);
- YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
}
/* If the proper action on seeing token YYTOKEN is to reduce or to
if (yyn == YYFINAL)
YYACCEPT;
- /* Shift the lookahead token. */
- YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
-
- /* Discard the token being shifted unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
-
- *++yyvsp = yylval;
-
-
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
+ /* Shift the look-ahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+ /* Discard the shifted token unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
yystate = yyn;
+ *++yyvsp = yylval;
+
goto yynewstate;
switch (yyn)
{
case 2:
-#line 115 "url.y"
+#line 125 "url.y"
{
- if (NULL != (yyval._aturl = (lslpAtomizedURL *)calloc(1, sizeof(lslpAtomizedURL))))
+ if (NULL != ((yyval._aturl) = (lslpAtomizedURL *)calloc(1, sizeof(lslpAtomizedURL))))
{
int32 urlLen = 1;
lslpAtomList *temp = srvcHead.next;
urlLen += strlen(temp->str) + 1;
temp = temp->next;
}
- if (NULL != (yyval._aturl->url = (char *)calloc(urlLen, sizeof(char))))
+ if (NULL != ((yyval._aturl)->url = (char *)calloc(urlLen, sizeof(char))))
{
temp = srvcHead.next;
if (! _LSLP_IS_HEAD(temp) && temp->str != NULL)
{
- strcpy(yyval._aturl->url, temp->str);
+ strcpy((yyval._aturl)->url, temp->str);
temp = temp->next;
}
while (! _LSLP_IS_HEAD(temp) && temp->str != NULL)
{
- strcat(yyval._aturl->url, temp->str);
+ strcat((yyval._aturl)->url, temp->str);
temp = temp->next;
}
temp = siteHead.next;
while (! _LSLP_IS_HEAD(temp) && temp->str != NULL)
{
- strcat(yyval._aturl->url, temp->str);
+ strcat((yyval._aturl)->url, temp->str);
temp = temp->next;
}
temp = pathHead.next;
while (! _LSLP_IS_HEAD(temp) && temp->str != NULL)
{
- strcat(yyval._aturl->url, "/");
- strcat(yyval._aturl->url, temp->str);
+ strcat((yyval._aturl)->url, "/");
+ strcat((yyval._aturl)->url, temp->str);
temp = temp->next;
}
temp = attrHead.next;
while (! _LSLP_IS_HEAD(temp) && temp->str != NULL)
{
- strcat(yyval._aturl->url, ";");
- strcat(yyval._aturl->url, temp->str);
+ strcat((yyval._aturl)->url, ";");
+ strcat((yyval._aturl)->url, temp->str);
temp = temp->next;
}
- yyval._aturl->urlHash = lslpCheckSum(yyval._aturl->url, (int16)strlen(yyval._aturl->url));
+ (yyval._aturl)->urlHash = lslpCheckSum((yyval._aturl)->url, (int16)strlen((yyval._aturl)->url));
}
/* make certain the listheads are initialized */
- yyval._aturl->srvcs.next = yyval._aturl->srvcs.prev = &(yyval._aturl->srvcs);
- yyval._aturl->srvcs.isHead = TRUE;
- yyval._aturl->site.next = yyval._aturl->site.prev = &(yyval._aturl->site);
- yyval._aturl->site.isHead = TRUE;
- yyval._aturl->path.next = yyval._aturl->path.prev = &(yyval._aturl->path);
- yyval._aturl->path.isHead = TRUE;
- yyval._aturl->attrs.next = yyval._aturl->attrs.prev = &(yyval._aturl->attrs);
- yyval._aturl->attrs.isHead = TRUE;
+ (yyval._aturl)->srvcs.next = (yyval._aturl)->srvcs.prev = &((yyval._aturl)->srvcs);
+ (yyval._aturl)->srvcs.isHead = TRUE;
+ (yyval._aturl)->site.next = (yyval._aturl)->site.prev = &((yyval._aturl)->site);
+ (yyval._aturl)->site.isHead = TRUE;
+ (yyval._aturl)->path.next = (yyval._aturl)->path.prev = &((yyval._aturl)->path);
+ (yyval._aturl)->path.isHead = TRUE;
+ (yyval._aturl)->attrs.next = (yyval._aturl)->attrs.prev = &((yyval._aturl)->attrs);
+ (yyval._aturl)->attrs.isHead = TRUE;
if (! _LSLP_IS_EMPTY(&srvcHead ))
{
- _LSLP_LINK_HEAD(&(yyval._aturl->srvcs), &srvcHead);
+ _LSLP_LINK_HEAD(&((yyval._aturl)->srvcs), &srvcHead);
}
if (! _LSLP_IS_EMPTY(&siteHead))
{
- _LSLP_LINK_HEAD(&(yyval._aturl->site), &siteHead);
+ _LSLP_LINK_HEAD(&((yyval._aturl)->site), &siteHead);
}
if (! _LSLP_IS_EMPTY(&pathHead))
{
- _LSLP_LINK_HEAD(&(yyval._aturl->path), &pathHead);
+ _LSLP_LINK_HEAD(&((yyval._aturl)->path), &pathHead);
}
if (! _LSLP_IS_EMPTY(&attrHead))
{
- _LSLP_LINK_HEAD(&(yyval._aturl->attrs), &attrHead);
+ _LSLP_LINK_HEAD(&((yyval._aturl)->attrs), &attrHead);
}
- _LSLP_INSERT_BEFORE(yyval._aturl, &urlHead);
+ _LSLP_INSERT_BEFORE((yyval._aturl), &urlHead);
lslpInitAtomLists();
}
;}
break;
case 3:
-#line 209 "url.y"
+#line 219 "url.y"
{
- yyval._atl = &srvcHead;
- if (yyvsp[0]._atl != NULL)
+ (yyval._atl) = &srvcHead;
+ if ((yyvsp[(1) - (1)]._atl) != NULL)
{
- _LSLP_INSERT_BEFORE(yyvsp[0]._atl, yyval._atl);
+ _LSLP_INSERT_BEFORE((yyvsp[(1) - (1)]._atl), (yyval._atl));
}
;}
break;
case 4:
-#line 217 "url.y"
+#line 227 "url.y"
{
- yyval._atl = &srvcHead;
- if (yyvsp[0]._atl != NULL)
+ (yyval._atl) = &srvcHead;
+ if ((yyvsp[(2) - (2)]._atl) != NULL)
{
- _LSLP_INSERT_BEFORE(yyvsp[0]._atl, yyval._atl);
+ _LSLP_INSERT_BEFORE((yyvsp[(2) - (2)]._atl), (yyval._atl));
}
;}
break;
case 5:
-#line 226 "url.y"
+#line 236 "url.y"
{
- if (NULL != (yyval._atl = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
+ if (NULL != ((yyval._atl) = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
{
- yyval._atl->next = yyval._atl->prev = yyval._atl;
- if (NULL != (yyval._atl->str = (char *)calloc(2 + strlen(yyvsp[-1]._s), sizeof(char))))
+ (yyval._atl)->next = (yyval._atl)->prev = (yyval._atl);
+ if (NULL != ((yyval._atl)->str = (char *)calloc(2 + strlen((yyvsp[(1) - (2)]._s)), sizeof(char))))
{
- strcpy(yyval._atl->str, yyvsp[-1]._s);
- strcat(yyval._atl->str, ":");
- yyval._atl->hash = lslpCheckSum(yyval._atl->str, (int16)strlen(yyval._atl->str));
+ strcpy((yyval._atl)->str, (yyvsp[(1) - (2)]._s));
+ strcat((yyval._atl)->str, ":");
+ (yyval._atl)->hash = lslpCheckSum((yyval._atl)->str, (int16)strlen((yyval._atl)->str));
}
else
{
- free(yyval._atl);
- yyval._atl = NULL;
+ free((yyval._atl));
+ (yyval._atl) = NULL;
}
}
break;
case 6:
-#line 244 "url.y"
+#line 254 "url.y"
{
- if (NULL != (yyval._atl = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
+ if (NULL != ((yyval._atl) = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
{
- yyval._atl->next = yyval._atl->prev = yyval._atl;
- if (NULL != (yyval._atl->str = (char *)calloc(3 + strlen(yyvsp[-3]._s) + strlen(yyvsp[-1]._s), sizeof(char))))
+ (yyval._atl)->next = (yyval._atl)->prev = (yyval._atl);
+ if (NULL != ((yyval._atl)->str = (char *)calloc(3 + strlen((yyvsp[(1) - (4)]._s)) + strlen((yyvsp[(3) - (4)]._s)), sizeof(char))))
{
- strcpy(yyval._atl->str, yyvsp[-3]._s);
- strcat(yyval._atl->str, ".");
- strcat(yyval._atl->str, yyvsp[-1]._s);
- strcat(yyval._atl->str, ":");
- yyval._atl->hash = lslpCheckSum(yyval._atl->str, (int16)strlen(yyval._atl->str));
+ strcpy((yyval._atl)->str, (yyvsp[(1) - (4)]._s));
+ strcat((yyval._atl)->str, ".");
+ strcat((yyval._atl)->str, (yyvsp[(3) - (4)]._s));
+ strcat((yyval._atl)->str, ":");
+ (yyval._atl)->hash = lslpCheckSum((yyval._atl)->str, (int16)strlen((yyval._atl)->str));
}
else
{
- free(yyval._atl);
- yyval._atl = NULL;
+ free((yyval._atl));
+ (yyval._atl) = NULL;
}
}
break;
case 7:
-#line 266 "url.y"
+#line 276 "url.y"
{
- yyval._atl = &siteHead;
- if (yyvsp[0]._atl != NULL)
+ (yyval._atl) = &siteHead;
+ if ((yyvsp[(1) - (1)]._atl) != NULL)
{
- _LSLP_INSERT_BEFORE(yyvsp[0]._atl, yyval._atl);
+ _LSLP_INSERT_BEFORE((yyvsp[(1) - (1)]._atl), (yyval._atl));
}
;}
break;
case 8:
-#line 273 "url.y"
+#line 283 "url.y"
{
- yyval._atl = &siteHead;
- if (yyvsp[-1]._atl != NULL)
+ (yyval._atl) = &siteHead;
+ if ((yyvsp[(1) - (2)]._atl) != NULL)
{
- _LSLP_INSERT_BEFORE(yyvsp[-1]._atl, yyval._atl);
+ _LSLP_INSERT_BEFORE((yyvsp[(1) - (2)]._atl), (yyval._atl));
}
;}
break;
case 9:
-#line 282 "url.y"
+#line 292 "url.y"
{
- if (yyvsp[0]._s != NULL)
+ if ((yyvsp[(1) - (1)]._s) != NULL)
{
- if(NULL != (yyval._atl = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
+ if(NULL != ((yyval._atl) = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
{
- yyval._atl->next = yyval._atl->prev = yyval._atl;
- yyval._atl->str = yyvsp[0]._s;
- yyval._atl->hash = lslpCheckSum(yyval._atl->str, (int16)strlen(yyval._atl->str));
+ (yyval._atl)->next = (yyval._atl)->prev = (yyval._atl);
+ (yyval._atl)->str = (yyvsp[(1) - (1)]._s);
+ (yyval._atl)->hash = lslpCheckSum((yyval._atl)->str, (int16)strlen((yyval._atl)->str));
}
}
else
- yyval._atl = NULL;
+ (yyval._atl) = NULL;
;}
break;
case 10:
-#line 295 "url.y"
+#line 305 "url.y"
{
- if (yyvsp[0]._s != NULL)
+ if ((yyvsp[(1) - (1)]._s) != NULL)
{
- if(NULL != (yyval._atl = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
+ if(NULL != ((yyval._atl) = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
{
- yyval._atl->next = yyval._atl->prev = yyval._atl;
- yyval._atl->str = yyvsp[0]._s;
- yyval._atl->hash = lslpCheckSum(yyval._atl->str, (int16)strlen(yyval._atl->str));
+ (yyval._atl)->next = (yyval._atl)->prev = (yyval._atl);
+ (yyval._atl)->str = (yyvsp[(1) - (1)]._s);
+ (yyval._atl)->hash = lslpCheckSum((yyval._atl)->str, (int16)strlen((yyval._atl)->str));
}
}
else
- yyval._atl = NULL;
+ (yyval._atl) = NULL;
;}
break;
case 11:
-#line 308 "url.y"
+#line 318 "url.y"
{
- if (yyvsp[0]._s != NULL)
+ if ((yyvsp[(1) - (1)]._s) != NULL)
{
- if(NULL != (yyval._atl = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
+ if(NULL != ((yyval._atl) = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
{
- yyval._atl->next = yyval._atl->prev = yyval._atl;
- yyval._atl->str = yyvsp[0]._s;
- yyval._atl->hash = lslpCheckSum(yyval._atl->str, (int16)strlen(yyval._atl->str));
+ (yyval._atl)->next = (yyval._atl)->prev = (yyval._atl);
+ (yyval._atl)->str = (yyvsp[(1) - (1)]._s);
+ (yyval._atl)->hash = lslpCheckSum((yyval._atl)->str, (int16)strlen((yyval._atl)->str));
}
}
else
- yyval._atl = NULL;
+ (yyval._atl) = NULL;
;}
break;
case 12:
-#line 322 "url.y"
+#line 332 "url.y"
{
- if (yyvsp[0]._s != NULL)
+ if ((yyvsp[(1) - (1)]._s) != NULL)
{
- if(NULL != (yyval._atl = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
+ if(NULL != ((yyval._atl) = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
{
- yyval._atl->next = yyval._atl->prev = yyval._atl;
- yyval._atl->str = yyvsp[0]._s;
- yyval._atl->hash = lslpCheckSum(yyval._atl->str, (int16)strlen(yyval._atl->str));
+ (yyval._atl)->next = (yyval._atl)->prev = (yyval._atl);
+ (yyval._atl)->str = (yyvsp[(1) - (1)]._s);
+ (yyval._atl)->hash = lslpCheckSum((yyval._atl)->str, (int16)strlen((yyval._atl)->str));
}
}
else
- yyval._atl = NULL;
+ (yyval._atl) = NULL;
;}
break;
case 13:
-#line 340 "url.y"
+#line 350 "url.y"
{
- yyval._s = strdup("//");
+ (yyval._s) = strdup("//");
;}
break;
case 14:
-#line 343 "url.y"
+#line 353 "url.y"
{
- if(NULL != yyvsp[0]._s && (NULL !=(yyval._s = (char *)calloc(3 + strlen(yyvsp[0]._s), sizeof(char)))))
+ if(NULL != (yyvsp[(3) - (3)]._s) && (NULL !=((yyval._s) = (char *)calloc(3 + strlen((yyvsp[(3) - (3)]._s)), sizeof(char)))))
{
- strcpy(yyval._s, "//");
- strcat(yyval._s, yyvsp[0]._s);
- free(yyvsp[0]._s);
+ strcpy((yyval._s), "//");
+ strcat((yyval._s), (yyvsp[(3) - (3)]._s));
+ free((yyvsp[(3) - (3)]._s));
}
;}
break;
case 15:
-#line 352 "url.y"
+#line 362 "url.y"
{
- if(NULL != yyvsp[0]._s && (NULL !=(yyval._s = (char *)calloc(4 + strlen(yyvsp[-2]._s) + strlen(yyvsp[0]._s), sizeof(char)))))
+ if(NULL != (yyvsp[(5) - (5)]._s) && (NULL !=((yyval._s) = (char *)calloc(4 + strlen((yyvsp[(3) - (5)]._s)) + strlen((yyvsp[(5) - (5)]._s)), sizeof(char)))))
{
- strcpy(yyval._s, "//");
- strcat(yyval._s, yyvsp[-2]._s);
- strcat(yyval._s, "@");
- strcat(yyval._s, yyvsp[0]._s);
+ strcpy((yyval._s), "//");
+ strcat((yyval._s), (yyvsp[(3) - (5)]._s));
+ strcat((yyval._s), "@");
+ strcat((yyval._s), (yyvsp[(5) - (5)]._s));
}
;}
break;
case 16:
-#line 363 "url.y"
+#line 373 "url.y"
{
- yyval._s = strdup(yyvsp[0]._s);
+ (yyval._s) = strdup((yyvsp[(1) - (1)]._s));
;}
break;
case 17:
-#line 368 "url.y"
+#line 378 "url.y"
{
- yyval._s = yyvsp[0]._s;
+ (yyval._s) = (yyvsp[(1) - (1)]._s);
;}
break;
case 18:
-#line 373 "url.y"
+#line 383 "url.y"
{
- if(NULL != (yyval._s = (char *)calloc(strlen(yyvsp[-5]._s) + strlen(yyvsp[-4]._s) + strlen(yyvsp[-2]._s) + strlen(yyvsp[0]._s) + 3, sizeof(char))))
+ if(NULL != ((yyval._s) = (char *)calloc(strlen((yyvsp[(1) - (6)]._s)) + strlen((yyvsp[(2) - (6)]._s)) + strlen((yyvsp[(4) - (6)]._s)) + strlen((yyvsp[(6) - (6)]._s)) + 3, sizeof(char))))
{
- strcpy(yyval._s, yyvsp[-5]._s);
- strcat(yyval._s, yyvsp[-4]._s);
- strcat(yyval._s, ":");
- strcat(yyval._s, yyvsp[-2]._s);
- strcat(yyval._s, ":");
- strcat(yyval._s, yyvsp[0]._s);
+ strcpy((yyval._s), (yyvsp[(1) - (6)]._s));
+ strcat((yyval._s), (yyvsp[(2) - (6)]._s));
+ strcat((yyval._s), ":");
+ strcat((yyval._s), (yyvsp[(4) - (6)]._s));
+ strcat((yyval._s), ":");
+ strcat((yyval._s), (yyvsp[(6) - (6)]._s));
}
;}
break;
case 19:
-#line 386 "url.y"
+#line 396 "url.y"
{
- yyval._s = yyvsp[0]._s;
+ if (NULL != ((yyval._s) = (char *)calloc(strlen((yyvsp[(1) - (1)]._s)) + 2, sizeof(char))))
+ {
+ strcpy((yyval._s), (yyvsp[(1) - (1)]._s));
+ }
;}
break;
case 20:
-#line 389 "url.y"
+#line 402 "url.y"
{
- if (yyvsp[-2]._s != NULL)
+ if ((yyvsp[(1) - (3)]._s) != NULL)
{
- if(NULL != (yyval._s = (char *)calloc(strlen(yyvsp[-2]._s) + strlen(yyvsp[0]._s) + 2, sizeof(char))))
+ if(NULL != ((yyval._s) = (char *)calloc(strlen((yyvsp[(1) - (3)]._s)) + strlen((yyvsp[(3) - (3)]._s)) + 2, sizeof(char))))
{
- strcpy(yyval._s, yyvsp[-2]._s);
- strcat(yyval._s, ":");
- strcat(yyval._s, yyvsp[0]._s);
+ strcpy((yyval._s), (yyvsp[(1) - (3)]._s));
+ strcat((yyval._s), ":");
+ strcat((yyval._s), (yyvsp[(3) - (3)]._s));
}
}
else
- yyval._s = NULL;
+ (yyval._s) = NULL;
;}
break;
case 21:
-#line 404 "url.y"
+#line 417 "url.y"
{
- yyval._s = yyvsp[0]._s;
+ (yyval._s) = (yyvsp[(1) - (1)]._s);
;}
break;
case 22:
-#line 407 "url.y"
+#line 420 "url.y"
{
- yyval._s = yyvsp[0]._s;
+ (yyval._s) = (yyvsp[(1) - (1)]._s);
;}
break;
case 23:
-#line 412 "url.y"
+#line 425 "url.y"
{
;
;}
break;
case 24:
-#line 415 "url.y"
+#line 428 "url.y"
{
;
;}
break;
case 25:
-#line 418 "url.y"
+#line 431 "url.y"
{
;
;}
break;
case 26:
-#line 423 "url.y"
+#line 436 "url.y"
{
- yyval._atl = &pathHead;
- if (yyvsp[0]._atl != NULL)
+ (yyval._atl) = &pathHead;
+ if ((yyvsp[(1) - (1)]._atl) != NULL)
{
- _LSLP_INSERT_BEFORE(yyvsp[0]._atl, yyval._atl);
+ _LSLP_INSERT_BEFORE((yyvsp[(1) - (1)]._atl), (yyval._atl));
}
;}
break;
case 27:
-#line 430 "url.y"
+#line 443 "url.y"
{
- yyval._atl = &pathHead;
- if (yyvsp[0]._atl != NULL)
+ (yyval._atl) = &pathHead;
+ if ((yyvsp[(2) - (2)]._atl) != NULL)
{
- _LSLP_INSERT_BEFORE(yyvsp[0]._atl, yyval._atl);
+ _LSLP_INSERT_BEFORE((yyvsp[(2) - (2)]._atl), (yyval._atl));
}
;}
break;
case 28:
-#line 440 "url.y"
+#line 453 "url.y"
{
/* dangling path slash - do nothing */
- yyval._atl = NULL;
+ (yyval._atl) = NULL;
;}
break;
case 29:
-#line 444 "url.y"
+#line 457 "url.y"
{
- if(NULL != (yyval._atl = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
+ if(NULL != ((yyval._atl) = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
{
- yyval._atl->prev = yyval._atl->next = yyval._atl;
- if(NULL != (yyval._atl->str = (char *)calloc(1 + strlen(yyvsp[0]._s), sizeof(char))))
+ (yyval._atl)->prev = (yyval._atl)->next = (yyval._atl);
+ if(NULL != ((yyval._atl)->str = (char *)calloc(1 + strlen((yyvsp[(2) - (2)]._s)), sizeof(char))))
{
- strcpy(yyval._atl->str, yyvsp[0]._s);
- yyval._atl->hash = lslpCheckSum(yyval._atl->str, (int16)strlen(yyval._atl->str));
+ strcpy((yyval._atl)->str, (yyvsp[(2) - (2)]._s));
+ (yyval._atl)->hash = lslpCheckSum((yyval._atl)->str, (int16)strlen((yyval._atl)->str));
}
else
{
- free(yyval._atl);
- yyval._atl = NULL;
+ free((yyval._atl));
+ (yyval._atl) = NULL;
}
}
break;
case 30:
-#line 462 "url.y"
+#line 475 "url.y"
{
- if(NULL != (yyval._atl = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
+ if(NULL != ((yyval._atl) = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
{
- yyval._atl->prev = yyval._atl->next = yyval._atl;
- if(NULL != (yyval._atl->str = (char *)calloc(1 + strlen(yyvsp[0]._s), sizeof(char))))
+ (yyval._atl)->prev = (yyval._atl)->next = (yyval._atl);
+ if(NULL != ((yyval._atl)->str = (char *)calloc(1 + strlen((yyvsp[(2) - (2)]._s)), sizeof(char))))
{
- strcpy(yyval._atl->str, yyvsp[0]._s);
- yyval._atl->hash = lslpCheckSum(yyval._atl->str, (int16)strlen(yyval._atl->str));
+ strcpy((yyval._atl)->str, (yyvsp[(2) - (2)]._s));
+ (yyval._atl)->hash = lslpCheckSum((yyval._atl)->str, (int16)strlen((yyval._atl)->str));
}
else
{
- free(yyval._atl);
- yyval._atl = NULL;
+ free((yyval._atl));
+ (yyval._atl) = NULL;
}
}
break;
case 31:
-#line 479 "url.y"
+#line 492 "url.y"
{
- if(NULL != (yyval._atl = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
+ if(NULL != ((yyval._atl) = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
{
- yyval._atl->prev = yyval._atl->next = yyval._atl;
- if(NULL != (yyval._atl->str = (char *)calloc(1 + strlen(yyvsp[0]._s), sizeof(char))))
+ (yyval._atl)->prev = (yyval._atl)->next = (yyval._atl);
+ if(NULL != ((yyval._atl)->str = (char *)calloc(1 + strlen((yyvsp[(2) - (2)]._s)), sizeof(char))))
{
- strcpy(yyval._atl->str, yyvsp[0]._s);
- yyval._atl->hash = lslpCheckSum(yyval._atl->str, (int16)strlen(yyval._atl->str));
+ strcpy((yyval._atl)->str, (yyvsp[(2) - (2)]._s));
+ (yyval._atl)->hash = lslpCheckSum((yyval._atl)->str, (int16)strlen((yyval._atl)->str));
}
else
{
- free(yyval._atl);
- yyval._atl = NULL;
+ free((yyval._atl));
+ (yyval._atl) = NULL;
}
}
;}
break;
case 32:
-#line 497 "url.y"
+#line 510 "url.y"
{
- yyval._atl = &attrHead;
- if (yyvsp[0]._atl != NULL)
+ (yyval._atl) = &attrHead;
+ if ((yyvsp[(1) - (1)]._atl) != NULL)
{
- _LSLP_INSERT_BEFORE(yyvsp[0]._atl, yyval._atl);
+ _LSLP_INSERT_BEFORE((yyvsp[(1) - (1)]._atl), (yyval._atl));
}
;}
break;
case 33:
-#line 504 "url.y"
+#line 517 "url.y"
{
- yyval._atl = &attrHead;
- if (yyvsp[0]._atl != NULL)
+ (yyval._atl) = &attrHead;
+ if ((yyvsp[(2) - (2)]._atl) != NULL)
{
- _LSLP_INSERT_BEFORE(yyvsp[0]._atl, yyval._atl);
+ _LSLP_INSERT_BEFORE((yyvsp[(2) - (2)]._atl), (yyval._atl));
}
;}
break;
case 34:
-#line 513 "url.y"
+#line 526 "url.y"
{
- if(NULL != (yyval._atl = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
+ if(NULL != ((yyval._atl) = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
{
- yyval._atl->prev = yyval._atl->next = yyval._atl;
- if(NULL != (yyval._atl->str = (char *)calloc(1 + strlen(yyvsp[0]._s), sizeof(char))))
+ (yyval._atl)->prev = (yyval._atl)->next = (yyval._atl);
+ if(NULL != ((yyval._atl)->str = (char *)calloc(1 + strlen((yyvsp[(2) - (2)]._s)), sizeof(char))))
{
- strcpy(yyval._atl->str, yyvsp[0]._s);
- yyval._atl->hash = lslpCheckSum(yyval._atl->str, (int16)strlen(yyval._atl->str));
+ strcpy((yyval._atl)->str, (yyvsp[(2) - (2)]._s));
+ (yyval._atl)->hash = lslpCheckSum((yyval._atl)->str, (int16)strlen((yyval._atl)->str));
}
else
{
- free(yyval._atl);
- yyval._atl = NULL;
+ free((yyval._atl));
+ (yyval._atl) = NULL;
}
}
;}
break;
case 35:
-#line 530 "url.y"
+#line 543 "url.y"
{
- if(NULL != (yyval._atl = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
+ if(NULL != ((yyval._atl) = (lslpAtomList *)calloc(1, sizeof(lslpAtomList))))
{
- yyval._atl->prev = yyval._atl->next = yyval._atl;
- if(NULL != (yyval._atl->str = (char *)calloc(2 + strlen(yyvsp[-2]._s) + strlen(yyvsp[0]._s), sizeof(char))))
+ (yyval._atl)->prev = (yyval._atl)->next = (yyval._atl);
+ if(NULL != ((yyval._atl)->str = (char *)calloc(2 + strlen((yyvsp[(2) - (4)]._s)) + strlen((yyvsp[(4) - (4)]._s)), sizeof(char))))
{
- strcpy(yyval._atl->str, yyvsp[-2]._s);
- strcat(yyval._atl->str, "=");
- strcat(yyval._atl->str, yyvsp[0]._s);
- yyval._atl->hash = lslpCheckSum(yyval._atl->str, (int16)strlen(yyval._atl->str));
+ strcpy((yyval._atl)->str, (yyvsp[(2) - (4)]._s));
+ strcat((yyval._atl)->str, "=");
+ strcat((yyval._atl)->str, (yyvsp[(4) - (4)]._s));
+ (yyval._atl)->hash = lslpCheckSum((yyval._atl)->str, (int16)strlen((yyval._atl)->str));
}
else
{
- free(yyval._atl);
- yyval._atl = NULL;
+ free((yyval._atl));
+ (yyval._atl) = NULL;
}
}
;}
break;
+/* Line 1267 of yacc.c. */
+#line 1953 "y_url.c"
+ default: break;
}
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-/* Line 1000 of yacc.c. */
-#line 1610 "y_url.c"
-\f
- yyvsp -= yylen;
- yyssp -= yylen;
-
-
+ YYPOPSTACK (yylen);
+ yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
if (!yyerrstatus)
{
++yynerrs;
-#if YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (YYPACT_NINF < yyn && yyn < YYLAST)
- {
- YYSIZE_T yysize = 0;
- int yytype = YYTRANSLATE (yychar);
- const char* yyprefix;
- char *yymsg;
- int yyx;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 0;
-
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+#if ! YYERROR_VERBOSE
+ yyerror (YY_("syntax error"));
+#else
+ {
+ YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+ if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+ {
+ YYSIZE_T yyalloc = 2 * yysize;
+ if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+ yyalloc = YYSTACK_ALLOC_MAXIMUM;
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+ if (yymsg)
+ yymsg_alloc = yyalloc;
+ else
{
- yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
- yycount += 1;
- if (yycount == 5)
- {
- yysize = 0;
- break;
- }
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
}
- yysize += (sizeof ("syntax error, unexpected ")
- + yystrlen (yytname[yytype]));
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg != 0)
- {
- char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
- yyp = yystpcpy (yyp, yytname[yytype]);
-
- if (yycount < 5)
- {
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- yyp = yystpcpy (yyp, yyprefix);
- yyp = yystpcpy (yyp, yytname[yyx]);
- yyprefix = " or ";
- }
- }
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
- }
- else
- yyerror ("syntax error; also virtual memory exhausted");
- }
- else
-#endif /* YYERROR_VERBOSE */
- yyerror ("syntax error");
+ }
+
+ if (0 < yysize && yysize <= yymsg_alloc)
+ {
+ (void) yysyntax_error (yymsg, yystate, yychar);
+ yyerror (yymsg);
+ }
+ else
+ {
+ yyerror (YY_("syntax error"));
+ if (yysize != 0)
+ goto yyexhaustedlab;
+ }
+ }
+#endif
}
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse lookahead token after an
+ /* If just tried and failed to reuse look-ahead token after an
error, discard it. */
if (yychar <= YYEOF)
- {
- /* If at end of input, pop the error token,
- then the rest of the stack, then return failure. */
+ {
+ /* Return failure if at end of input. */
if (yychar == YYEOF)
- for (;;)
- {
- YYPOPSTACK;
- if (yyssp == yyss)
- YYABORT;
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[*yyssp], yyvsp);
- }
- }
+ YYABORT;
+ }
else
{
- YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
- yydestruct (yytoken, &yylval);
+ yydestruct ("Error: discarding",
+ yytoken, &yylval);
yychar = YYEMPTY;
-
}
}
- /* Else will try to reuse lookahead token after shifting the error
+ /* Else will try to reuse look-ahead token after shifting the error
token. */
goto yyerrlab1;
`---------------------------------------------------*/
yyerrorlab:
-#ifdef __GNUC__
- /* Pacify GCC when the user code never invokes YYERROR and the label
- yyerrorlab therefore never appears in user code. */
- if (0)
+ /* Pacify compilers like GCC when the user code never invokes
+ YYERROR and the label yyerrorlab therefore never appears in user
+ code. */
+ if (/*CONSTCOND*/ 0)
goto yyerrorlab;
-#endif
- yyvsp -= yylen;
- yyssp -= yylen;
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYERROR. */
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
yystate = *yyssp;
goto yyerrlab1;
if (yyssp == yyss)
YYABORT;
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[yystate], yyvsp);
- YYPOPSTACK;
+
+ yydestruct ("Error: popping",
+ yystos[yystate], yyvsp);
+ YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
if (yyn == YYFINAL)
YYACCEPT;
- YYDPRINTF ((stderr, "Shifting error token, "));
-
*++yyvsp = yylval;
+ /* Shift the error token. */
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
yystate = yyn;
goto yynewstate;
goto yyreturn;
#ifndef yyoverflow
-/*----------------------------------------------.
-| yyoverflowlab -- parser overflow comes here. |
-`----------------------------------------------*/
-yyoverflowlab:
- yyerror ("parser stack overflow");
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here. |
+`-------------------------------------------------*/
+yyexhaustedlab:
+ yyerror (YY_("memory exhausted"));
yyresult = 2;
/* Fall through. */
#endif
yyreturn:
+ if (yychar != YYEOF && yychar != YYEMPTY)
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval);
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYABORT or YYACCEPT. */
+ YYPOPSTACK (yylen);
+ YY_STACK_PRINT (yyss, yyssp);
+ while (yyssp != yyss)
+ {
+ yydestruct ("Cleanup: popping",
+ yystos[*yyssp], yyvsp);
+ YYPOPSTACK (1);
+ }
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
- return yyresult;
+#if YYERROR_VERBOSE
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+#endif
+ /* Make sure YYID is used. */
+ return YYID (yyresult);
}
-#line 550 "url.y"
+#line 563 "url.y"
// 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.
//
-//==============================================================================
-/* A Bison parser, made by GNU Bison 1.875c. */
+//=============================================================================
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+//NOCHKSRC
+
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
_ZONE = 267
};
#endif
+/* Tokens. */
#define _RESERVED 258
#define _HEXDIG 259
#define _STAG 260
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 95 "url.y"
-typedef union YYSTYPE {
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 105 "url.y"
+{
int32 _i;
char *_s;
lslpAtomList *_atl;
lslpAtomizedURL *_aturl;
-} YYSTYPE;
-/* Line 1275 of yacc.c. */
-#line 68 "y_url.h"
+}
+/* Line 1529 of yacc.c. */
+#line 80 "y_url.h"
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
extern YYSTYPE urllval;
-
-
// 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.
//
-//==============================================================================
+//=============================================================================
Terminals which are not used
_RESERVED
/*** define the following token to import labels from the slp_client library */
#define SLP_LIB_IMPORT
#include "../slp_client/slp_client.h"
+#include "../slp_client/slp_utils.h"
static char *type;
int main(int argc, char **argv)
{
+#ifdef PEGASUS_ENABLE_IPV6
+ struct in6_addr ip6_loop = PEGASUS_IPV6_LOOPBACK_INIT;
+ struct in6_addr ip6_addr;
+#endif
struct slp_client *client;
lslpMsg responses, *temp;
"DSA",
scopes,
FALSE,
- dir_agent)))
+ dir_agent,
+ type)))
{
- if (addr != NULL && inet_addr(addr) == inet_addr("127.0.0.1"))
+ if (slp_is_loop_back_addr(addr))
{
client->local_srv_req(client, type, predicate, scopes);
}
}
else
{
- SOCKADDR_IN address;
- address.sin_port = htons(port);
- address.sin_family = AF_INET;
- if(addr != NULL)
+ if (!addr)
{
- address.sin_addr.s_addr = inet_addr(addr);
- client->unicast_srv_req(
- client,
- type,
- predicate,
- scopes,
- &address);
+ client->converge_srv_req(client, type, predicate, scopes);
}
else
{
- address.sin_addr.s_addr = _LSLP_MCAST;
- client->converge_srv_req(client, type, predicate, scopes);
+#ifdef PEGASUS_ENABLE_IPV6
+ SOCKADDR_IN6 ip6;
+#endif
+ SOCKADDR_IN ip4;
+ void *target = 0;
+
+ if (slp_is_valid_ip4_addr(addr))
+ {
+ ip4.sin_port = htons(port);
+ ip4.sin_family = AF_INET;
+ ip4.sin_addr.s_addr = inet_addr(addr);
+ target = &ip4;
+ }
+#ifdef PEGASUS_ENABLE_IPV6
+ else
+ {
+ memset(&ip6, 0, sizeof(ip6));
+ ip6.sin6_port = htons(port);
+ ip6.sin6_family = AF_INET6;
+ slp_pton(AF_INET6, addr, &ip6.sin6_addr);
+ target = &ip6;
+ }
+#endif
+ if(target)
+ {
+ client->unicast_srv_req(
+ client,
+ type,
+ predicate,
+ scopes,
+ (SOCKADDR*)target);
+ }
}
}
#define SLP_LIB_IMPORT
#include "../slp_client/slp_client.h"
+#include "../slp_client/slp_utils.h"
#if defined(PEGASUS_OS_TYPE_WINDOWS)
#include <time.h>
#endif
"DSA",
scopes,
should_listen,
- dir_agent)))
+ dir_agent,
+ type)))
{
now = (last = time(NULL));
- if (addr != NULL && inet_addr(addr) == inet_addr("127.0.0.1"))
+ if (slp_is_loop_back_addr(addr))
{
count = client->srv_reg_local(
client,
// Parse the list and check for the required data.
// Returns 'true' if the required data is found otherwise
// returns 'false'
-BOOL parseFind(lslpMsg *temp, const char* httpAttr)
+BOOL parseFind(lslpMsg *responses, const char* httpAttr)
{
BOOL found = false;
lslpURL *url_list;
- if (temp != NULL && temp->type == srvRply)
+ lslpMsg *temp;
+
+ temp = responses->next;
+ while (1)
{
- if ((NULL != temp->msg.srvRply.urlList)
+ if ( (temp->type == srvRply) && (NULL != temp->msg.srvRply.urlList)
&& (! _LSLP_IS_EMPTY(temp->msg.srvRply.urlList)))
{/*start of url if*/
url_list = temp->msg.srvRply.urlList->next;
attrs = attrs->next;
} //while traversing attr list
}
- else // if no attr list, print the record separator
- {
- printf("%c", rs);
- }
url_list = url_list->next;
// if there is another url, print a record separator
} // while traversing url list
+ if (found)
+ {
+ break;
+ }
} // if there are urls to print
- // print the record separator
- printf("%c", rs);
+ if (temp->next == responses)
+ {
+ break;
+ }
+ temp = temp->next;
}
return found;
char *httpAttrs = (char *)NULL;
//Create slp client
- client = create_slp_client (addr,iface,SLP_PORT,"DSA",scopes,FALSE,FALSE);
+ client = create_slp_client (addr,iface,SLP_PORT,"DSA",
+ scopes,FALSE,FALSE, 0);
PEGASUS_TEST_ASSERT(NULL != client);
// discover all responses
// retrieve the response head.
PEGASUS_TEST_ASSERT(client->get_response (client, &responses));
- temp = responses.next;
+ temp = &responses;
// Get all the SLP attributes and data for the Pegasus cimserver.
SLPHttpAttribObj.fillData("http");
// data and data retrieved from the SLP SA.
PEGASUS_TEST_ASSERT (parseFind(temp, httpAttrs));
- free(temp);
free(httpAttrs);
destroy_slp_client(client);
return;
lslpMsg responses,*temp;
//Create slp client
- client = create_slp_client (addr,iface,SLP_PORT,"DSA",scopes,FALSE,FALSE);
+ client = create_slp_client (addr,iface,SLP_PORT,"DSA",
+ scopes,FALSE,FALSE, 0);
PEGASUS_TEST_ASSERT(NULL != client);
/* Register with SLP using http. This assert would fail if SLP SA is not
// retrieve the response head.
PEGASUS_TEST_ASSERT(client->get_response (client, &responses));
- temp = responses.next;
+ temp = &responses;
// parse the response list and check for the required response.
PEGASUS_TEST_ASSERT (parseFind(temp, httpAttrs1));
- free(temp);
destroy_slp_client(client);
return;
}
lslpMsg responses,*temp,*temp1;
// Creates slp client
- client = create_slp_client (addr,iface,SLP_PORT,"DSA",scopes,FALSE,FALSE);
+ client = create_slp_client (addr,iface,SLP_PORT,"DSA",scopes,
+ FALSE,FALSE, 0);
PEGASUS_TEST_ASSERT(NULL != client);
//Register http with SLP. This assert would fail if SLP SA is not running
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
PEGASUS_TEST_ASSERT(client->get_response (client, &responses));
- temp = responses.next;
+ temp = &responses;
//check if the registered data is same ot not.
PEGASUS_TEST_ASSERT (parseFind(temp, httpAttrs1));
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
PEGASUS_TEST_ASSERT(client->get_response (client, &responses));
- temp = responses.next;
+ temp = &responses;
//check if the registered data is same ot not.
PEGASUS_TEST_ASSERT (parseFind(temp, httpAttrs2));
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
client->get_response (client, &responses);
- temp1 = responses.next;
+ temp1 = &responses;
// Check if unregister service can be found
PEGASUS_TEST_ASSERT(!parseFind(temp1, httpAttrs1));
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
client->get_response (client, &responses);
- temp1 = responses.next;
+ temp1 = &responses;
// Check if unregister service can be found
PEGASUS_TEST_ASSERT(!parseFind(temp1, httpAttrs2));
- free(temp);
- free(temp1);
destroy_slp_client(client);
return;
}
lslpMsg responses,*temp;
// Creates slp client
- client = create_slp_client (addr,iface,SLP_PORT,"DSA",scopes,FALSE,FALSE);
+ client = create_slp_client (addr,iface,SLP_PORT,"DSA",
+ scopes,FALSE,FALSE, 0);
PEGASUS_TEST_ASSERT(NULL != client);
/* Register with SLP using http. This assert would fail if SLP SA is not
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
PEGASUS_TEST_ASSERT(client->get_response (client, &responses));
- temp = responses.next;
+ temp = &responses;
//check if the registered data is same ot not.
PEGASUS_TEST_ASSERT (parseFind(temp, httpAttrs1));
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
client->get_response (client, &responses);
- temp = responses.next;
+ temp = &responses;
// Check if unregister service can be found
PEGASUS_TEST_ASSERT(!parseFind(temp, httpAttrs1));
- free(temp);
destroy_slp_client(client);
return;
}
lslpMsg responses,*temp;
// Creates slp client
- client = create_slp_client (addr,iface,SLP_PORT,"DSA", scopes,FALSE,FALSE);
+ client = create_slp_client (addr,iface,SLP_PORT,"DSA",
+ scopes,FALSE,FALSE, 0);
PEGASUS_TEST_ASSERT(NULL != client);
/* Register with SLP using http. This assert would fail if SLP SA is not
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
PEGASUS_TEST_ASSERT(client->get_response (client, &responses));
- temp = responses.next;
+ temp = &responses;
//check if the registered data is same ot not.
PEGASUS_TEST_ASSERT (parseFind(temp, httpAttrs1));
+ temp = &responses;
//Check if unregistered data can can be found
PEGASUS_TEST_ASSERT (!parseFind(temp, httpAttrs2));
- free(temp);
destroy_slp_client(client);
return( 32 );
}
char *changedata = (char *)NULL;
// Creates slp client
- client = create_slp_client (addr,iface,SLP_PORT,"DSA",scopes,FALSE,FALSE);
+ client = create_slp_client (addr,iface,SLP_PORT,"DSA",
+ scopes,FALSE,FALSE, 0);
PEGASUS_TEST_ASSERT(NULL != client);
/* Register with SLP using http. This assert would fail if SLP SA is not
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
PEGASUS_TEST_ASSERT(client->get_response (client, &responses));
- temp = responses.next;
+ temp = &responses;
//check if the registered data is same ot not.
PEGASUS_TEST_ASSERT (parseFind(temp, httpAttrs1));
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
PEGASUS_TEST_ASSERT(client->get_response (client, &responses));
- temp = responses.next;
+ temp = &responses;
//check if the registered data is same ot not.
PEGASUS_TEST_ASSERT (parseFind(temp, httpAttrs2));
- free(temp);
destroy_slp_client(client);
return;
}
lslpMsg responses, *temp;
// Creates slp client
- client = create_slp_client (addr,iface,SLP_PORT,"DSA",scopes,FALSE,FALSE);
+ client = create_slp_client (addr,iface,SLP_PORT,"DSA",
+ scopes,FALSE,FALSE, 0);
PEGASUS_TEST_ASSERT(NULL != client);
PEGASUS_TEST_ASSERT(client->srv_reg_local (client, httpUrl1, httpAttrs1,
type, scopes, 0));
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
client->get_response (client, &responses);
- temp = responses.next;
+ temp = &responses;
// Check if unregister service can be found
PEGASUS_TEST_ASSERT(!parseFind(temp, httpAttrs1));
- free(temp);
destroy_slp_client(client);
return;
}
lslpMsg responses,*temp;
// Creates slp client
- client = create_slp_client (addr,iface,SLP_PORT,"DSA",scopes,FALSE,FALSE);
+ client = create_slp_client (addr,iface,SLP_PORT,"DSA",
+ scopes,FALSE,FALSE, 0);
PEGASUS_TEST_ASSERT(NULL != client);
/* Register with SLP using http. This assert would fail if SLP SA is
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
PEGASUS_TEST_ASSERT(client->get_response (client, &responses));
- temp = responses.next;
+ temp = &responses;
//check if the registered data is same ot not.
PEGASUS_TEST_ASSERT (parseFind(temp, httpAttrs1));
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
PEGASUS_TEST_ASSERT(client->get_response (client, &responses));
- temp = responses.next;
+ temp = &responses;
//check if the registered data is same ot not.
PEGASUS_TEST_ASSERT (parseFind(temp, httpAttrs1));
- free(temp);
destroy_slp_client(client);
return;
}
char *changedata = (char *)NULL;
// Creates slp client
- client = create_slp_client (addr,iface,SLP_PORT,"DSA",scopes,FALSE,FALSE);
+ client = create_slp_client (addr,iface,SLP_PORT,"DSA",
+ scopes,FALSE,FALSE, 0);
PEGASUS_TEST_ASSERT(NULL != client);
/* Register with SLP using http. This assert would fail if SLP SA is
registration data with "Changed". Register with the modified data and
check for success case and failure case.
*/
- if (temp != NULL && temp->type == srvRply)
+ while(1)
{
- if ((NULL != temp->msg.srvRply.urlList) &&
+ if ( (temp->type == srvRply) && (NULL != temp->msg.srvRply.urlList) &&
(! _LSLP_IS_EMPTY(temp->msg.srvRply.urlList)))//start of url if
{
url_list = temp->msg.srvRply.urlList->next;
attrs = attrs->next;
} //while traversing attr list
}
- else // if no attr list, print the record separator
- {
- printf("%c", rs);
- }
// if there is another url, print a record separator
url_list = url_list->next;
} // while traversing url list
} // if there are urls to print
- printf("%c", rs);
+ if (temp->next == &responses)
+ {
+ break;
+ }
+ temp = temp->next;
}
// Register with SLP using http with modified data. This assert would fail
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
PEGASUS_TEST_ASSERT(client->get_response (client, &responses));
- temp = responses.next;
+ temp = &responses;
// Check for the correctness of the modified data
PEGASUS_TEST_ASSERT (parseFind(temp, changedata));
+ temp = &responses;
//Failure case -- Check for data prior to modification .
PEGASUS_TEST_ASSERT (!parseFind(temp, httpAttrs1));
- free(temp);
free(changedata);
destroy_slp_client(client);
return;
lslpMsg responses,*temp;
// Create SLP Client
- client = create_slp_client (addr,iface,SLP_PORT,"DSA",scopes,FALSE,FALSE);
+ client = create_slp_client (addr,iface,SLP_PORT,"DSA",
+ scopes,FALSE,FALSE, 0);
PEGASUS_TEST_ASSERT(NULL != client);
// Register with SLP using https. This assert would fail if SLP SA is
responses.isHead = TRUE;
responses.next = responses.prev = &responses;
PEGASUS_TEST_ASSERT(client->get_response (client, &responses));
- temp = responses.next;
+ temp = &responses;
PEGASUS_TEST_ASSERT (parseFind(temp, httpAttrs2));
- free(temp);
destroy_slp_client(client);
return;
}