1.发网络包的代码技巧。

   

union
{
    UINT16  set;
    struct
    {
        UINT16  rsvd:9;
        UINT16  remote_stable:1;
        UINT16  remote_evaluating:1;
        UINT16  local_stable:1;
        UINT16  local_evaluating:1;
        UINT16  critical_event:1;
        UINT16  dying_gasp:1;
        UINT16  link_fault:1;      
    }unit;
}flag;

这样,想统一改变值改变set即可。想分开改变unit.xxx即可。