-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stdin driver with file opener refactors #1605
Commits on Aug 8, 2017
-
logproto: document the layering violation of log_proto_server_get_fd()
Earlier only a note was saying that get_fd() is a layering violation. The reason is that the presence of this function exposes that all LogProto instances are based on a UNIX fd. This is always true as of now, but still not nice. It would be a lot better to replace log_proto_server_get_fd() with APIs that abstract away fds. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 36213cf - Browse repository at this point
Copy the full SHA 36213cfView commit details -
logproto: increase LOG_PROTO_SERVER_OPTIONS_SIZE to 128
This constant contains the number of bytes allocated in LogProtoServerOptionsStorage, so that derived classes may add new fields in their own Options structure. Actually, "32" the original value is smaller than LogProtoServerOptions, e.g. no extra bytes were allocated. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 96cdbbb - Browse repository at this point
Copy the full SHA 96cdbbbView commit details -
logproto: publish log_proto_text_server_validate_options_method()
In order to make this available for derived classes. For now it's just an alias for the one in buffered server. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for cd4806d - Browse repository at this point
Copy the full SHA cd4806dView commit details -
logproto: add options validation in LogProtoRegexpMultiLineServer
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 15bdb95 - Browse repository at this point
Copy the full SHA 15bdb95View commit details -
logreader: make handling of LPS_EOF in fetch_log a bit easier to read
I find it is a bit easier to read this way. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for d3cfa2e - Browse repository at this point
Copy the full SHA d3cfa2eView commit details -
affile: fix "none" stats counter registration
log_reader_reopen() was once also doing log_reader_set_options(), which at that point may have meant changing the stats_source/stats_level values. Then, reopen and set_options were divorced, however the log_source_init()/deinit() calls remained, which are not really good at multiple fronts (at first it reinialized part of the LogReader, but not the whole). Anyway, because of this, a stats counter might be registered "none" as the first log_reader_reopen() is called before set_options, thus stats_source is not yet set. To fix this issue, get rid off the superfluous init/deinit calls, which are not needed. I also tried to decouple reopen/set_options from the ordering issues, but I miserably failed, and I didn't want to go there with 50+ patches already in my series. Would be great if we could remove this ordering dependency at one point in the future. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for b53bc72 - Browse repository at this point
Copy the full SHA b53bc72View commit details -
cfg: add a function call to request shutdown of a GlobalConfig instance
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 89daead - Browse repository at this point
Copy the full SHA 89daeadView commit details -
transport: move /proc/kmsg related LogTransport to affile
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for b2e25f5 - Browse repository at this point
Copy the full SHA b2e25f5View commit details -
affile: change license to transport-prockmsg to GPL
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 5bb25e4 - Browse repository at this point
Copy the full SHA 5bb25e4View commit details -
transport: publish read/write method implementations
Instead of keeping these static, make them available for derived classes. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 623e01c - Browse repository at this point
Copy the full SHA 623e01cView commit details -
affile: extract log_transport_devkmsg_new()
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for e12e080 - Browse repository at this point
Copy the full SHA e12e080View commit details -
Configuration menu - View commit details
-
Copy full SHA for e93f28b - Browse repository at this point
Copy the full SHA e93f28bView commit details -
affile: extract log_transport_source_named_pipe_new()
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for bb296ba - Browse repository at this point
Copy the full SHA bb296baView commit details -
affile: rename affile-common to file-opener
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 8c9461e - Browse repository at this point
Copy the full SHA 8c9461eView commit details -
affile: embed FilePermOptions into FileOpenOptions
As the next step creating the FileOpener interface, encapsulate FilePermOptions into FileOpenerOptions. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 85eb3de - Browse repository at this point
Copy the full SHA 85eb3deView commit details -
affile: FileReaderOptions init/deinit should encapsulate all embedded…
… Options FileReaderOptions incrporates a number of Options structure, yet it was missing the init/deinit/defaults interface, so all callers were explicitly poking into the struct, intializing members. This is very error prone and this patch introduces the file_reader_options_init/deinit functions, so that everything underneath is hidden. It removes code duplication between affile-source and wildcard-source and makes the code a lot easier to follow. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for fc8c5ec - Browse repository at this point
Copy the full SHA fc8c5ecView commit details -
affile: move FileReaderOptions instance to a constructor parameter
Instead of poking this value right into the FileReader instance, pass it as a parameter. Also, this patch renames the longish file_reader_options in FileReader to merely "options" making the code easier to read. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 78b09be - Browse repository at this point
Copy the full SHA 78b09beView commit details -
affile: added some whitespace to wildcard-source
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for ad83fc3 - Browse repository at this point
Copy the full SHA ad83fc3View commit details -
affile: rename FileOpenOptions to FileOpenerOptions to consistency
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for e19da44 - Browse repository at this point
Copy the full SHA e19da44View commit details -
affile: create FileOpener interface, decouple FileReader from FileOpener
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 006716e - Browse repository at this point
Copy the full SHA 006716eView commit details -
affile: remove an unneeded indirection from opening files in file-reader
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 36d382d - Browse repository at this point
Copy the full SHA 36d382dView commit details -
affile: pass stats_source as a member in FileReaderOptions
Instead of passing using the "is_pipe" value, expect the caller to specify the stats source explicitly. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 68a2f52 - Browse repository at this point
Copy the full SHA 68a2f52View commit details -
affile: keep opener instances persistent, so construction can happen …
…earlier This patch moves the creation of FileOpener instances into the respective constructors, so that higher level constructors can pass in different FileOpener instances. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 313c728 - Browse repository at this point
Copy the full SHA 313c728View commit details -
affile: migrate affile-dest to the FileOpener interface
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 8662fa5 - Browse repository at this point
Copy the full SHA 8662fa5View commit details -
affile: delegate transport construction to FileOpener
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 26ad287 - Browse repository at this point
Copy the full SHA 26ad287View commit details -
affile: add "self" to file-opener methods
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for df503cf - Browse repository at this point
Copy the full SHA df503cfView commit details -
affile: add "prepare_open" virtual method
This method can be used to prepare for an upcoming open call, for things such as the creation of a named pipe, etc. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for b9a9531 - Browse repository at this point
Copy the full SHA b9a9531View commit details -
affile: move mkfifo() call to named-pipe.c
With the new prepare-open call, we can remove a couple of pipe related conditionals, such as the creation of the named pipe. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 54bc22f - Browse repository at this point
Copy the full SHA 54bc22fView commit details -
affile: move pipe/file mismatch to named-pipe
This is another pipe related specialization that can be delegated to named-pipe.c Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for ede1469 - Browse repository at this point
Copy the full SHA ede1469View commit details -
affile: rename followed-files to regular-files
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 1da77c4 - Browse repository at this point
Copy the full SHA 1da77c4View commit details -
affile: move pipe/file mismatch check to regular-files
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for b7044af - Browse repository at this point
Copy the full SHA b7044afView commit details -
affile: remove _validate_file_type()
The content of this function has moved to various prepare_open() methods, thus became empty. Remove the dead code. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 93ef769 - Browse repository at this point
Copy the full SHA 93ef769View commit details -
affile: delegate src proto construction to FileOpener
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for f7f39f4 - Browse repository at this point
Copy the full SHA f7f39f4View commit details -
affile: use construct_src_proto to create kmsg related protocols
This makes the file reader a lot simpler as it does not need /proc/kmsg and /dev/kmsg specific code. This patch also gets rid off the separate logproto-linux-proc-kmsg-reader module. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for b2a8722 - Browse repository at this point
Copy the full SHA b2a8722View commit details -
affile: remove "is_pipe" dependency from affile-source
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 5e07e50 - Browse repository at this point
Copy the full SHA 5e07e50View commit details -
affile: add "init_instance" method to FileOpener
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for f3901d1 - Browse repository at this point
Copy the full SHA f3901d1View commit details -
affile: delegate construct_dst_proto to FileOpener & get rid off is_pipe
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 4dfbbc9 - Browse repository at this point
Copy the full SHA 4dfbbc9View commit details -
logwriter: move stats_level/source to LogWriterOptions
Instead of getting this via the log_writer_set_options() call, get them via LogWriterOptions. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for c4f276f - Browse repository at this point
Copy the full SHA c4f276fView commit details -
logreader: move stats_level/source to LogReaderOptions
Instead of getting this via the log_reader_set_options() call, get them via LogReaderOptions. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 75f6037 - Browse repository at this point
Copy the full SHA 75f6037View commit details -
logreader: clarify ordering requirements between log_reader_reopen/se…
…t_options Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for e0ebdac - Browse repository at this point
Copy the full SHA e0ebdacView commit details -
Configuration menu - View commit details
-
Copy full SHA for dd99d97 - Browse repository at this point
Copy the full SHA dd99d97View commit details -
affile: add direction argument to file_opener_open_fd()
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for fd4e409 - Browse repository at this point
Copy the full SHA fd4e409View commit details -
affile: delegate open_flags to the FileOpener implementation
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 5251d88 - Browse repository at this point
Copy the full SHA 5251d88View commit details -
affile: rename test_affile_open_file to test_file_opener
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for e91ca0c - Browse repository at this point
Copy the full SHA e91ca0cView commit details -
logproto: add LogProtoMultiLineServer
This new class consolidates multi-line options into a class, that makes it easy to embed multi-line support in any LogReader based sources. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for c8b0e1f - Browse repository at this point
Copy the full SHA c8b0e1fView commit details -
affile: add LogProtoFileReader
In a similar spirit to LogProtoFileWriter, we introduce a LogProtoFileWriter, which is basically a set of options and a constructor that creates the appropriate LogProtoServer instance based on these options. Somewhat unfortunately FileReader and LogProtoFileReader are pretty similar names, which could be fixed by changing the FileReader name to something like FileReaderPipe, or AFFileSourceReader (akin to AFFileDestWriter). Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 1ebb85c - Browse repository at this point
Copy the full SHA 1ebb85cView commit details -
affile: parse multi-line & padding options into LogProtoServerOptions
Instead of putting these into variables here and there, but them where they belong, the Options structure of our LogProtoServer instance. Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for ed9db00 - Browse repository at this point
Copy the full SHA ed9db00View commit details -
affile: make the open() method virtual
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for c94519d - Browse repository at this point
Copy the full SHA c94519dView commit details -
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for a9e6ef1 - Browse repository at this point
Copy the full SHA a9e6ef1View commit details -
affile: move afpipe_sd_new() to named-pipe
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 06c4e1b - Browse repository at this point
Copy the full SHA 06c4e1bView commit details -
affile: move afpipe_dd_new() to named-pipe
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 679ba57 - Browse repository at this point
Copy the full SHA 679ba57View commit details -
affile: improve _setup_logreader() whitespace
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for c74c53c - Browse repository at this point
Copy the full SHA c74c53cView commit details -
afprog: minor readability fixes
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 2f7b0b4 - Browse repository at this point
Copy the full SHA 2f7b0b4View commit details -
Signed-off-by: Balazs Scheidler <balazs.scheidler@balabit.com>
Configuration menu - View commit details
-
Copy full SHA for 0ef0aa2 - Browse repository at this point
Copy the full SHA 0ef0aa2View commit details