MySQL Server Syntax to create the table for Packet Logging

To create the table for Packet Logging with a minimal set of fields:

create table packets (
   ts timestamp,
   filterid smallint  NOT NULL,
   proto tinyint,
   src_ip char(16),
   src_port smallint unsigned,
   dst_ip char(16),
   dst_port smallint unsigned,
   sent int unsigned, recv int unsigned); 

To create the table for Packet Logging with additional fields:

create table packets (
   ts timestamp,
   filterid smallint NOT NULL,
   filtername char(30),
   proto tinyint,
   tos tinyint,
   src_ip char(16),
   src_mac char(16),
   src_port smallint unsigned,
   dst_ip char(16),
   dst_mac char(16),
   dst_port smallint unsigned,
   sent int unsigned, recv int unsigned); 

 Note
 
MySQL Server must automatically insert the current date and time in the table with new record. Therefore, you should use the field with "timestamp" type.

 

The CHM file was converted to HTML by chm2web software.