1 /*
2  * Argus Software
3  * Copyright (c) 2000-2016 QoSient, LLC
4  * All rights reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10 
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15 
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  */
21 
22 /*
23  * $Id: //depot/argus/clients/include/rasplit.h#16 $
24  * $DateTime: 2016/06/01 15:17:28 $
25  * $Change: 3148 $
26  */
27 
28 #ifndef RaSplit_h
29 #define RaSplit_h
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include <unistd.h>
36 #include <stdlib.h>
37 
38 #include <signal.h>
39 #include <string.h>
40 
41 #include <netinet/in.h>
42 
43 #include <argus_util.h>
44 #include <argus_client.h>
45 #include <argus_namedb.h>
46 #include <argus_filter.h>
47 #include <argus_main.h>
48 #include <argus_metric.h>
49 
50 #include <ctype.h>
51 
52 #define ARGUSSECONDS		-1
53 #define ARGUSMINUTE		0
54 #define ARGUSHOURLY		1
55 #define ARGUSDAILY		2
56 #define ARGUSWEEKLY		3
57 #define ARGUSMONTHLY		4
58 #define ARGUSNNUALY		5
59 
60 #define ARGUSSPLITMODENUM	10
61 #define ARGUSSPLITTIME		0
62 #define ARGUSSPLITCOUNT		1
63 #define ARGUSSPLITSIZE		2
64 #define ARGUSSPLITFLOW		3
65 #define ARGUSSPLITPATTERN	4
66 
67 #define ARGUSSPLITNOMODIFY	5
68 #define ARGUSSPLITHARD		6
69 #define ARGUSSPLITSOFT		7
70 #define ARGUSSPLITZERO		8
71 #define ARGUSSPLITRATE		9
72 
73 #define ARGUSSPLITYEAR		1
74 #define ARGUSSPLITMONTH		2
75 #define ARGUSSPLITWEEK		3
76 #define ARGUSSPLITDAY		4
77 #define ARGUSSPLITHOUR		5
78 #define ARGUSSPLITMINUTE	6
79 #define ARGUSSPLITSECOND	7
80 
81 #if defined(ArgusClient)
82 
83 char *RaSplitModes[ARGUSSPLITMODENUM] = {
84   "time",
85   "count",
86   "size",
87   "flow",
88   "pattern",
89   "nomodify",
90   "hard",
91   "soft",
92   "zero",
93   "rate",
94 };
95 
96 #else
97 
98 extern char *RaSplitModes[ARGUSSPLITMODENUM];
99 
100 #endif
101 
102 char *RaSplitFilename (struct ArgusAdjustStruct *);
103 
104 extern void ArgusAlignConfig(struct ArgusParserStruct *, struct ArgusAdjustStruct *);
105 extern void ArgusAlignInit(struct ArgusParserStruct *, struct ArgusRecordStruct *, struct ArgusAdjustStruct *);
106 extern struct ArgusRecordStruct *ArgusAlignRecord(struct ArgusParserStruct *, struct ArgusRecordStruct *, struct ArgusAdjustStruct *);
107 
108 int RaProcessSplitOptions(struct ArgusParserStruct *, char *, int, struct ArgusRecordStruct*);
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 #endif
114