Data Structures | Enumerations | Functions | Variables

URL.h File Reference

A brief file description. More...

#include "Arena.h"
#include "HdrToken.h"
#include "HdrHeap.h"
#include "INK_MD5.h"
#include "MMH.h"
#include "MIME.h"
#include "ink_apidefs.h"
Include dependency graph for URL.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  URLImpl
class  URLHashContext
 Crypto Hash context for URLs. More...
class  URL

Enumerations

enum  URLType { URL_TYPE_NONE, URL_TYPE_HTTP, URL_TYPE_HTTPS }

Functions

void url_adjust (MarshalXlate *str_xlate, int num_xlate)
void url_init ()
URLImplurl_create (HdrHeap *heap)
void url_clear (URLImpl *url_impl)
void url_nuke_proxy_stuff (URLImpl *d_url)
URLImplurl_copy (URLImpl *s_url, HdrHeap *s_heap, HdrHeap *d_heap, bool inherit_strs=true)
void url_copy_onto (URLImpl *s_url, HdrHeap *s_heap, URLImpl *d_url, HdrHeap *d_heap, bool inherit_strs=true)
void url_copy_onto_as_server_url (URLImpl *s_url, HdrHeap *s_heap, URLImpl *d_url, HdrHeap *d_heap, bool inherit_strs=true)
 This routine is like url_copy_onto, but clears the scheme/host/user/pass/port components, resulting in a server-style URL.
int url_print (URLImpl *u, char *buf, int bufsize, int *bufindex, int *dumpoffset)
void url_describe (HdrHeapObjImpl *raw, bool recurse)
int url_length_get (URLImpl *url)
char * url_string_get (URLImpl *url, Arena *arena, int *length, HdrHeap *heap)
void url_clear_string_ref (URLImpl *url)
char * url_string_get_ref (HdrHeap *heap, URLImpl *url, int *length)
void url_called_set (URLImpl *url)
char * url_string_get_buf (URLImpl *url, char *dstbuf, int dstbuf_size, int *length)
const char * url_scheme_get (URLImpl *url, int *length)
void url_MD5_get (URLImpl *url, CryptoHash *md5)
void url_host_MD5_get (URLImpl *url, CryptoHash *md5)
const char * url_scheme_set (HdrHeap *heap, URLImpl *url, const char *value, int value_wks_idx, int length, bool copy_string)
void url_user_set (HdrHeap *heap, URLImpl *url, const char *value, int length, bool copy_string)
void url_password_set (HdrHeap *heap, URLImpl *url, const char *value, int length, bool copy_string)
void url_host_set (HdrHeap *heap, URLImpl *url, const char *value, int length, bool copy_string)
void url_port_set (HdrHeap *heap, URLImpl *url, unsigned int port)
void url_path_set (HdrHeap *heap, URLImpl *url, const char *value, int length, bool copy_string)
void url_type_set (URLImpl *url, unsigned int type)
void url_params_set (HdrHeap *heap, URLImpl *url, const char *value, int length, bool copy_string)
void url_query_set (HdrHeap *heap, URLImpl *url, const char *value, int length, bool copy_string)
void url_fragment_set (HdrHeap *heap, URLImpl *url, const char *value, int length, bool copy_string)
MIMEParseResult url_parse (HdrHeap *heap, URLImpl *url, const char **start, const char *end, bool copy_strings)
MIMEParseResult url_parse_no_path_component_breakdown (HdrHeap *heap, URLImpl *url, const char **start, const char *end, bool copy_strings)
MIMEParseResult url_parse_internet (HdrHeap *heap, URLImpl *url, const char **start, const char *end, bool copy_strings)
 Parse internet URL.
MIMEParseResult url_parse_http (HdrHeap *heap, URLImpl *url, const char **start, const char *end, bool copy_strings)
MIMEParseResult url_parse_http_no_path_component_breakdown (HdrHeap *heap, URLImpl *url, const char **start, const char *end, bool copy_strings)
char * url_unescapify (Arena *arena, const char *str, int length)
void unescape_str (char *&buf, char *buf_e, const char *&str, const char *str_e, int &state)
void unescape_str_tolower (char *&buf, char *end, const char *&str, const char *str_e, int &state)
int url_canonicalize_port (int type, int port)

Variables

const char * URL_SCHEME_FILE
const char * URL_SCHEME_FTP
const char * URL_SCHEME_GOPHER
const char * URL_SCHEME_HTTP
const char * URL_SCHEME_HTTPS
const char * URL_SCHEME_WS
const char * URL_SCHEME_WSS
const char * URL_SCHEME_MAILTO
const char * URL_SCHEME_NEWS
const char * URL_SCHEME_NNTP
const char * URL_SCHEME_PROSPERO
const char * URL_SCHEME_TELNET
const char * URL_SCHEME_TUNNEL
const char * URL_SCHEME_WAIS
const char * URL_SCHEME_PNM
const char * URL_SCHEME_RTSP
const char * URL_SCHEME_RTSPU
const char * URL_SCHEME_MMS
const char * URL_SCHEME_MMSU
const char * URL_SCHEME_MMST
int URL_WKSIDX_FILE
int URL_WKSIDX_FTP
int URL_WKSIDX_GOPHER
int URL_WKSIDX_HTTP
int URL_WKSIDX_HTTPS
int URL_WKSIDX_WS
int URL_WKSIDX_WSS
int URL_WKSIDX_MAILTO
int URL_WKSIDX_NEWS
int URL_WKSIDX_NNTP
int URL_WKSIDX_PROSPERO
int URL_WKSIDX_TELNET
int URL_WKSIDX_TUNNEL
int URL_WKSIDX_WAIS
int URL_WKSIDX_PNM
int URL_WKSIDX_RTSP
int URL_WKSIDX_RTSPU
int URL_WKSIDX_MMS
int URL_WKSIDX_MMSU
int URL_WKSIDX_MMST
int URL_LEN_FILE
int URL_LEN_FTP
int URL_LEN_GOPHER
int URL_LEN_HTTP
int URL_LEN_HTTPS
int URL_LEN_WS
int URL_LEN_WSS
int URL_LEN_MAILTO
int URL_LEN_NEWS
int URL_LEN_NNTP
int URL_LEN_PROSPERO
int URL_LEN_TELNET
int URL_LEN_TUNNEL
int URL_LEN_WAIS
int URL_LEN_PNM
int URL_LEN_RTSP
int URL_LEN_RTSPU
int URL_LEN_MMS
int URL_LEN_MMSU
int URL_LEN_MMST

Detailed Description

A brief file description.

License

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file URL.h.


Enumeration Type Documentation

enum URLType
Enumerator:
URL_TYPE_NONE 
URL_TYPE_HTTP 
URL_TYPE_HTTPS 

Definition at line 36 of file URL.h.


Function Documentation

void unescape_str ( char *&  buf,
char *  buf_e,
const char *&  str,
const char *  str_e,
int &  state 
)
void unescape_str_tolower ( char *&  buf,
char *  end,
const char *&  str,
const char *  str_e,
int &  state 
)
void url_adjust ( MarshalXlate str_xlate,
int  num_xlate 
)
void url_called_set ( URLImpl url  ) 
int url_canonicalize_port ( int  type,
int  port 
) [inline]
void url_clear ( URLImpl url_impl  ) 

Definition at line 242 of file URL.cc.

References obj_clear_data().

Referenced by http_hdr_copy_onto(), PrefetchBlaster::init(), TSUrlParse(), and HTTPHdr::url_set().

void url_clear_string_ref ( URLImpl url  ) 
URLImpl* url_copy ( URLImpl s_url,
HdrHeap s_heap,
HdrHeap d_heap,
bool  inherit_strs = true 
)

Definition at line 253 of file URL.cc.

References url_copy_onto(), and url_create().

Referenced by TSUrlClone().

void url_copy_onto ( URLImpl s_url,
HdrHeap s_heap,
URLImpl d_url,
HdrHeap d_heap,
bool  inherit_strs = true 
)
void url_copy_onto_as_server_url ( URLImpl s_url,
HdrHeap s_heap,
URLImpl d_url,
HdrHeap d_heap,
bool  inherit_strs = true 
)
URLImpl* url_create ( HdrHeap heap  ) 
void url_describe ( HdrHeapObjImpl raw,
bool  recurse 
)
void url_fragment_set ( HdrHeap heap,
URLImpl url,
const char *  value,
int  length,
bool  copy_string 
)
void url_host_MD5_get ( URLImpl url,
CryptoHash md5 
)
void url_host_set ( HdrHeap heap,
URLImpl url,
const char *  value,
int  length,
bool  copy_string 
)
void url_init (  ) 
int url_length_get ( URLImpl url  ) 
void url_MD5_get ( URLImpl url,
CryptoHash md5 
)
void url_nuke_proxy_stuff ( URLImpl d_url  ) 
void url_params_set ( HdrHeap heap,
URLImpl url,
const char *  value,
int  length,
bool  copy_string 
)
MIMEParseResult url_parse ( HdrHeap heap,
URLImpl url,
const char **  start,
const char *  end,
bool  copy_strings 
)

