Print this page
Add "log": to fwadm JSON for cfwlog tag.

Split Close
Expand all
Collapse all
          --- old/src/fw/node_modules/fwrule/rule.js
          +++ new/src/fw/node_modules/fwrule/rule.js
↓ open down ↓ 43 lines elided ↑ open up ↑
  44   44  var DIRECTIONS = ['to', 'from'];
  45   45  // Exported fields that can be in the serialized rule:
  46   46  var FIELDS = [
  47   47      'created_by',
  48   48      'description',
  49   49      'enabled',
  50   50      'global',
  51   51      'owner_uuid',
  52   52      'rule',
  53   53      'uuid',
  54      -    'version'
       54 +    'version',
       55 +    'log'
  55   56  ];
  56   57  // Maximum number of targets per side:
  57   58  var MAX_TARGETS_PER_SIDE = 24;
  58   59  // Maximum number of protocol targets:
  59   60  var MAX_PROTOCOL_TARGETS = 24;
  60   61  // Minimum version for using a larger list of protocol targets:
  61   62  var MINVER_LGPROTOTARG = 4;
  62   63  // The old maximum number of protocol targets:
  63   64  var OLD_MAX_PORTS = 8;
  64   65  var STRING_PROPS = ['created_by', 'description'];
↓ open down ↓ 307 lines elided ↑ open up ↑
 372  373          if (!validators.bool(data.enabled)) {
 373  374              errs.push(new validators.InvalidParamError('enabled',
 374  375                  'enabled must be true or false'));
 375  376          }
 376  377  
 377  378          this.enabled = data.enabled;
 378  379      } else {
 379  380          this.enabled = false;
 380  381      }
 381  382  
      383 +    if (hasOwnProperty(data, 'log')) {
      384 +        if (!validators.bool(data.log)) {
      385 +            errs.push(new validators.InvalidParamError('log',
      386 +                'log must be true or false'));
      387 +        }
      388 +
      389 +        this.log = data.log;
      390 +    } else {
      391 +        this.log = false;
      392 +    }
      393 +
 382  394      for (var s in STRING_PROPS) {
 383  395          var str = STRING_PROPS[s];
 384  396          if (hasOwnProperty(data, str)) {
 385  397              try {
 386  398                  validators.validateString(str, data[str]);
 387  399                  this[str] = data[str];
 388  400              } catch (valErr) {
 389  401                  errs.push(valErr);
 390  402              }
 391  403          }
↓ open down ↓ 197 lines elided ↑ open up ↑
 589  601   */
 590  602  FwRule.prototype.raw = function () {
 591  603      var raw = {
 592  604          action: this.action,
 593  605          enabled: this.enabled,
 594  606          from: this.from,
 595  607          priority: this.priority,
 596  608          protocol: this.protocol,
 597  609          to: this.to,
 598  610          uuid: this.uuid,
 599      -        version: this.version
      611 +        version: this.version,
      612 +        log: this.log
 600  613      };
 601  614  
 602  615      if (this.owner_uuid) {
 603  616          raw.owner_uuid = this.owner_uuid;
 604  617      }
 605  618  
 606  619      switch (this.protocol) {
 607  620      case 'icmp':
 608  621      case 'icmp6':
 609  622          raw.types = this.types;
↓ open down ↓ 189 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX