• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

RemapConfig.h

Go to the documentation of this file.
00001 /** @file
00002  *
00003  *  Remap configuration file parsing.
00004  *
00005  *  @section license License
00006  *
00007  *  Licensed to the Apache Software Foundation (ASF) under one
00008  *  or more contributor license agreements.  See the NOTICE file
00009  *  distributed with this work for additional information
00010  *  regarding copyright ownership.  The ASF licenses this file
00011  *  to you under the Apache License, Version 2.0 (the
00012  *  "License"); you may not use this file except in compliance
00013  *  with the License.  You may obtain a copy of the License at
00014  *
00015  *      http://www.apache.org/licenses/LICENSE-2.0
00016  *
00017  *  Unless required by applicable law or agreed to in writing, software
00018  *  distributed under the License is distributed on an "AS IS" BASIS,
00019  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00020  *  See the License for the specific language governing permissions and
00021  *  limitations under the License.
00022  */
00023 
00024 #ifndef REMAPCONFIG_H_E862FB4C_EFFC_4F2A_8BF2_9AB6E1E5E9CF
00025 #define REMAPCONFIG_H_E862FB4C_EFFC_4F2A_8BF2_9AB6E1E5E9CF
00026 
00027 #include "AclFiltering.h"
00028 
00029 class UrlRewrite;
00030 
00031 #define BUILD_TABLE_MAX_ARGS 2048
00032 
00033 // Remap inline options
00034 #define REMAP_OPTFLG_MAP_WITH_REFERER 0x01      /* "map_with_referer" option */
00035 #define REMAP_OPTFLG_PLUGIN           0x02      /* "plugin=" option (per remap plugin) */
00036 #define REMAP_OPTFLG_PPARAM           0x04      /* "pparam=" option (per remap plugin option) */
00037 #define REMAP_OPTFLG_METHOD           0x08      /* "method=" option (used for ACL filtering) */
00038 #define REMAP_OPTFLG_SRC_IP           0x10      /* "src_ip=" option (used for ACL filtering) */
00039 #define REMAP_OPTFLG_ACTION           0x20      /* "action=" option (used for ACL filtering) */
00040 #define REMAP_OPTFLG_MAP_ID          0x800      /* associate a map ID with this rule */
00041 #define REMAP_OPTFLG_INVERT     0x80000000      /* "invert" the rule (for src_ip at least) */
00042 #define REMAP_OPTFLG_ALL_FILTERS (REMAP_OPTFLG_METHOD|REMAP_OPTFLG_SRC_IP|REMAP_OPTFLG_ACTION)
00043 
00044 struct BUILD_TABLE_INFO
00045 {
00046   BUILD_TABLE_INFO();
00047   ~BUILD_TABLE_INFO();
00048 
00049   unsigned long remap_optflg;
00050   int paramc;
00051   int argc;
00052   char *paramv[BUILD_TABLE_MAX_ARGS];
00053   char *argv[BUILD_TABLE_MAX_ARGS];
00054 
00055   acl_filter_rule *rules_list;  // all rules defined in config files as .define_filter foobar @src_ip=.....
00056   UrlRewrite *  rewrite;        // Pointer to the UrlRewrite object we are parsing for.
00057 
00058   // Clear the argument vector.
00059   void reset();
00060 
00061 private:
00062   BUILD_TABLE_INFO(const BUILD_TABLE_INFO&); // disabled
00063   BUILD_TABLE_INFO& operator=(const BUILD_TABLE_INFO&); // disabled
00064 
00065 };
00066 
00067 const char *
00068 remap_parse_directive(BUILD_TABLE_INFO * bti, char * errbuf, size_t errbufsize);
00069 
00070 const char *
00071 remap_validate_filter_args(acl_filter_rule ** rule_pp, const char ** argv, int argc, char * errStrBuf, size_t errStrBufSize);
00072 
00073 unsigned long
00074 remap_check_option(const char ** argv, int argc, unsigned long findmode = 0, int *_ret_idx = NULL, const char ** argptr = NULL);
00075 
00076 bool
00077 remap_parse_config(const char * path, UrlRewrite * rewrite);
00078 
00079 #endif /* REMAPCONFIG_H_E862FB4C_EFFC_4F2A_8BF2_9AB6E1E5E9CF */

Generated by  doxygen 1.7.1