mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-24 11:33:50 +08:00
netutils/netlib/netlib_parseurl.c: Add a more flexible version of netlib_parsehttpurl. This one can parse any URL, and is extensible so future improvements keep the same API.
This commit is contained in:
committed by
Gregory Nutt
parent
601659ff59
commit
fe0954cd62
@@ -185,6 +185,28 @@ struct netlib_ipv6_route_s
|
||||
#endif
|
||||
#endif /* HAVE_ROUTE_PROCFS */
|
||||
|
||||
#ifdef CONFIG_NETUTILS_NETLIB_GENERICURLPARSER
|
||||
struct url_s
|
||||
{
|
||||
FAR char *scheme;
|
||||
int schemelen;
|
||||
FAR char *user;
|
||||
int userlen;
|
||||
FAR char *password;
|
||||
int passwordlen;
|
||||
FAR char *host;
|
||||
int hostlen;
|
||||
int port;
|
||||
FAR char *path;
|
||||
int pathlen;
|
||||
FAR char *parameters;
|
||||
int parameterslen;
|
||||
FAR char *bookmark;
|
||||
int bookmarklen;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
@@ -323,6 +345,10 @@ int netlib_parsehttpurl(FAR const char *url, uint16_t *port,
|
||||
FAR char *hostname, int hostlen,
|
||||
FAR char *filename, int namelen);
|
||||
|
||||
#ifdef CONFIG_NETUTILS_NETLIB_GENERICURLPARSER
|
||||
int netlib_parseurl(FAR const char *str, FAR struct url_s *url);
|
||||
#endif
|
||||
|
||||
/* Generic server logic */
|
||||
|
||||
int netlib_listenon(uint16_t portno);
|
||||
|
||||
Reference in New Issue
Block a user