Changeset 2304e9b
- Timestamp:
- Mar 29, 2019 12:54:44 PM (2 years ago)
- Branches:
- master
- Children:
- fc9ad32
- Parents:
- 956a714
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/i2ptunnel/java/src/net/i2p/i2ptunnel/access/DefinitionParser.java
r956a714 r2304e9b 16 16 17 17 /** 18 * <p> 18 19 * Processes an array of String objects containing the human-readable definition of 19 20 * the filter. 20 * 21 * </p> 22 * <p> 21 23 * The definition of a filter is a list of Strings. Each line can represent one of 22 24 * these items: 23 * 24 * * definition of a default threshold to apply to any remote destinations not 25 * listed in this file or any of the referenced files 26 * * definition of a threshold to apply to a specific remote destination 27 * * definition of a threshold to apply to remote destinations listed in a file 28 * * definition of a threshold that if breached will cause the offending remote 29 * destination to be recorded in a specified file 30 * 25 * </p> 26 * <ul> 27 * <li>definition of a default threshold to apply to any remote destinations not 28 * listed in this file or any of the referenced files</li> 29 * <li>definition of a threshold to apply to a specific remote destination</li> 30 * <li>definition of a threshold to apply to remote destinations listed in a file</li> 31 * <li>definition of a threshold that if breached will cause the offending remote 32 * destination to be recorded in a specified file</li> 33 * </ul> 34 * <p> 31 35 * The order of the definitions matters. The first threshold for a given destination 32 36 * (whether explicit or listed in a file) overrides any future thresholds for the 33 37 * same destination, whether explicit or listed in a file. 34 * 38 * </p> 39 * <p> 35 40 * Thresholds: 36 * 41 * </p> 42 * <p> 37 43 * A threshold is defined by the number of connection attempts a remote destination is 38 44 * permitted to perform over a specified number of minutes before a "breach" occurs. … … 40 46 * destination is allowed to make 14 connection attempts over a 5 minute period, If 41 47 * it makes one more attempt within the same period, the threshold will be breached. 42 * 48 * </p> 49 * <p> 43 50 * The threshold format can be one of the following: 44 * 51 * </p> 45 52 * <ul> 46 53 * <li>Numeric definition of number of connections over number minutes - "15/5", … … 53 60 * </ul> 54 61 * 55 * Default threshold56 *57 62 * The default threshold applies to any remote destinations that are not explicitly 58 63 * listed in the definition or in any of the referenced files. To set a default … … 65 70 * </pre> 66 71 * 67 * Explicit thresholds68 *69 72 * Explicit thresholds are applied to a remote destination listed in the definition itself. 70 73 * Examples: … … 76 79 * </pre> 77 80 * 78 * Thresholds for destinations listed in a file79 *80 81 * For convenience it is possible to maintain a list of destinations in a file and define 81 82 * a threshold for all of them in bulk. Examples: … … 87 88 * </pre> 88 89 * 89 * Recorders90 *91 90 * Recorders keep track of connection attempts made by a remote destination, and if that 92 91 * breaches a certain threshold, that destination gets recorded in a given file. Examples: … … 96 95 * recorder 60/5 /path/very_aggressive.txt 97 96 * </pre> 98 * 97 * <p> 99 98 * It is possible to use a recorder to record aggressive destinations to a given file, 100 99 * and then use that same file to throttle them. For example, the following snippet will … … 102 101 * destination exceeds 30 attempts per 5 minutes it gets throttled down to 15 attempts per 103 102 * 5 minutes: 104 * 103 * </p> 105 104 * <pre> 106 105 * # by default there are no limits … … 111 110 * 15/5 file /path/throttled.txt 112 111 * </pre> 113 * 112 * <p> 114 113 * It is possible to use a recorder in one tunnel that writes to a file that throttles 115 114 * another tunnel. It is possible to reuse the same file with destinations in multiple 116 115 * tunnels. And of course, it is possible to edit these files by hand. 117 * 116 * </p> 117 * <p> 118 118 * Here is an example filter definition that applies some throttling by default, no throttling 119 119 * for destinations in the file "friends.txt", forbids any connections from destinations 120 120 * in the file "enemies.txt" and records any aggressive behavior in a file called 121 121 * "suspicious.txt": 122 * 122 * </p> 123 123 * <pre> 124 124 * default 15/5
Note: See TracChangeset
for help on using the changeset viewer.