Definition at line 1152 of file URL.cc.

References PARSE_CONT, url_parse_http(), and url_parse_scheme().

Referenced by http_parser_parse_req(), URL::parse(), and HTTPHdr::url_set().

MIMEParseResult url_parse_http ( HdrHeap heap,
URLImpl url,
const char **  start,
const char *  end,
bool  copy_strings 
)
MIMEParseResult url_parse_http_no_path_component_breakdown ( HdrHeap heap,
URLImpl url,
const char **  start,
const char *  end,
bool  copy_strings 
)

Definition at line 1407 of file URL.cc.

References url_host_set(), url_path_set(), and url_port_set().

Referenced by url_parse_no_path_component_breakdown().

MIMEParseResult url_parse_internet ( HdrHeap heap,
URLImpl url,
char const **  start,
char const *  end,
bool  copy_strings_p 
)

Parse internet URL.

  [://][user[:password]@]host[:port]

  some.place/
  some.place:80/
  foo@some.place:80/
  foo:bar@some.place:80/
  foo:bar@some.place/
  foo:42@some.place/
  

Definition at line 1182 of file URL.cc.

References ts::ConstBuffer::_ptr, ts::ConstBuffer::_size, ink_assert, ts::ConstBuffer::set(), url_host_set(), url_password_set(), url_port_set(), and url_user_set().

Referenced by url_parse_http().

MIMEParseResult url_parse_no_path_component_breakdown ( HdrHeap heap,
URLImpl url,
const char **  start,
const char *  end,
bool  copy_strings 
)
void url_password_set ( HdrHeap heap,
URLImpl url,
const char *  value,
int  length,
bool  copy_string 
)
void url_path_set ( HdrHeap heap,
URLImpl url,
const char *  value,
int  length,
bool  copy_string 
)
void url_port_set ( HdrHeap heap,
URLImpl url,
unsigned int  port 
)
int url_print ( URLImpl u,
char *  buf,
int  bufsize,
int *  bufindex,
int *  dumpoffset 
)
void url_query_set ( HdrHeap heap,
URLImpl url,
const char *  value,
int  length,
bool  copy_string 
)
const char* url_scheme_get ( URLImpl url,
int *  length 
)
const char* url_scheme_set ( HdrHeap heap,
URLImpl url,
const char *  value,
int  value_wks_idx,
int  length,
bool  copy_string 
)
char* url_string_get ( URLImpl url,
Arena arena,
int *  length,
HdrHeap heap 
)
char* url_string_get_buf ( URLImpl url,
char *  dstbuf,
int  dstbuf_size,
int *  length 
)

Definition at line 668 of file URL.cc.

References url_length_get(), and url_print().

Referenced by URL::string_get_buf().

char* url_string_get_ref ( HdrHeap heap,
URLImpl url,
int *  length 
)
void url_type_set ( URLImpl url,
unsigned int  type 
)

Definition at line 568 of file URL.cc.

References URLImpl::m_type_code, and url_called_set().

Referenced by URL::type_set().

char* url_unescapify ( Arena arena,
const char *  str,
int  length 
)

Definition at line 1072 of file URL.cc.

References Arena::str_alloc(), and unescape_str().

Referenced by URL::unescapify().

void url_user_set ( HdrHeap heap,
URLImpl url,
const char *  value,
int  length,
bool  copy_string 
)

Variable Documentation

Definition at line 74 of file URL.cc.

Referenced by api_init(), and url_init().

Definition at line 75 of file URL.cc.

Referenced by api_init(), and url_init().

Definition at line 76 of file URL.cc.

Referenced by api_init(), and url_init().

Definition at line 78 of file URL.cc.

Referenced by api_init(), HttpTransact::ModifyRequest(), and url_init().

Definition at line 81 of file URL.cc.

Referenced by api_init(), and url_init().

Definition at line 91 of file URL.cc.

Referenced by url_init().

Definition at line 93 of file URL.cc.

Referenced by url_init().

Definition at line 92 of file URL.cc.

Referenced by url_init().

Definition at line 82 of file URL.cc.

Referenced by api_init(), and url_init().

Definition at line 83 of file URL.cc.

Referenced by api_init(), and url_init().

Definition at line 88 of file URL.cc.

Referenced by url_init().

Definition at line 84 of file URL.cc.

Referenced by api_init(), and url_init().

Definition at line 89 of file URL.cc.

Referenced by url_init().

Definition at line 90 of file URL.cc.

Referenced by url_init().

Definition at line 85 of file URL.cc.

Referenced by api_init(), and url_init().

Definition at line 86 of file URL.cc.

Referenced by HttpTransact::HandleBlindTunnel(), and url_init().

Definition at line 87 of file URL.cc.

Referenced by api_init(), and url_init().

Definition at line 79 of file URL.cc.

Referenced by HttpTransact::handle_websocket_upgrade_pre_remap(), and url_init().

Definition at line 80 of file URL.cc.

Referenced by HttpTransact::handle_websocket_upgrade_pre_remap(), and url_init().

const char* URL_SCHEME_FILE

Definition at line 32 of file URL.cc.

Referenced by api_init(), remap_parse_config_bti(), url_init(), url_length_get(), and url_to_string().

const char* URL_SCHEME_FTP

Definition at line 33 of file URL.cc.

Referenced by api_init(), and url_init().

const char* URL_SCHEME_GOPHER

Definition at line 34 of file URL.cc.

Referenced by api_init(), and url_init().

const char* URL_SCHEME_HTTP
const char* URL_SCHEME_HTTPS
const char* URL_SCHEME_MAILTO

Definition at line 39 of file URL.cc.

Referenced by api_init(), and url_init().

const char* URL_SCHEME_MMS

Definition at line 49 of file URL.cc.

Referenced by url_init().

const char* URL_SCHEME_MMST

Definition at line 51 of file URL.cc.

Referenced by url_init().

const char* URL_SCHEME_MMSU

Definition at line 50 of file URL.cc.

Referenced by url_init().

const char* URL_SCHEME_NEWS

Definition at line 40 of file URL.cc.

Referenced by api_init(), and url_init().

const char* URL_SCHEME_NNTP

Definition at line 41 of file URL.cc.

Referenced by api_init(), and url_init().

const char* URL_SCHEME_PNM

Definition at line 46 of file URL.cc.

Referenced by url_init().

const char* URL_SCHEME_PROSPERO

Definition at line 42 of file URL.cc.

Referenced by api_init(), and url_init().

const char* URL_SCHEME_RTSP

Definition at line 47 of file URL.cc.

Referenced by url_init().

const char* URL_SCHEME_RTSPU

Definition at line 48 of file URL.cc.

Referenced by url_init().

const char* URL_SCHEME_TELNET

Definition at line 43 of file URL.cc.

Referenced by api_init(), and url_init().

const char* URL_SCHEME_TUNNEL

Definition at line 44 of file URL.cc.

Referenced by HttpTransact::HandleBlindTunnel(), remap_parse_config_bti(), and url_init().

const char* URL_SCHEME_WAIS

Definition at line 45 of file URL.cc.

Referenced by api_init(), and url_init().

const char* URL_SCHEME_WS
const char* URL_SCHEME_WSS

Definition at line 53 of file URL.cc.

Referenced by url_init().

Definition at line 54 of file URL.cc.

Referenced by url_init().

Definition at line 55 of file URL.cc.

Referenced by url_init().

Definition at line 60 of file URL.cc.

Referenced by url_init().

Definition at line 70 of file URL.cc.

Referenced by url_init().

Definition at line 72 of file URL.cc.

Referenced by url_init().

Definition at line 71 of file URL.cc.

Referenced by url_init().

Definition at line 61 of file URL.cc.

Referenced by url_init().

Definition at line 62 of file URL.cc.

Referenced by url_init().

Definition at line 67 of file URL.cc.

Referenced by url_init().

Definition at line 63 of file URL.cc.

Referenced by url_init().

Definition at line 68 of file URL.cc.

Referenced by url_init().

Definition at line 69 of file URL.cc.

Referenced by url_init().

Definition at line 64 of file URL.cc.

Referenced by url_init().

Definition at line 65 of file URL.cc.

Referenced by url_init().

Definition at line 66 of file URL.cc.

Referenced by url_init().