xorp

checksum.h

00001 /* -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*- */
00002 /* vim:set sts=4 ts=8: */
00003 
00004 /*
00005  * Copyright (c) 2001-2009 XORP, Inc.
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU Lesser General Public License, Version
00009  * 2.1, June 1999 as published by the Free Software Foundation.
00010  * Redistribution and/or modification of this program under the terms of
00011  * any other version of the GNU Lesser General Public License is not
00012  * permitted.
00013  * 
00014  * This program is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details,
00017  * see the GNU Lesser General Public License, Version 2.1, a copy of
00018  * which can be found in the XORP LICENSE.lgpl file.
00019  * 
00020  * XORP, Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
00021  * http://xorp.net
00022  */
00023 
00024 /*
00025  * $XORP: xorp/libproto/checksum.h,v 1.6 2008/10/02 21:57:17 bms Exp $
00026  */
00027 
00028 #ifndef __LIBPROTO_CHECKSUM_H__
00029 #define __LIBPROTO_CHECKSUM_H__
00030 
00031 /*
00032  * Header file for checksum computations.
00033  */
00034 
00035 # ifdef __cplusplus
00036 extern "C" {
00037 # endif
00038 
00039 
00047 extern uint16_t inet_checksum(const uint8_t *addr, size_t len);
00048 
00060 extern uint16_t inet_checksum_add(uint16_t sum1, uint16_t sum2);
00061 
00062 # ifdef __cplusplus
00063 }
00064 # endif
00065 
00066 #endif /* __LIBPROTO_CHECKSUM_H__ */
 All Classes Namespaces Functions Variables Typedefs Enumerations