DHCP option 52, Option Overload

来源:互联网 发布:2017淘宝客程序哪个好 编辑:程序博客网 时间:2024/05/21 15:46

在RFC2132中对OPTION 52的定义如下:

9.3. Option Overload



   This option is used to indicate that the DHCP 'sname' or 'file'
   fields are being overloaded by using them to carry DHCP options. A
   DHCP server inserts this option if the returned parameters will
   exceed the usual space allotted for options.


   If this option is present, the client interprets the specified
   additional fields after it concludes interpretation of the standard
   option fields.


   The code for this option is 52, and its length is 1.  Legal values
   for this option are:


           Value   Meaning
           -----   --------
             1     the 'file' field is used to hold options
             2     the 'sname' field is used to hold options
             3     both fields are used to hold options


    Code   Len  Value
   +-----+-----+-----+
   |  52 |  1  |1/2/3|

   +-----+-----+-----+


看完这段英文描述,感觉云里雾里的,网上搜索相关的资料,也不是很多。

硬着头皮分析源代码,如果将overload理解为c++中的overload(重载),一下子就茅塞顿开了。

在大多数的DHCP报文中,sname和file两个固定的字段一共会占用178个字节,但是大多数情况下却为空,

option 52的意思是重载dhcp头中的sname和file两个字段,使其能得到真正的充分利用。

原创粉丝点击