-
Notifications
You must be signed in to change notification settings - Fork 382
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
add "missing" (bit) operator for hw_address, ip_address, ipv6_address #275
add "missing" (bit) operator for hw_address, ip_address, ipv6_address #275
Conversation
… ipv6_address * add not-operator and a simlple unit test for hw_address, ip_address, ipv6_address * add greater-then-operator and a simlple unit test for ipv6_address * add new constructor and a simlple unit test for network_interface, which use a ipv6_address to find the nic * add override the function gateway_from_ip for ipv6_address parameter (untested)
hmm looks like that some ipv6 adresses more invalid on windows then on linux. |
…ddresses are valid for the winsock api
Sorry it took me a few days to reply. This looks good! I'll have a deeper look later today or tomorrow and I'll probably merge it. |
Ugh sorry it took me so long to get back at this. I initially implemented Can you add those ones? It should be a one liner for all of them. |
* add <=, >, >= operator for IPv4Address with tests * add <=,>= operator for IPv6Address with tests
ok, add these operators fo hw, ip and ip6 address |
I'm curious why some operators are implemented as friends while the same operator in a different class is just a regular operator? |
??? sry im not sure what you mean with implemented as friends? if i see correctly all operators, which i added are public and did not use the friend "visiblity". may you can give an example please? |
Sure, for example IPv6Address::operator~ is a free funcion. It's defined inside Then the same member but for HWAddress::operator~ that's actually a member function. Is there any reason why they're not both defined in the same way? |
dam yes, i think i just copied & paste the friend signature from " TINS_API friend std::ostream& operator<<(std::ostream& os, const IPv6Address& addr);" and forget to remove the friend keyword |
was the refactoring of the operator so ok? |
Yep, looks good! Thanks for the PR! |
Hi,
last i play a bit with ipv6 and address caclulation and so i added some operator functions the address classes.