xrootd
Loading...
Searching...
No Matches
XrdHttpUtils.hh
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// This file is part of XrdHTTP: A pragmatic implementation of the
3// HTTP/WebDAV protocol for the Xrootd framework
4//
5// Copyright (c) 2013 by European Organization for Nuclear Research (CERN)
6// Author: Fabrizio Furano <furano@cern.ch>
7// File Date: Apr 2013
8//------------------------------------------------------------------------------
9// XRootD is free software: you can redistribute it and/or modify
10// it under the terms of the GNU Lesser General Public License as published by
11// the Free Software Foundation, either version 3 of the License, or
12// (at your option) any later version.
13//
14// XRootD is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17// GNU General Public License for more details.
18//
19// You should have received a copy of the GNU Lesser General Public License
20// along with XRootD. If not, see <http://www.gnu.org/licenses/>.
21//------------------------------------------------------------------------------
22
23
24
25
26
27
28
38#include "XProtocol/XPtypes.hh"
40
41#ifndef XRDHTTPUTILS_HH
42#define XRDHTTPUTILS_HH
43
44
45// GetHost from URL
46// Parse an URL and extract the host name and port
47// Return 0 if OK
48int parseURL(char *url, char *host, int &port, char **path);
49
50// Simple itoa function
51std::string itos(long i);
52
53// Home made implementation of strchrnul
54char *mystrchrnul(const char *s, int c);
55
57 char *hash,
58
59 const char *fn,
60
61 kXR_int16 req,
62
63 XrdSecEntity *secent,
64
65 time_t tim,
66
67 const char *key);
68
69
71 const char *h1,
72 const char *h2);
73
74
75bool Fromhexdigest(const unsigned char *input, int length, unsigned char *out);
76
77void Tobase64(const unsigned char *input, int length, char *out);
78
79
80// Create a new quoted string
81char *quote(const char *str);
82
83// unquote a string and return a new one
84char *unquote(char *str);
85
86
87
88
89// Escape a string and return a new one
90char *escapeXML(const char *str);
91
92
93
94#endif /* XRDHTTPUTILS_HH */
95
short kXR_int16
Definition: XPtypes.hh:66
int parseURL(char *url, char *host, int &port, char **path)
std::string itos(long i)
void Tobase64(const unsigned char *input, int length, char *out)
int compareHash(const char *h1, const char *h2)
bool Fromhexdigest(const unsigned char *input, int length, unsigned char *out)
char * unquote(char *str)
char * quote(const char *str)
char * escapeXML(const char *str)
void calcHashes(char *hash, const char *fn, kXR_int16 req, XrdSecEntity *secent, time_t tim, const char *key)
char * mystrchrnul(const char *s, int c)
Definition: XrdSecEntity.hh:64