R E P R I N T  7

image

Portable Bit Fields in packetCby Ralph Duncan, Peder Jungck and Dwight Mulcahy

Abstract

Network packets place some protocol data in bit fields that are smaller than typical processor operand sizes. C language structures can represent such protocols but the uncertain layout and endian-specific nature of C's bit fields cause problems. Research has ranged from alternative bit field constructs, through specialized bit registers to using analytic techniques to identify programs' implicit subword usage. This paper describes the packetC language's two-fold approach to handling protocols in a portable way. The language addresses bit ...

Get packetC Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.