File tree Expand file tree Collapse file tree 4 files changed +34
-9
lines changed Expand file tree Collapse file tree 4 files changed +34
-9
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Tempesta kernel library
3
+ *
4
+ * Copyright (C) 2019 Tempesta Technologies, Inc.
5
+ *
6
+ * This program is free software; you can redistribute it and/or modify it
7
+ * under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation; either version 2 of the License,
9
+ * or (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful, but WITHOUT
12
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
+ * FITNESS FOR A PARTICULAR PURPOSE.
14
+ * See the GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License along with
17
+ * this program; if not, write to the Free Software Foundation, Inc., 59
18
+ * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
+ */
20
+ #ifndef __LIB_COMMON_H__
21
+ #define __LIB_COMMON_H__
22
+
23
+ /* Get current timestamp in secs. */
24
+ static inline time_t
25
+ tfw_current_timestamp (void )
26
+ {
27
+ struct timespec ts ;
28
+ getnstimeofday (& ts );
29
+ return ts .tv_sec ;
30
+ }
31
+
32
+ #endif /* __LIB_COMMON_H__ */
Original file line number Diff line number Diff line change 37
37
#include "procfs.h"
38
38
#include "sync_socket.h"
39
39
#include "work_queue.h"
40
+ #include "lib/common.h"
40
41
41
42
#if MAX_NUMNODES > ((1 << 16 ) - 1 )
42
43
#warning "Please set CONFIG_NODES_SHIFT to less than 16"
Original file line number Diff line number Diff line change 39
39
#include "apm.h"
40
40
41
41
#include "sync_socket.h"
42
+ #include "lib/common.h"
42
43
43
44
#define TFW_WARN_ADDR_STATUS (msg , addr_ptr , print_port , status ) \
44
45
TFW_WITH_ADDR_FMT(addr_ptr, print_port, addr_str, \
Original file line number Diff line number Diff line change @@ -490,15 +490,6 @@ enum {
490
490
#define HTTP_CODE_MAX 599
491
491
#define HTTP_CODE_BIT_NUM (code ) ((code) - HTTP_CODE_MIN)
492
492
493
- /* Get current timestamp in secs. */
494
- static inline time_t
495
- tfw_current_timestamp (void )
496
- {
497
- struct timespec ts ;
498
- getnstimeofday (& ts );
499
- return ts .tv_sec ;
500
- }
501
-
502
493
static inline int
503
494
tfw_http_resp_code_range (const int n )
504
495
{
You can’t perform that action at this time.
0 commit comments