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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.