6 var callFileRead
= rpc
.declare({
11 filter: function(value
) { return value
.trim() }
14 return network
.registerProtocol('dhcp', {
16 return _('DHCP client');
19 renderFormOptions: function(s
) {
20 var dev
= this.getL2Device() || this.getDevice(), o
;
22 o
= s
.taboption('general', form
.Value
, 'hostname', _('Hostname to send when requesting DHCP'));
24 o
.value('', _('Send the hostname of this device'));
25 o
.value('*', _('Do not send a hostname'));
26 o
.datatype
= 'or(hostname, "*")';
27 o
.load = function(section_id
) {
28 return callFileRead('/proc/sys/kernel/hostname').then(L
.bind(function(hostname
) {
29 this.placeholder
= hostname
;
30 return form
.Value
.prototype.load
.apply(this, [section_id
]);
34 o
= s
.taboption('advanced', form
.Flag
, 'broadcast', _('Use broadcast flag'), _('Required for certain ISPs, e.g. Charter with DOCSIS 3'));
35 o
.default = o
.disabled
;
37 o
= s
.taboption('advanced', form
.Value
, 'clientid', _('Client ID to send when requesting DHCP'));
38 o
.datatype
= 'hexstring';
40 s
.taboption('advanced', form
.Value
, 'vendorid', _('Vendor Class to send when requesting DHCP'));
42 o
= s
.taboption('advanced', form
.Value
, 'macaddr', _('Override MAC address'));
43 o
.datatype
= 'macaddr';
44 o
.placeholder
= dev
? (dev
.getMAC() || '') : '';
46 o
= s
.taboption('advanced', form
.Value
, 'mtu', _('Override MTU'));
47 o
.placeholder
= dev
? (dev
.getMTU() || '1500') : '1500';
48 o
.datatype
= 'max(9200)';