This file is indexed.

/usr/include/libinfinity-0.7/libinfinity/common/inf-keepalive.h is in libinfinity-0.7-dev 0.7.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
/* libinfinity - a GObject-based infinote implementation
 * Copyright (C) 2007-2015 Armin Burgmeier <armin@arbur.net>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 */

#ifndef __INF_KEEPALIVE_H__
#define __INF_KEEPALIVE_H__

#include <libinfinity/common/inf-native-socket.h>

#include <glib-object.h>

G_BEGIN_DECLS

#define INF_TYPE_KEEPALIVE_MASK  (inf_keepalive_mask_get_type())
#define INF_TYPE_KEEPALIVE       (inf_keepalive_get_type())

/**
 * InfKeepaliveMask:
 * @INF_KEEPALIVE_ENABLED: Whether the keepalive mechanism is
 * explicitly enabled or disabled.
 * @INF_KEEPALIVE_TIME: Whether the keepalive time is
 * overriding the system default.
 * @INF_KEEPALIVE_INTERVAL: Whether the keepalive interval is
 * overriding the system default.
 * @INF_KEEPALIVE_ALL: All previous values combined.
 *
 * This bitmask specifies which of the fields in #InfKeepalive
 * override the system defaults. For fields that are not enabled in the
 * bitmask, the system default value is taken, and the corresponding field in
 * #InfKeepalive is ignored.
 */
typedef enum _InfKeepaliveMask {
  INF_KEEPALIVE_ENABLED = 1 << 0,
  INF_KEEPALIVE_TIME = 1 << 1,
  INF_KEEPALIVE_INTERVAL = 1 << 2,

  INF_KEEPALIVE_ALL = (1 << 3) - 1
} InfKeepaliveMask;

/**
 * InfKeepalive:
 * @mask: Which of the following settings are enabled. If a setting is
 * disabled, then the system default is taken.
 * @enabled: Whether sending keep-alive probes is enabled or not.
 * @time: Time in seconds after which to send keep-alive probes.
 * @interval: Time in seconds between keep-alive probes.
 *
 * This structure contains the settings to configure keep-alive on TCP
 * connections.
 */
typedef struct _InfKeepalive InfKeepalive;
struct _InfKeepalive {
  InfKeepaliveMask mask;
  gboolean enabled;
  guint time;
  guint interval;
};

/* TODO: Implement the stuff; make sure it works on linux, windows and mac: */
/* http://www.starquest.com/Supportdocs/techStarLicense/SL002_TCPKeepAlive.shtml */
/* MSDN... */
/* SOL_TCP, TCP_KEEPCNT (tcp_keepalive_probes), TCP_KEEPIDLE (tcp_keepalive_time), TCP_KEEPINTVL (tcp_keepalive_intvl) */
/* SOL_SOCKET, SO_KEEPALIVE */

GType
inf_keepalive_mask_get_type(void) G_GNUC_CONST;

GType
inf_keepalive_get_type(void) G_GNUC_CONST;

InfKeepalive*
inf_keepalive_copy(const InfKeepalive* keepalive);

void
inf_keepalive_free(InfKeepalive* keepalive);

gboolean
inf_keepalive_apply(const InfKeepalive* keepalive,
                    InfNativeSocket* socket,
                    InfKeepaliveMask current_mask,
                    GError** error);

void
inf_keepalive_load_default(InfKeepalive* keepalive,
                           InfKeepaliveMask mask);

G_END_DECLS

#endif /* __INF_KEEPALIVE_H__ */

/* vim:set et sw=2 ts=2: */