/* * carp.h * * 2004 Copyright (c) Evgeniy Polyakov * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef __CARP_H #define __CARP_H #include #include #include #include "carp_ioctl.h" #define IPPROTO_CARP 112 #define CARP_VERSION 2 #define CARP_TTL 255 #define CARP_SIG_LEN 20 /* * carp_priv->flags definitions. */ #define CARP_DATA_AVAIL (1<<0) struct carp_header { #if defined(__LITTLE_ENDIAN_BITFIELD) u8 carp_type:4, carp_version:4; #elif defined (__BIG_ENDIAN_BITFIELD) u8 carp_version:4, carp_type:4; #else #error "Please fix " #endif u8 carp_vhid; u8 carp_advskew; u8 carp_authlen; u8 carp_pad1; u8 carp_advbase; u16 carp_cksum; u32 carp_counter[2]; u8 carp_md[CARP_SIG_LEN]; }; struct carp_stat { u32 crc_errors; u32 ver_errors; u32 vhid_errors; u32 hmac_errors; u32 counter_errors; u32 mem_errors; u32 xmit_errors; u32 bytes_sent; }; struct carp_priv { struct net_device_stats stat; struct net_device *dev, *odev; char name[IFNAMSIZ]; int link, mlink; struct iphdr iph; u32 md_timeout, adv_timeout; struct timer_list md_timer, adv_timer; enum carp_state state; struct carp_header hdr; struct carp_stat cstat; u8 carp_key[CARP_KEY_LEN]; u8 carp_pad[CARP_HMAC_PAD_LEN]; struct crypto_tfm *tfm; u64 carp_adv_counter; spinlock_t lock; u32 flags; unsigned short oflags; }; #endif /* __CARP_H */