Advertisement

C-Style Data Types

  • Peder Jungck
  • Ralph Duncan
  • Dwight Mulcahy

Abstract

Working with data types in packetC introduces some interesting dynamics that will initially require care and extra thought by C developers from time to time given some of the restrictions, mostly due to strong type enforcement. The notion of casting and the strong casting rules is imperative to ensuring code works as expected. Packets are modeled as arrays of bytes and working with portions of packets is essential to making sense of the data. In packetC, the notion of an array slice was introduced to allow for direct access to portions of byte arrays without the need for pointers and for keeping them in line with strong type enforcement. This also applies to complex structures and unions that can be copied or, better yet, cast back and forth to byte arrays, providing multiple ways to view data elements, depending on what is most convenient for the programmer.

Keywords

Union Member Allocation Order Integer Type Unsigned Integer Type Declaration 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© CloudShield Technologies, Inc. An SAIC Company 2011

Authors and Affiliations

  • Peder Jungck
  • Ralph Duncan
  • Dwight Mulcahy

There are no affiliations available

Personalised recommendations