Commit Graph

  • 4064df3762 Finished hacking. I hope I'll have time for this library in the close future. I want to make it great. master Adam Rocska 2020-06-11 11:09:57 +0200
  • 7b487ccc60 In its current state this hackery fits our needs. Adam Rocska 2020-06-11 10:22:15 +0200
  • c9bee263df Massaaged out this netmasking thingy. I had to reverse engineer with running other libraries, but now it seems to work. I'll follow the route of reversing using the java, C#.net, and php libraries. PHP is the driver, because the whole maxmind "solution" smells php from a mile away... Adam Rocska 2020-06-10 22:44:18 +0200
  • 7ca52178dd Library starts to come into its place. I gotta go through the models & records once again, because de-phpification is pretty hard. Besides that it's all cool and usable so far. Adam Rocska 2020-06-10 12:37:38 +0200
  • c4a0ce5960 Added the IpAddress netmask exposure. CIDR string my ass. This is no php. Adam Rocska 2020-06-10 12:08:31 +0200
  • 7b85c3b56c Implemented bitwise operators for IpAddress. This will be handy if someone wants to go wild with Ip subnetting, masking, grouping, etc. Adam Rocska 2020-06-09 23:01:21 +0200
  • 2f43056d0a IpAddress now has netmask initializers. There's no point in implementing a awhole ip range, or network or any other type, as technically at the end of the day, the maxmind php scripters only return a network mask as a new information in their CIDR voodoo. Adam Rocska 2020-06-09 22:35:02 +0200
  • 6abcb9669a Made the IpAddress comparable, which is the front door to the type IpRange. Adam Rocska 2020-06-07 21:33:46 +0200
  • d646b47877 System tests ready for execution. Before coverage I'll take another round in the php rat hole to make sure all models are ok. Adam Rocska 2020-06-05 16:09:44 +0200
  • d662ad3d22 Until CLIon supports newer Swift, and Swift Package Manager versions, and SPM fixes https://bugs.swift.org/browse/SR-12912 I opt in to doing this hackery for test resources. Adam Rocska 2020-06-05 13:45:28 +0200
  • 2cd55ef5ab Reorganized Tests Adam Rocska 2020-06-04 17:31:24 +0200
  • 52b4c5cb7c Some hackery to get the models & records into some shape, in hope, that another pattern emerges. Adam Rocska 2020-06-04 17:28:07 +0200
  • f5b45e7e69 Reader coverage. Adam Rocska 2020-06-04 14:35:45 +0200
  • 62484d2cae Work in progress. A pretty neat pattern is emerging. Adam Rocska 2020-06-04 13:47:18 +0200
  • e1a5976007 Committing the complete mess. I managed to trial&error on converting the php fantasy dictionaries into structs. Though some of the field types are mere blind guesses, so fingers crossed. Adam Rocska 2020-06-02 16:38:44 +0200
  • 1bf6817aab Data can be read nicely. Next stop : Finish the API layer. Once done : - clean up the tests - refactor parts of the source - find additional optimization opportunities. I don't like the slow init. - document - tell the world it's done Adam Rocska 2020-06-01 14:29:02 +0200
  • aa6d2958c7 I couldn't let this whole repo go. Eventually I solved the slow index buildup with a lazy normalizataion & solved the one last blocker of properly querying the databases. From a functionality perspective I guess it's complete. Now I gotta: - clean up the tests - refactor parts of the source - find additional optimization opportunities. I don't like the slow init. - document - tell the world it's done Adam Rocska 2020-06-01 12:11:54 +0200
  • a1703d884e postpone... Adam Rocska 2020-05-30 22:10:15 +0200
  • 4fe0745b4c Intentionally committing crap code. Adam Rocska 2020-05-30 22:08:07 +0200
  • 7094fa0a5d Renamed the Index module to IndexReader in hope that it'll help me resolve this small generic issue I have here. Adam Rocska 2020-05-30 20:34:28 +0200
  • 94b0ea8673 Temporary dummy code. Adam Rocska 2020-05-30 20:29:48 +0200
  • 937587ed92 Simplified formatting. Adam Rocska 2020-05-30 17:59:58 +0200
  • c073af2ec4 Renamed the Metadata internal module to MetadataReader. Hopefully it'll make imports a bit more comfortable. Adam Rocska 2020-05-30 17:52:47 +0200
  • aa11b7c118 sonar scan trigger Adam Rocska 2020-05-30 17:02:25 +0200
  • 6cc0926362 Trying to get a grab on the bull's horn somehow. Adam Rocska 2020-05-30 16:59:39 +0200
  • c28c6c640b Added dependencies in package swift. I still don't get it why did it compile, so I gotta look into this as well at some point. Adam Rocska 2020-05-30 16:58:45 +0200
  • f92a0daf79 Impossible to design a protocol at this point. And there's just no way I would take that php scripter fantasy crap as the fundamentum for this lib, no matter how crippled already it is by inherited scripter stupidity. Adam Rocska 2020-05-30 16:58:03 +0200
  • cb2b939085 Made DBReader interfaces public. Adam Rocska 2020-05-30 16:56:05 +0200
  • 278e8b3efb Created & added a future plans doc' item to remind myself, and other potential readers on what's about to come. Adam Rocska 2020-05-30 16:55:26 +0200
  • 9827635299 Added GeoLite DB files for testing purposes. Totally not cool for "unit" testing, but I gotta validate the concepts somehow. Tests will be refactored. Adam Rocska 2020-05-30 16:54:59 +0200
  • 5da03ef59d DataBaseType enum for somehow handling the possiblly valid database metadata types. Adam Rocska 2020-05-30 13:27:36 +0200
  • f4f5352c61 More specific imports. Dunno why. Adam Rocska 2020-05-29 22:17:31 +0200
  • 0e44b9422e Provided a few dumb tests for InMemoryReader and I just realized, that it's not even specific to "in memory-ness". It should work with anything. Adam Rocska 2020-05-29 22:16:04 +0200
  • f2b8c48df5 Reader protocol and foundations for DBReader's testability. Adam Rocska 2020-05-29 21:37:38 +0200
  • 7a7664acc6 Found a way around this naming problem. Adam Rocska 2020-05-29 20:54:26 +0200
  • b26f0cf0cf ReaderError.swift was no longer in use. Adam Rocska 2020-05-29 20:54:08 +0200
  • bf5e436499 Filebased readers have a metadata property. Exposing it, and exposing the DbMetadata concept overaall. Adam Rocska 2020-05-29 20:42:46 +0200
  • 26a3219960 Made the LICENSE stricter. After all this madness I don't want these mountebank php scripters forking and redistributing as their own. Adam Rocska 2020-05-29 15:05:05 +0200
  • cd69a4a736 Removed old readme disclaimers. Will be properly documented once this misery ends. Adam Rocska 2020-05-29 15:03:08 +0200
  • fe149cc237 Made the structs public, and created a protocol to allow for a slightly better API to work with maxmind's shitty php designed crap called "database". Adam Rocska 2020-05-29 14:54:55 +0200
  • c82765d9cd De-phpified ip addresses. Adam Rocska 2020-05-29 14:12:32 +0200
  • 9a77a33c78 Forwarding internal module's IpAddress through Api. Adam Rocska 2020-05-29 14:12:14 +0200
  • 0f83261f39 The initial port of the php retardness. Next I'll try to de-phpify this crap into a not-so-scrap state. It will eventually remain crappy because of the way it's "modelled" (or lack of modelling aactually). Adam Rocska 2020-05-29 12:41:10 +0200
  • 66b90935bc God knows what the difference between Records and Models are at this point. Starting off with a moderate reproduction of php scripter booboo in swift. Adam Rocska 2020-05-29 12:06:25 +0200
  • 1974c1744d Removed maxmind "branding" from repository wherever it was legally possible. Adam Rocska 2020-05-28 15:49:56 +0200
  • f3b1e5ceaf Put a primitive assertion in place just to hold my ass until the library comes together. Will make the tests professional & sexy at a later point. Adam Rocska 2020-05-28 15:41:26 +0200
  • c7c3ab44db Ok, the repo is somewhat exploded at this point. BUT IT WORKS! Now I only gotta provide proper tests instead of the trashy ones, put together the reader & serializer, and represent this maxmind php fantasy crap with some nice Structs. And then the saga is over for now. Adam Rocska 2020-05-28 14:23:26 +0200
  • d7387c8845 Able to decode sequential types Adam Rocska 2020-05-27 20:07:25 +0200
  • 7b40c52c9d Found a bug. I was an unattentive prick & assumed some clean logic in the definition size resolution algorithm. I shouldn't have. Now it's cool. Adam Rocska 2020-05-27 15:26:33 +0200
  • c645dd40c4 Created the intentional duplicate of interpretArray. Intenional duplicate, because I know nothing about this php and perl scripter mountebank fantasy data type. Adam Rocska 2020-05-27 09:44:54 +0200
  • 3bd97a83f1 Array interpretation in place, the logic seems to work. Gotta duplicate the data cache container, because there's no word in the spec, nor guarantee that its array-like structure related assumptions are correct. Adam Rocska 2020-05-27 08:58:55 +0200
  • 5bcd7ba700 This awful design seems to be able to tackle php scripter stupidity. The code sucks, but at least is testable and works so far. Now I just gotta reconstruct sequence types, and I finally can forget about this horror, and stop taking sedatives. Adam Rocska 2020-05-26 16:43:56 +0200
  • 8bbcfb3d3b Data padding added. Necessary code to handle php retardnesss of having 32bit integers defined in 0, 1, 2, 3 bytes... Adam Rocska 2020-05-20 17:44:19 +0200
  • 13fdc79bf9 Attempting a different way of typeconversion in hope, that we can handle the php scripter style stupidifaction of 11bit integers, and God knows what other retarded concepts can arise. Adam Rocska 2020-05-19 14:51:32 +0200
  • ac0abc8607 WIP. Total mess. Adam Rocska 2020-05-18 13:48:36 +0200
  • f6ab2f4cac Attempting another different approach. Adam Rocska 2020-05-18 00:26:10 +0200
  • 966928cfd2 Falling back to the original crap code that emerged from crap php scripters' logic. Too many edge cases and stupidities to bother with. Dumb design can't be made straight. Adam Rocska 2020-05-17 19:49:15 +0200
  • 4f3245561e made code 1 line shorter, but can't make it cleaner. I'm super angry on crappy code. Adam Rocska 2020-05-16 18:44:10 +0200
  • ddd782925d DataType foundations re-implemented. Can guess from this convoluted unclear non-unequivocal php scripter's fantasy the type of the data. I must say, that it's outrageously stupid, that with this control byte data type definition the scripters "designed" implicitly allows for two different ways of defining map types. One is [0b111X_XXXX] and the other is [0b000X_XXXX, 0b0000_0000], where both resolve to fantasy 7 with that fucking retarded logic, though are not equal. Adam Rocska 2020-05-16 18:24:06 +0200
  • 2969e82f3f isExtendedType implemented for DataType enum value Adam Rocska 2020-05-16 16:44:12 +0200
  • f02cb01293 Gotta redesign the whole decoder layer. Managed to sketch a way to tackle with these php scripter fantasies in the MaxMind DB spec on the whiteboard. Adam Rocska 2020-05-16 15:09:22 +0200
  • d236f8ce4e Introduced a few new protocols in hope that it'll make code more manageable. Adam Rocska 2020-05-15 19:24:41 +0200
  • a59d860145 Removed another nonsense doc' from the code. The whole datatype guessing has to be rewritten somehow. Adam Rocska 2020-05-15 16:32:57 +0200
  • 2cfe601c1f Removed the nonsense doc' from the code. The whole datatype guessing has to be rewritten somehow. Adam Rocska 2020-05-15 15:56:23 +0200
  • 057f29110a MaxMindPointer needs to also be castable to int. This whole typecasting crap should be fixed at some point, if I figure out how to de-phpify the spec. Adam Rocska 2020-05-15 15:26:55 +0200
  • c67a040998 Refactored key resolution to open it for pointer resolution. Adam Rocska 2020-05-15 14:36:08 +0200
  • 7132a933ec Extract refactor to prepare for pointer handling. Adam Rocska 2020-05-15 14:32:12 +0200
  • 2ec6980964 MaxMind Iterator now supports peek, an operation to seek control bytes, and binary data without modifying the pointer's state. Useful for MaaxMind's pointer lookup. Adam Rocska 2020-05-15 13:19:26 +0200
  • 97407b3520 I figured out, that there's no case when Data would be nil. Adam Rocska 2020-05-15 12:29:02 +0200
  • c7dfc8b538 Preparation refactor for public peek. Adam Rocska 2020-05-15 12:25:47 +0200
  • f33b6f3bef Preparation refactor for public peek. Adam Rocska 2020-05-15 12:11:55 +0200
  • e98405eaf7 Provided a test for the control byte skipping case. Adam Rocska 2020-05-15 11:46:57 +0200
  • be2d6bb103 Revert "Created the concept of MaxMindIterator.Entry" Adam Rocska 2020-05-15 10:54:20 +0200
  • 19f65467e4 Created the concept of MaxMindIterator.Entry Adam Rocska 2020-05-15 10:45:39 +0200
  • 09c5d36736 Dummy code in place. Adam Rocska 2020-05-15 10:38:36 +0200
  • 3d372ee48b Lookup edge cases. Adam Rocska 2020-05-15 10:32:12 +0200
  • 6629236c0e Dummy code commit. Work in progress. Adam Rocska 2020-05-15 10:18:46 +0200
  • 24b51db462 Preparing the iterator for automatic pointer resolution. Adam Rocska 2020-05-15 09:34:56 +0200
  • 52adc7d958 Any decoder extended to decode MaxMindPointer values. Adam Rocska 2020-05-14 20:47:12 +0200
  • a67bb082c5 MaxMind Pointer Decoder somewhat implemented. But this whole spiel with control bytes & things is insane. Code is as inconsistent as the spec. Adam Rocska 2020-05-14 20:19:28 +0200
  • 4d0d5c9eb5 Narrowed down the maxamind pointer to unsigned 32 bit integers. Adam Rocska 2020-05-14 19:57:58 +0200
  • 991dd27296 Misimplementation fixed. Adam Rocska 2020-05-14 17:24:14 +0200
  • bd5079e1c3 Decoder's ControlByte now also supports MaxMind's yet another edge case. Adam Rocska 2020-05-14 17:17:29 +0200
  • 9cb6dace14 First step to refactoring the ControlByte. Adam Rocska 2020-05-14 15:40:37 +0200
  • dba4535513 DataSection protocol. Adam Rocska 2020-05-14 15:35:37 +0200
  • 0ba9fa285c Foundations for the DataSection module. Adam Rocska 2020-05-14 15:35:23 +0200
  • 9bc3778877 ControlByte formatting. Adam Rocska 2020-05-14 15:34:59 +0200
  • 59b5816f99 Had to implement some basic MaxMindPointer type. Surprisingly swift has no newtype typealias mechanism, and we only need to differentiate "plain naked" UInt from UInt intended to be used as MaxMind's php folks' pointer value. Adam Rocska 2020-05-14 14:26:23 +0200
  • 8d5487b2a9 Fixed the precondition message typo in the InMemoryIndex stream status validation. Adam Rocska 2020-05-14 12:14:09 +0200
  • b1ac89d57c Added a few fields to the metadata struct to make db file processing a bit more efficient in other layers. Adam Rocska 2020-05-14 12:13:22 +0200
  • 92a66a6fa7 Cleaned out the sketch code we had. Adam Rocska 2020-05-13 20:46:12 +0200
  • 196a53dd2e Removed legacy data initialization from stream. Adam Rocska 2020-05-13 19:03:25 +0200
  • 24c41b964c Rephrased preconditions. Adam Rocska 2020-05-13 19:00:20 +0200
  • bf686792be Fixed the bad description rep of v6 ip addresses. Adam Rocska 2020-05-13 18:57:02 +0200
  • 79c9fe5fc6 Added assertion to an edge case I forgot about. Adam Rocska 2020-05-13 17:58:29 +0200
  • d01dd8256d Fixed another broken precondition. Adam Rocska 2020-05-13 17:55:17 +0200
  • fa661011ab Fixed the broken precondition. Adam Rocska 2020-05-13 17:52:27 +0200
  • 3a7f8eb363 Forgot to do an equatable node equals node struct assertion. Adam Rocska 2020-05-13 17:41:00 +0200
  • 30dc788d3f Did proper assertions. This time I did pay attention. Adam Rocska 2020-05-13 17:36:46 +0200
  • 68507104bd Revert "Added forgotten assertions :)" Adam Rocska 2020-05-13 17:19:12 +0200