- Timestamp:
- 11/03/08 12:36:46 (2 months ago)
- Files:
-
- 1 modified
-
trunk/client/services/src/EBox/Services.pm (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/services/src/EBox/Services.pm
r10728 r11553 16 16 # Class: EBox::Services 17 17 # 18 # This class is used to abstract services composed of19 # protocols and ports.20 # 21 # 18 # This class is used to abstract services composed of 19 # protocols and ports. 20 # 21 # 22 22 23 23 package EBox::Services; … … 111 111 # Method: serviceNames 112 112 # 113 # Fetch all the service identifiers and names113 # Fetch all the service identifiers and names 114 114 # 115 115 # Returns: 116 116 # 117 # Array ref of hash refs which contain:118 # 119 # 'id' - service identifier120 # 'name' service name121 # 122 # Example:117 # Array ref of hash refs which contain: 118 # 119 # 'id' - service identifier 120 # 'name' service name 121 # 122 # Example: 123 123 # [ 124 124 # { … … 146 146 # Method: serviceConfiguration 147 147 # 148 # For a given service identifier it returns its service configuration,149 # that is, the set of protocols and ports.148 # For a given service identifier it returns its service configuration, 149 # that is, the set of protocols and ports. 150 150 # 151 151 # Returns: 152 152 # 153 # Array ref of hash refs which contain:154 # 155 # protocol - it can take one of these: any, tcp, udp, tcp/udp, grep, icmp156 # source- it can take:157 # "any"158 # An integer from 1 to 65536 -> 22159 # Two integers separated by colons -> 22:25160 # destination - same as source161 # 162 # Example:163 # 164 # 'protocol' => 'tcp',165 # 'source' => 'any',153 # Array ref of hash refs which contain: 154 # 155 # protocol - it can take one of these: any, tcp, udp, tcp/udp, grep, icmp 156 # source - it can take: 157 # "any" 158 # An integer from 1 to 65536 -> 22 159 # Two integers separated by colons -> 22:25 160 # destination - same as source 161 # 162 # Example: 163 # 164 # 'protocol' => 'tcp', 165 # 'source' => 'any', 166 166 # 'destination' => '21:22', 167 167 sub serviceConfiguration … … 194 194 # Method: addService 195 195 # 196 # Add a service to the services table 196 # Add a service to the services table 197 197 # 198 198 # Parameters: … … 202 202 # name - service's name 203 203 # description - service's description 204 # protocol - it can take one of these: any, tcp, udp, tcp/udp, grep, icmp205 # sourcePort - it can take:204 # protocol - it can take one of these: any, tcp, udp, tcp/udp, grep, icmp 205 # sourcePort - it can take: 206 206 # "any" 207 207 # An integer from 1 to 65536 -> 22 208 208 # Two integers separated by colons -> 22:25 209 # destinationPort - same as source209 # destinationPort - same as source 210 210 # internal - boolean, internal services can't be modified from the UI 211 211 # readOnly - boolean, set the row unremovable from the UI 212 212 # translationDomain - eBox module domain for i18n 213 213 # 214 # Example:214 # Example: 215 215 # 216 216 # 'name' => 'ssh', 217 217 # 'description' => 'secure shell'. 218 # 'protocol' => 'tcp',219 # 'sourcePort' => 'any',218 # 'protocol' => 'tcp', 219 # 'sourcePort' => 'any', 220 220 # 'destinationPort' => '21:22', 221 221 # … … 232 232 # Method: addMultipleService 233 233 # 234 # Add a multi protocol service to the services table 234 # Add a multi protocol service to the services table 235 235 # 236 236 # Parameters: … … 245 245 # services - array ref of hash ref containing: 246 246 # 247 # protocol - it can take one of these: any, tcp, udp,248 # tcp/udp, grep, icmp249 # sourcePort - it can take: "any"247 # protocol - it can take one of these: any, tcp, udp, 248 # tcp/udp, grep, icmp 249 # sourcePort - it can take: "any" 250 250 # An integer from 1 to 65536 -> 22 251 251 # Two integers separated by colons -> 22:25 252 # destinationPort - same as source253 # 254 # 255 # Example:252 # destinationPort - same as source 253 # 254 # 255 # Example: 256 256 # 257 257 # 'name' => 'ssh', … … 259 259 # 'services' => [ 260 260 # { 261 # 'protocol' => 'tcp',262 # 'sourcePort' => 'any',261 # 'protocol' => 'tcp', 262 # 'sourcePort' => 'any', 263 263 # 'destinationPort' => '21:22' 264 264 # }, 265 265 # { 266 # 'protocol' => 'tcp',267 # 'sourcePort' => 'any',266 # 'protocol' => 'tcp', 267 # 'sourcePort' => 'any', 268 268 # 'destinationPort' => '21:22' 269 269 # } … … 282 282 # Method: setService 283 283 # 284 # Set a existing service to the services table 284 # Set a existing service to the services table 285 285 # 286 286 # Parameters: … … 290 290 # name - service's name 291 291 # description - service's description 292 # protocol - it can take one of these: any, tcp, udp, tcp/udp, grep, icmp293 # sourcePort - it can take:292 # protocol - it can take one of these: any, tcp, udp, tcp/udp, grep, icmp 293 # sourcePort - it can take: 294 294 # "any" 295 295 # An integer from 1 to 65536 -> 22 296 296 # Two integers separated by colons -> 22:25 297 # destinationPort - same as source297 # destinationPort - same as source 298 298 # internal - boolean, internal services can't be modified from the UI 299 299 # readOnly - boolean, set the row unremovable from the UI 300 300 # 301 # Example:301 # Example: 302 302 # 303 303 # 'name' => 'ssh', 304 304 # 'description' => 'secure shell'. 305 # 'protocol' => 'tcp',306 # 'sourcePort' => 'any',305 # 'protocol' => 'tcp', 306 # 'sourcePort' => 'any', 307 307 # 'destinationPort' => '21:22', 308 308 sub setService … … 315 315 # Method: setAdministrationPort 316 316 # 317 # Set administration port on service318 # 319 # Parameters: 320 # 321 # port - port322 # 317 # Set administration port on service 318 # 319 # Parameters: 320 # 321 # port - port 322 # 323 323 sub setAdministrationPort 324 324 { … … 327 327 checkPort($port, __("port")); 328 328 329 $self->setService('name' => __d('eBox administration'),329 $self->setService('name' => __d('eBox administration'), 330 330 'description' => __d('eBox Administration port'), 331 331 'domain' => __d('ebox-services'), … … 340 340 # Method: availablePort 341 341 # 342 # Check if a given port for a given protocol is available. That is,343 # no internal service uses it.342 # Check if a given port for a given protocol is available. That is, 343 # no internal service uses it. 344 344 # 345 345 # Parameters: … … 347 347 # (POSITIONAL) 348 348 # protocol - it can take one of these: tcp, udp 349 # port - An integer from 1 to 65536 -> 22349 # port - An integer from 1 to 65536 -> 22 350 350 # 351 351 # Returns: … … 361 361 # Method: removeService 362 362 # 363 # Remove a service from the services table 363 # Remove a service from the services table 364 364 # 365 365 # Parameters:
