| | |
| | | |
| | | #### General coding rules |
| | | |
| | | Supposing you already know how to contribute to an open source project on GitHub (if you have doubts you can check this short [guide](https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project) ), you're working on an existing issue the code is already committed on your fork. |
| | | Supposing you already know how to contribute to an open source project on GitHub (if you have doubts you can check this short [guide](https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project) ), you're working on an existing issue the code is already committed on your fork. |
| | | |
| | | * Ensure your feature branch is up to date with the `develop`, eventually merge the latest changes from the `develop` branch. This will help us save time. |
| | | * Reformat the changed code using "clang-format" to keep consistent formatting style. The style we use is in `.clang-format` at the base of the project. |
| | |
| | | ##### Don't |
| | | * Don't reformat the code following your personal likes, it introduce a lot of "noise" and makes very hard to merge. Use the clang-format style provided at the base of the project. |
| | | * Very large pull requests with few comments, no corresponding issue explaining what's it about will probably be rejected. |
| | | * We understand that the project is still in beta stage, however we would like to discuss it with you before we take project changing decision. Please contact the project maintainer at `contini.mailing[AT]gmail.com` if you have time and plan to do a large contribution. |
| | | * Even it it's in beta stage it's used ( _by some really courageous people!_ ) in production. We can't break current functionality, user established habits without documenting the change. |
| | | * We understand that the project is still in beta stage, however we would like to discuss it with you before we take project changing decision. Please contact the project maintainer at `contini.mailing[AT]gmail.com` if you have time and plan to do a large contribution. |
| | | * Even it it's in beta stage it's used ( _by some really courageous people!_ ) in production. We can't break current functionality, user established habits without documenting the change. |
| | | |
| | | |
| | |
| | | A copy protection, licensing software written in C++ for Windows and Linux (with a simple C api for use in C projects). |
| | | |
| | | [](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) |
| | | [](http://github.com/badges/stability-badges) |
| | | [](http://github.com/badges/stability-badges) |
| | | [](https://opensource.org/licenses/BSD-3-Clause) |
| | | [](https://travis-ci.org/open-license-manager/open-license-manager) |
| | | [](https://www.codacy.com/manual/gcontini/open-license-manager?utm_source=github.com&utm_medium=referral&utm_content=open-license-manager/open-license-manager&utm_campaign=Badge_Grade) |
| | |
| | | |
| | | The following modules are planned... |
| | | * a license [backoffice](../../issues/7) in php (in order to handle multiple licenses). |
| | | * a license debugger to be sent to the final customer when there are licensing problems. |
| | | * a license debugger to be sent to the final customer when there are licensing problems. |
| | | * a [log descriptor](../../issues/8) in order to decrypt logs generated by the license system. |
| | | |
| | | # How to build |
| | | Below an overview of the basic build procedure, you can find detailed instructions for [linux](https://github.com/open-license-manager/open-license-manager/wiki/Build-the-library) or [windows](https://github.com/open-license-manager/open-license-manager/wiki/Build-the-library-win) in the wiki. |
| | | Below an overview of the basic build procedure, you can find detailed instructions for [linux](https://github.com/open-license-manager/open-license-manager/wiki/Build-the-library) or [windows](https://github.com/open-license-manager/open-license-manager/wiki/Build-the-library-windows) in the wiki. |
| | | |
| | | ## Prerequisites |
| | | * Operating system: Linux(Ubuntu, CentOS), Windows |
| | |
| | | |
| | | static FUNCTION_RETURN generate_ethernet_pc_id(PcIdentifier *identifiers, unsigned int *num_identifiers, int use_mac) { |
| | | FUNCTION_RETURN result_adapterInfos; |
| | | unsigned int j, k; |
| | | OsAdapterInfo *adapterInfos; |
| | | size_t defined_adapters, adapters = 0; |
| | | |
| | |
| | | adapterInfos = (OsAdapterInfo *)malloc(adapters * sizeof(OsAdapterInfo)); |
| | | result_adapterInfos = getAdapterInfos(adapterInfos, &adapters); |
| | | if (result_adapterInfos == FUNC_RET_BUFFER_TOO_SMALL || result_adapterInfos == FUNC_RET_OK) { |
| | | unsigned int j; |
| | | for (j = 0; j < adapters; j++) { |
| | | unsigned int k; |
| | | for (k = 0; k < 6; k++) |
| | | if (use_mac) { |
| | | identifiers[j][k] = adapterInfos[j].mac_address[k + 2]; |
| | |
| | | FUNCTION_RETURN result_diskinfos; |
| | | unsigned int i, j; |
| | | int defined_identifiers; |
| | | char firstChar; |
| | | DiskInfo *diskInfos; |
| | | |
| | | result_diskinfos = getDiskInfos(NULL, &disk_num); |
| | |
| | | return result_diskinfos; |
| | | } |
| | | for (i = 0; i < disk_num; i++) { |
| | | firstChar = use_label ? diskInfos[i].label[0] : diskInfos[i].disk_sn[0]; |
| | | char firstChar = use_label ? diskInfos[i].label[0] : diskInfos[i].disk_sn[0]; |
| | | available_disk_info += firstChar == 0 ? 0 : 1; |
| | | } |
| | | |
| | |
| | | static char Res[3]; // CRC Result |
| | | char CRC[2]; |
| | | int i; |
| | | char DoInvert; |
| | | |
| | | for (i = 0; i < 2; ++i) CRC[i] = 0; // Init before calculation |
| | | |
| | | for (i = 0; i < strlen(BitString); ++i) { |
| | | DoInvert = ('1' == BitString[i]) ^ CRC[1]; // XOR required? |
| | | char doInvert = ('1' == BitString[i]) ^ CRC[1]; // XOR required? |
| | | |
| | | CRC[1] = CRC[0]; |
| | | CRC[0] = DoInvert; |
| | | CRC[0] = doInvert; |
| | | } |
| | | |
| | | for (i = 0; i < 2; ++i) Res[1 - i] = CRC[i] ? '1' : '0'; // Convert binary to ASCII |