Home Page Icon
Home Page
Table of Contents for
Part II: Language Reference
Close
Part II: Language Reference
by Dwight Mulcahy, Ralph Duncan, Peder Jungck
packetC Programming
Title
Contents at a Glance
Contents
About the Authors
Acknowledgments
Introduction
Scope
Organization
Part I: packetC Background
Chapter 1: Origins of packetC
Tenets of packetC
Chapter 2: Introduction to the packetC Language
packetC Language Design Considerations
packetC Language Similarities
Virtual Machine—packetC Behavior
Digging a Little Deeper into packetC vs. C
Case Sensitivity and Identifiers
Object Orientation and Control Flow
Memory Layout
Summary
Chapter 3: Style Guidelines for packetC Program
Introduction to packetC Style Guidelines
Naming Conventions for Variables, Types, and Functions
Source Code Presentation, Indentation, and Form
General Commentary on Comments
File Naming and Construction Conventions
Broader Coding Style Guideline Tips and Techniques
Chapter 4: Construction of a packetC Program
packetC and Parallelism
packetC Modules: Three Kinds of Compilation Units
Three Kinds of Scope
Module Structure and Scopes
Graphical Representation of Scope Linkage
Run time Environment Data and Predefined Types
Chapter 5: Variables: Identifiers, Basic Scalar Data Types, and Literals
Classic Data Types
Identifiers and a Few Fundamentals
Basic Scalar Types
Literals
Integral Type Literals
Network Literals
String Literals
Character Literals
Network Byte Order
Unsupported Types
Part II: Language Reference
Chapter 6: Data Initialization and Mathematical Expressions
Data Initialization, Expressions, and Operators
Variable and Constant Declarations
Variable and Constant Initialization
Classic C Expressions and Operators
Operators
Associativity
Multiplicative Operators
Additive Operators
Relational Operators
Equality Operators
Assignment Operators
Logical AND Operator
Logical OR Operator
Bitwise AND Operator
Bitwise Exclusive OR (XOR) Operator
Bitwise Inclusive OR Operator
Bitwise Shift Operator
Unsupported Operators
Chapter 7: Functions
Function Constructs
Parameter Passing Modes
Inlining
Function Parameter and Return Types
Function Return Statements
Chapter 8: packetC Data Type Fundamentals
Data Type Fundamentals
Type Compatibility, Conversions, and Casts
Type Promotions, Conversions, and Implicit Casting
Chapter 9: C-Style Data Types
Enumeration Types
Arrays
Structures and Unions
A Discussion on Container-Based Bit fields
Chapter 10: Basic Packet Interaction and Operations
Interaction with the Packet through Unique-to-packetC Capabilities
Packet Operators
Chapter 11: Selection Statements
Covering packetC Basic Control Statements
Compound Statement
Conditional Expressions
Chapter 12: Loops and Flow Control
Control Statements
Chapter 13: Exception Handling
Exception Handling in packetC
Try-Catch-Throw Statements (Error Handling)
System-Defined Response
Errors Section from cloudshield.ph
Simple Program Flow with Try-Catch-Throw Implemented
Chapter 14: packetC Database Types and Operations
Database Declarations
Databases and Masking
Database Limitations and Padding
Database Records and Elements
Masks
Database Subscripting Operator
Database Delete
Database Insert
Database Match
Operator Invocations
Example Database Application
Example Database Application (ACL)
Chapter 15: packetC Search Set Types and Operations
Searchsets in packetC for Unstructured Content Analysis
Searchsets
Searchset Declarations
Constant Searchsets and Sizes
Null Termination Issues
Match Operator
Find Operator
Regex Specifier
Interaction of packetC Pre-Processor with Regular Expressions
General Search Set Usage, Operation, and Mechanics
Searchset Example Application
Chapter 16: Reference Type and Operation
References in packetC
References
Reference Operators
Chapter 17: Semaphores in packetC
Locking and Unlocking
Lock and Unlock Operators
Using Lock and Unlock to Perform a Global Malloc() and Free()
Chapter 18: Packet Information Block and System Packet Operations
Shared Definitions
Packet ($PACKET pkt)
Packet Information Block ($PIB pib)
System Information ($SYS sys)
TCP/IP Stack Decode for pib Layer Offset Calculations
Example cloudshield.ph Include File
Chapter 19: Descriptor Type and Operations
packetC Descriptor Types
Descriptors
Impacts on Performance
Part III: Developing Applications
Chapter 20: Control Plane and System Interaction
Control Plane Interaction
Alerts and Information Logging
Messages to Control Plane ($MSG_TYPE)
Messages Portion of cloudshield.ph
Chapter 21: packetC Pre-Processor
#define
#include
#ifdef
#ifndef
#endif
#if
#else
#elif
#undef
#error
#line
#file
defined
Comments in Code
Typical packetC Comment Header
Chapter 22: Pragmas and Other Key Compiler Directives
Pragmas
Implementation-Defined Pragmas
Interaction of packetC Pre-Processor with Regular Expressions
Chapter 23: Developing Large Applications in packetC
Planning for Large Projects in packetC
Things to Consider in Large Application Development
Chapter 24: Construction of a packetC Executable
A View into the CloudShield PacketWorks IDE Tools
Chapter 25: packetC Standard Networking Descriptors
Standard Include File protocols.ph Example
Chapter 26: Developing for Performance
Developing for Performance in packetC
Counting Bits Set
Simplest Computation Scenario
Improving the Computational Algorithm
Altering the Algorithm with Memory Use in Exchange of Processing
Metadata Analysis
Netflow Record Generation
DDoS Trend Analysis
VoIP QoS Analysis
Processing Minimization
Whatever You Do … Don’t Involve Other Contexts
Chapter 27: Standard Libraries
Assessment of C Standard Library Functions
packetC Standard Libraries
ascii.ph - Named Values for ASCII Characters
limits.ph - A packetC Replacement For C limits.h Functionality
moreprotocols.ph - Named Values For Network Protocol Field Values
namedoperators.ph - Replacement for iso646.h Named Operators
trojanprotocols.ph - Named Values for Port Numbers Trojan Network Protocol Operate On
Part IV: Industry Reprints
REPRINT 1: packetC Language for High Performance Packet Processing
REPRINT 2: A Paradigm for Processing Network Protocols in Parallel
REPRINT 3: Dynamically Accessing Packet Header Fields at High-speed
REPRINT 4: packetC Language and Parallel Processing of Masked Databases
REPRINT 5: Packet Content Matching with packetC Searchsets
REPRINT 6: References for Run-time Aggregate Selection with Strong Typing
REPRINT 7: Portable Bit Fields in packetC
REPRINT 8: packet Field and Bitfield Allocation Order
REPRINT 9: Managing Heterogeneous Architectures for High-speed Packet Processing
APPENDIX A: Reference Tables
Keywords
ASCII Table with Decimal to Hexadecimal Conversion
Bits and Bytes
TCP/IP and OSI Model Network Stack
Header Formats
Basic Ethernet II Header Format
Ethernet Header with VLAN Tag (802.1Q) Format
Ethernet Header with Stacked VLAN Tags (802.1Q in Q) Format
IPv4 Header
IPv6 Header
TCP Header
UDP Header
ICMP Header
APPENDIX B: Open Systems Vendors for packetC
Software
Hardware
Reference
APPENDIX C: Glossary
PacketC Language Terms
Networking Terms
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Chapter 5: Variables: Identifiers, Basic Scalar Data Types, and Literals
Next
Next Chapter
Chapter 6: Data Initialization and Mathematical Expressions
PART II
Language Reference
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset