public override ByteBuffer Encode() { ByteBuffer buf = base.EncodeCodeAndLength(); if (domainNameList != null) { foreach (string domain in domainNameList) { BaseDomainNameOption.EncodeDomainName(buf, domain); } } return((ByteBuffer)buf.flip()); }
/* (non-Javadoc) * @see com.jagornet.dhcpv6.option.DhcpOption#getLength() */ public override int GetLength() { int len = 0; if (domainNameList != null) { foreach (string domain in domainNameList) { len += BaseDomainNameOption.GetDomainNameLength(domain); } } return(len); }
public override void Decode(ByteBuffer buf) { int len = base.DecodeLength(buf); if ((len > 0) && (len <= buf.remaining())) { long eof = buf.position() + len; while (buf.position() < eof) { string domain = BaseDomainNameOption.DecodeDomainName(buf, eof); AddDomainName(domain); } } }