|
|
发表于 2005-8-25 09:12:32
|
显示全部楼层
Post by lollipop
楼上的说的有道理,这点没有想到...
实际的代码是怎么来做的?
按9楼的说法?
有这种可能,当然,也可能就用pack,像下面这样:
- 49 struct tftphdr {
- 50 short th_opcode; /* packet type */
- 51 union {
- 52 unsigned short tu_block; /* block # */
- 53 short tu_code; /* error code */
- 54 char tu_stuff[1]; /* request packet stuff */
- 55 } __attribute__ ((__packed__)) th_u;
- 56 char th_data[1]; /* data or error string */
- 57 } __attribute__ ((__packed__));
复制代码 |
|