20140226工作总结(网络包的技巧)

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即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章