linux/net/netfilter/xt_time.c

/*
 *	xt_time
 *	Copyright © CC Computer Consultants GmbH, 2007
 *
 *	based on ipt_time by Fabrice MARIE <[email protected]>
 *	This is a module which is used for time matching
 *	It is using some modified code from dietlibc (localtime() function)
 *	that you can find at https://www.fefe.de/dietlibc/
 *	This file is distributed under the terms of the GNU General Public
 *	License (GPL). Copies of the GPL can be obtained from gnu.org/gpl.
 */

#define pr_fmt(fmt)

#include <linux/ktime.h>
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/types.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/xt_time.h>

struct xtm {};

extern struct timezone sys_tz; /* ouch */

static const u_int16_t days_since_year[] =;

static const u_int16_t days_since_leapyear[] =;

/*
 * Since time progresses forward, it is best to organize this array in reverse,
 * to minimize lookup time.
 */
enum {};
static const u_int16_t days_since_epoch[] =;

static inline bool is_leap(unsigned int y)
{}

/*
 * Each network packet has a (nano)seconds-since-the-epoch (SSTE) timestamp.
 * Since we match against days and daytime, the SSTE value needs to be
 * computed back into human-readable dates.
 *
 * This is done in three separate functions so that the most expensive
 * calculations are done last, in case a "simple match" can be found earlier.
 */
static inline unsigned int localtime_1(struct xtm *r, time64_t time)
{}

static inline void localtime_2(struct xtm *r, time64_t time)
{}

static void localtime_3(struct xtm *r, time64_t time)
{}

static bool
time_mt(const struct sk_buff *skb, struct xt_action_param *par)
{}

static int time_mt_check(const struct xt_mtchk_param *par)
{}

static struct xt_match xt_time_mt_reg __read_mostly =;

static int __init time_mt_init(void)
{}

static void __exit time_mt_exit(void)
{}

module_init();
module_exit(time_mt_exit);
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS();
MODULE_ALIAS();