Skip to content

Commit

Permalink
feat: implement support carp unicast mode (plus only) #424
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhendrickson13 committed Dec 14, 2024
1 parent 7b5a9f7 commit eba6105
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class VirtualIP extends Model {
public IntegerField $advskew;
public StringField $password;
public StringField $carp_status;
public StringField $carp_mode;
public StringField $carp_peer;

public function __construct(mixed $id = null, mixed $parent_id = null, mixed $data = [], mixed ...$options) {
# Define model attributes
Expand Down Expand Up @@ -122,6 +124,20 @@ class VirtualIP extends Model {
help_text: 'The current CARP status of this virtual IP. This will display show whether this CARP node ' .
'is the primary or backup peer.',
);
$this->carp_mode = new StringField(
default: 'mcast',
choices: ['mcast', 'ucast'],
conditions: ['mode' => 'carp'],
help_text: 'The CARP mode to use for this virtual IP. Please note this field is exclusive to ' .
'pfSense Plus and has no effect on CE.',
);
$this->carp_peer = new StringField(
required: true,
conditions: ['carp_mode' => 'ucast'],
validators: [new IPAddressValidator(allow_ipv4: true, allow_ipv6: true)],
help_text: 'The IP address of the CARP peer. Please note this field is exclusive to pfSense Plus and ' .
'has no effect on CE.',
);

parent::__construct($id, $parent_id, $data, ...$options);
}
Expand Down

0 comments on commit eba6105

Please sign in to comment.