If set before any target specification, it affects all targets, unless
 overridden by any per-target directive.
 
+.TP
+.B keepalive  <idle>:<probes>:<interval>
+The
+.B keepalive
+parameter sets the values of \fIidle\fP, \fIprobes\fP, and \fIinterval\fP
+used to check whether a socket is alive;
+.I idle
+is the number of seconds a connection needs to remain idle before TCP
+starts sending keepalive probes;
+.I probes
+is the maximum number of keepalive probes TCP should send before dropping
+the connection;
+.I interval
+is interval in seconds between individual keepalive probes.
+Only some systems support the customization of these values;
+the
+.B keepalive
+parameter is ignored otherwise, and system-wide settings are used.
+
 .TP
 .B map "{attribute|objectclass} [<local name>|*] {<foreign name>|*}"
 This maps object classes and attributes as in the LDAP backend.
 
        LDAP_BACK_CFG_SUBTREE_IN,
        LDAP_BACK_CFG_PSEUDOROOTDN,
        LDAP_BACK_CFG_PSEUDOROOTPW,
+       LDAP_BACK_CFG_KEEPALIVE,
 
        LDAP_BACK_CFG_LAST
 };
                        "SYNTAX OMsDirectoryString "
                        "SINGLE-VALUE X-ORDERED 'SIBLINGS' )", NULL, NULL },
 
+       { "keepalive", "keepalive", 2, 2, 0,
+               ARG_MAGIC|LDAP_BACK_CFG_KEEPALIVE,
+               meta_back_cf_gen, "( OLcfgDbAt:3.29 "
+                       "NAME 'olcDbKeepalive' "
+                       "DESC 'TCP keepalive' "
+                       "SYNTAX OMsDirectoryString "
+                       "SINGLE-VALUE )",
+               NULL, NULL },
+
        { NULL, NULL, 0, 0, 0, ARG_IGNORED,
                NULL, NULL, NULL, NULL }
 };
                        "$ olcDbSubtreeExclude "
                        "$ olcDbSubtreeInclude "
                        "$ olcDbTimeout "
+                       "$ olcDbKeepalive "
 
                        /* defaults may be inherited */
                        COMMON_ATTRS
                        rc = 1;
                        break;
 
+               case LDAP_BACK_CFG_KEEPALIVE: {
+                               struct berval bv;
+                               char buf[AC_LINE_MAX];
+                               bv.bv_len = AC_LINE_MAX;
+                               bv.bv_val = &buf[0];
+                               slap_keepalive_parse(&bv, &mt->mt_tls.sb_keepalive, 0, 0, 1);
+                               value_add_one( &c->rvalue_vals, &bv );
+                               break;
+                       }
+
                default:
                        rc = 1;
                }
                        }
                        break;
 
+               case LDAP_BACK_CFG_KEEPALIVE:
+                       mt->mt_tls.sb_keepalive.sk_idle = 0;
+                       mt->mt_tls.sb_keepalive.sk_probes = 0;
+                       mt->mt_tls.sb_keepalive.sk_interval = 0;
+                       break;
+
                default:
                        rc = 1;
                        break;
                break;
 #endif /* SLAPD_META_CLIENT_PR */
 
+       case LDAP_BACK_CFG_KEEPALIVE:
+               slap_keepalive_parse( ber_bvstrdup(c->argv[1]),
+                                &mt->mt_tls.sb_keepalive, 0, 0, 0);
+               break;
+
        /* anything else */
        default:
                return SLAP_CONF_UNKNOWN;