/*
- * ip_vs_proto_ah.c:   AH IPSec load balancing support for IPVS
+ * ip_vs_proto_ah_esp.c:       AH/ESP IPSec load balancing support for IPVS
  *
  * Authors:    Julian Anastasov <ja@ssi.bg>, February 2002
  *             Wensong Zhang <wensong@linuxvirtualserver.org>
 
 
 static struct ip_vs_conn *
-ah_conn_in_get(const struct sk_buff *skb,
-              struct ip_vs_protocol *pp,
-              const struct iphdr *iph,
-              unsigned int proto_off,
-              int inverse)
+ah_esp_conn_in_get(const struct sk_buff *skb,
+                  struct ip_vs_protocol *pp,
+                  const struct iphdr *iph,
+                  unsigned int proto_off,
+                  int inverse)
 {
        struct ip_vs_conn *cp;
 
 
 
 static struct ip_vs_conn *
-ah_conn_out_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
-               const struct iphdr *iph, unsigned int proto_off, int inverse)
+ah_esp_conn_out_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
+                   const struct iphdr *iph, unsigned int proto_off, int inverse)
 {
        struct ip_vs_conn *cp;
 
 
 
 static int
-ah_conn_schedule(struct sk_buff *skb,
-                struct ip_vs_protocol *pp,
-                int *verdict, struct ip_vs_conn **cpp)
+ah_esp_conn_schedule(struct sk_buff *skb,
+                    struct ip_vs_protocol *pp,
+                    int *verdict, struct ip_vs_conn **cpp)
 {
        /*
-        * AH is only related traffic. Pass the packet to IP stack.
+        * AH/ESP is only related traffic. Pass the packet to IP stack.
         */
        *verdict = NF_ACCEPT;
        return 0;
 
 
 static void
-ah_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb,
-               int offset, const char *msg)
+ah_esp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb,
+                   int offset, const char *msg)
 {
        char buf[256];
        struct iphdr _iph, *ih;
 }
 
 
-static void ah_init(struct ip_vs_protocol *pp)
+static void ah_esp_init(struct ip_vs_protocol *pp)
 {
        /* nothing to do now */
 }
 
 
-static void ah_exit(struct ip_vs_protocol *pp)
+static void ah_esp_exit(struct ip_vs_protocol *pp)
 {
        /* nothing to do now */
 }
 
 
+#ifdef CONFIG_IP_VS_PROTO_AH
 struct ip_vs_protocol ip_vs_protocol_ah = {
        .name =                 "AH",
        .protocol =             IPPROTO_AH,
        .num_states =           1,
        .dont_defrag =          1,
-       .init =                 ah_init,
-       .exit =                 ah_exit,
-       .conn_schedule =        ah_conn_schedule,
-       .conn_in_get =          ah_conn_in_get,
-       .conn_out_get =         ah_conn_out_get,
+       .init =                 ah_esp_init,
+       .exit =                 ah_esp_exit,
+       .conn_schedule =        ah_esp_conn_schedule,
+       .conn_in_get =          ah_esp_conn_in_get,
+       .conn_out_get =         ah_esp_conn_out_get,
        .snat_handler =         NULL,
        .dnat_handler =         NULL,
        .csum_check =           NULL,
        .register_app =         NULL,
        .unregister_app =       NULL,
        .app_conn_bind =        NULL,
-       .debug_packet =         ah_debug_packet,
+       .debug_packet =         ah_esp_debug_packet,
        .timeout_change =       NULL,           /* ISAKMP */
        .set_state_timeout =    NULL,
 };
+#endif
+
+#ifdef CONFIG_IP_VS_PROTO_ESP
+struct ip_vs_protocol ip_vs_protocol_esp = {
+       .name =                 "ESP",
+       .protocol =             IPPROTO_ESP,
+       .num_states =           1,
+       .dont_defrag =          1,
+       .init =                 ah_esp_init,
+       .exit =                 ah_esp_exit,
+       .conn_schedule =        ah_esp_conn_schedule,
+       .conn_in_get =          ah_esp_conn_in_get,
+       .conn_out_get =         ah_esp_conn_out_get,
+       .snat_handler =         NULL,
+       .dnat_handler =         NULL,
+       .csum_check =           NULL,
+       .state_transition =     NULL,
+       .register_app =         NULL,
+       .unregister_app =       NULL,
+       .app_conn_bind =        NULL,
+       .debug_packet =         ah_esp_debug_packet,
+       .timeout_change =       NULL,           /* ISAKMP */
+};
+#endif