1 /* $Id: misc.c,v 1.1 2005/12/12 18:14:22 nobunaga Exp $ 
 
   3 Copyright (C) 2002 Marc Kirchner <kirchner@stud.fh-heilbronn.de>
 
   5 This library is free software; you can redistribute it and/or
 
   6 modify it under the terms of the GNU Lesser General Public
 
   7 License as published by the Free Software Foundation; either
 
   8 version 2.1 of the License, or (at your option) any later version.
 
  10 This library is distributed in the hope that it will be useful,
 
  11 but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
  13 Lesser General Public License for more details.
 
  15 You should have received a copy of the GNU Lesser General Public
 
  16 License along with this library; if not, write to the Free Software
 
  17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
  24 @name int pkt_add_systimestamp(struct packet *pkt)
 
  25 @desc Adds a system timestamp (struct timeval) at the position where pkt->pkt_ptr points to.
 
  26 @param pkt packet into which a timestamp with the current system time will be added. 
 
  30 pkt_add_systimestamp(struct packet *pkt)
 
  34         if (pkt->pkt_size < (pkt->pkt_pos + sizeof(struct timeval)))
 
  36         if (gettimeofday((struct timeval *)pkt->pkt_ptr, NULL) == 0)