2 * Copyright 2014 Facebook, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "IPAddressV6.h"
22 #include <folly/Format.h>
23 #include <folly/IPAddress.h>
24 #include <folly/IPAddressV4.h>
25 #include <folly/MacAddress.h>
32 // public static const
33 const uint32_t IPAddressV6::PREFIX_TEREDO = 0x20010000;
34 const uint32_t IPAddressV6::PREFIX_6TO4 = 0x2002;
37 size_t hash_value(const IPAddressV6& addr) {
40 ostream& operator<<(ostream& os, const IPAddressV6& addr) {
44 void toAppend(IPAddressV6 addr, string* result) {
45 result->append(addr.str());
47 void toAppend(IPAddressV6 addr, fbstring* result) {
48 result->append(addr.str());
51 // public default constructor
52 IPAddressV6::IPAddressV6() {
55 // public string constructor
56 IPAddressV6::IPAddressV6(StringPiece addr) {
59 // Allow addresses surrounded in brackets
61 throw IPAddressFormatException("Invalid IPv6 address '", ip,
62 "': address too short");
64 if (ip.front() == '[' && ip.back() == ']') {
65 ip = ip.substr(1, ip.size() - 2);
68 if (inet_pton(AF_INET6, ip.c_str(), &addr_.in6Addr_) != 1) {
69 throw IPAddressFormatException("Invalid IPv6 address '", ip, "'");
73 // in6_addr constructor
74 IPAddressV6::IPAddressV6(const in6_addr& src)
79 // ByteArray16 constructor
80 IPAddressV6::IPAddressV6(const ByteArray16& src)
85 // link-local constructor
86 IPAddressV6::IPAddressV6(LinkLocalTag, MacAddress mac)
90 IPAddressV6::AddressStorage::AddressStorage(MacAddress mac) {
91 // The link-local address uses modified EUI-64 format,
92 // See RFC 4291 sections 2.5.1, 2.5.6, and Appendix A
93 const auto* macBytes = mac.bytes();
94 memcpy(&bytes_.front(), "\xfe\x80\x00\x00\x00\x00\x00\x00", 8);
95 bytes_[8] = macBytes[0] ^ 0x02;
96 bytes_[9] = macBytes[1];
97 bytes_[10] = macBytes[2];
100 bytes_[13] = macBytes[3];
101 bytes_[14] = macBytes[4];
102 bytes_[15] = macBytes[5];
105 void IPAddressV6::setFromBinary(ByteRange bytes) {
106 if (bytes.size() != 16) {
107 throw IPAddressFormatException("Invalid IPv6 binary data: length must "
108 "be 16 bytes, got ", bytes.size());
110 memcpy(&addr_.in6Addr_.s6_addr, bytes.data(), sizeof(in6_addr));
114 IPAddressV4 IPAddressV6::createIPv4() const {
115 if (!isIPv4Mapped()) {
116 throw IPAddressFormatException("addr is not v4-to-v6-mapped");
118 const unsigned char* by = bytes();
119 return IPAddressV4(detail::Bytes::mkAddress4(&by[12]));
122 // convert two uint8_t bytes into a uint16_t as hibyte.lobyte
123 static inline uint16_t unpack(uint8_t lobyte, uint8_t hibyte) {
124 return ((uint16_t)hibyte << 8) | (uint16_t)lobyte;
127 // given a src string, unpack count*2 bytes into dest
128 // dest must have as much storage as count
129 static inline void unpackInto(const unsigned char* src,
132 for (int i = 0, hi = 1, lo = 0; i < count; i++) {
133 dest[i] = unpack(src[hi], src[lo]);
140 IPAddressV4 IPAddressV6::getIPv4For6To4() const {
142 throw IPAddressV6::TypeError(format(
143 "Invalid IP '{}': not a 6to4 address", str()).str());
145 // convert 16x8 bytes into first 4x16 bytes
146 uint16_t ints[4] = {0,0,0,0};
147 unpackInto(bytes(), ints, 4);
150 unsigned char bytes[4];
153 ipv4.bytes[0] = (uint8_t)((ints[1] & 0xFF00) >> 8);
154 ipv4.bytes[1] = (uint8_t)(ints[1] & 0x00FF);
155 ipv4.bytes[2] = (uint8_t)((ints[2] & 0xFF00) >> 8);
156 ipv4.bytes[3] = (uint8_t)(ints[2] & 0x00FF);
157 return IPAddressV4(ipv4.addr);
161 bool IPAddressV6::isIPv4Mapped() const {
162 // v4 mapped addresses have their first 10 bytes set to 0, the next 2 bytes
163 // set to 255 (0xff);
164 const unsigned char* by = bytes();
166 // check if first 10 bytes are 0
167 for (int i = 0; i < 10; i++) {
172 // check if bytes 11 and 12 are 255
173 if (by[10] == 0xff && by[11] == 0xff) {
180 IPAddressV6::Type IPAddressV6::type() const {
181 // convert 16x8 bytes into first 2x16 bytes
182 uint16_t ints[2] = {0,0};
183 unpackInto(bytes(), ints, 2);
185 if ((((uint32_t)ints[0] << 16) | ints[1]) == IPAddressV6::PREFIX_TEREDO) {
189 if ((uint32_t)ints[0] == IPAddressV6::PREFIX_6TO4) {
197 string IPAddressV6::toJson() const {
199 "{{family:'AF_INET6', addr:'{}', hash:{}}}", str(), hash()).str();
203 size_t IPAddressV6::hash() const {
204 if (isIPv4Mapped()) {
205 /* An IPAddress containing this object would be equal (i.e. operator==)
206 to an IPAddress containing the corresponding IPv4.
207 So we must make sure that the hash values are the same as well */
208 return IPAddress::createIPv4(*this).hash();
211 static const uint64_t seed = AF_INET6;
212 uint64_t hash1 = 0, hash2 = 0;
213 hash::SpookyHashV2::Hash128(&addr_, 16, &hash1, &hash2);
214 return hash::hash_combine(seed, hash1, hash2);
218 bool IPAddressV6::inSubnet(StringPiece cidrNetwork) const {
219 auto subnetInfo = IPAddress::createNetwork(cidrNetwork);
220 auto addr = subnetInfo.first;
222 throw IPAddressFormatException("Address '", addr.toJson(), "' ",
223 "is not a V6 address");
225 return inSubnetWithMask(addr.asV6(), fetchMask(subnetInfo.second));
229 bool IPAddressV6::inSubnetWithMask(const IPAddressV6& subnet,
230 const ByteArray16& cidrMask) const {
231 const ByteArray16 mask = detail::Bytes::mask(toByteArray(), cidrMask);
232 const ByteArray16 subMask = detail::Bytes::mask(subnet.toByteArray(),
234 return (mask == subMask);
238 bool IPAddressV6::isLoopback() const {
239 const unsigned char* by = bytes();
240 for (int i = 0; i < 15; i++) {
245 return (by[15] == 0x01);
248 bool IPAddressV6::isRoutable() const {
250 // 2000::/3 is the only assigned global unicast block
251 inBinarySubnet({{0x20, 0x00}}, 3) ||
252 // ffxe::/16 are global scope multicast addresses,
253 // which are eligible to be routed over the internet
254 (isMulticast() && getMulticastScope() == 0xe);
257 bool IPAddressV6::isLinkLocalBroadcast() const {
258 static const IPAddressV6 kLinkLocalBroadcast("ff02::1");
259 return *this == kLinkLocalBroadcast;
263 bool IPAddressV6::isPrivate() const {
264 return isLoopback() || inBinarySubnet({{0xfc, 0x00}}, 7);
267 bool IPAddressV6::isLinkLocal() const {
268 return inBinarySubnet({{0xfe, 0x80}}, 10);
271 bool IPAddressV6::isMulticast() const {
272 return addr_.bytes_[0] == 0xff;
275 uint8_t IPAddressV6::getMulticastFlags() const {
276 DCHECK(isMulticast());
277 return ((addr_.bytes_[1] >> 4) & 0xf);
280 uint8_t IPAddressV6::getMulticastScope() const {
281 DCHECK(isMulticast());
282 return (addr_.bytes_[1] & 0xf);
285 IPAddressV6 IPAddressV6::getSolicitedNodeAddress() const {
286 // Solicted node addresses must be constructed from unicast (or anycast)
288 DCHECK(!isMulticast());
290 uint8_t bytes[16] = { 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
291 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00 };
292 bytes[13] = addr_.bytes_[13];
293 bytes[14] = addr_.bytes_[14];
294 bytes[15] = addr_.bytes_[15];
295 return IPAddressV6::fromBinary(ByteRange(bytes, 16));
299 IPAddressV6 IPAddressV6::mask(size_t numBits) const {
300 static const auto bits = bitCount();
301 if (numBits > bits) {
302 throw IPAddressFormatException("numBits(", numBits, ") > bitCount(",
305 ByteArray16 ba = detail::Bytes::mask(fetchMask(numBits), addr_.bytes_);
306 return IPAddressV6(ba);
310 string IPAddressV6::str() const {
311 char buffer[INET6_ADDRSTRLEN] = {0};
312 if (!inet_ntop(AF_INET6, &addr_.in6Addr_, buffer, INET6_ADDRSTRLEN)) {
313 throw IPAddressFormatException("Invalid address with hex ",
314 "'", detail::Bytes::toHex(bytes(), 16), "'");
317 return std::move(ip);
321 string IPAddressV6::toFullyQualified() const {
322 return detail::fastIpv6ToString(addr_.in6Addr_);
326 uint8_t IPAddressV6::getNthMSByte(size_t byteIndex) const {
327 const auto highestIndex = byteCount() - 1;
328 if (byteIndex > highestIndex) {
329 throw std::invalid_argument(to<string>("Byte index must be <= ",
330 to<string>(highestIndex), " for addresses of type :",
331 detail::familyNameStr(AF_INET6)));
333 return bytes()[byteIndex];
337 const ByteArray16 IPAddressV6::fetchMask(size_t numBits) {
338 static const uint8_t bits = bitCount();
339 if (numBits > bits) {
340 throw IPAddressFormatException("IPv6 addresses are 128 bits.");
342 // masks_ is backed by an array so is zero indexed
343 return masks_[numBits];
347 bool IPAddressV6::inBinarySubnet(const std::array<uint8_t, 2> addr,
348 size_t numBits) const {
349 const unsigned char* subbytes = mask(numBits).bytes();
350 return (std::memcmp(addr.data(), subbytes, 2) == 0);
354 const std::array<ByteArray16, 129> IPAddressV6::masks_ = {{
355 /* /0 */ {{ 0x00,0x00,0x00,0x00,
358 0x00,0x00,0x00,0x00 }},
359 /* /1 */ {{ 0x80,0x00,0x00,0x00,
362 0x00,0x00,0x00,0x00 }},
363 /* /2 */ {{ 0xc0,0x00,0x00,0x00,
366 0x00,0x00,0x00,0x00 }},
367 /* /3 */ {{ 0xe0,0x00,0x00,0x00,
370 0x00,0x00,0x00,0x00 }},
371 /* /4 */ {{ 0xf0,0x00,0x00,0x00,
374 0x00,0x00,0x00,0x00 }},
375 /* /5 */ {{ 0xf8,0x00,0x00,0x00,
378 0x00,0x00,0x00,0x00 }},
379 /* /6 */ {{ 0xfc,0x00,0x00,0x00,
382 0x00,0x00,0x00,0x00 }},
383 /* /7 */ {{ 0xfe,0x00,0x00,0x00,
386 0x00,0x00,0x00,0x00 }},
387 /* /8 */ {{ 0xff,0x00,0x00,0x00,
390 0x00,0x00,0x00,0x00 }},
391 /* /9 */ {{ 0xff,0x80,0x00,0x00,
394 0x00,0x00,0x00,0x00 }},
395 /* /10 */ {{ 0xff,0xc0,0x00,0x00,
398 0x00,0x00,0x00,0x00 }},
399 /* /11 */ {{ 0xff,0xe0,0x00,0x00,
402 0x00,0x00,0x00,0x00 }},
403 /* /12 */ {{ 0xff,0xf0,0x00,0x00,
406 0x00,0x00,0x00,0x00 }},
407 /* /13 */ {{ 0xff,0xf8,0x00,0x00,
410 0x00,0x00,0x00,0x00 }},
411 /* /14 */ {{ 0xff,0xfc,0x00,0x00,
414 0x00,0x00,0x00,0x00 }},
415 /* /15 */ {{ 0xff,0xfe,0x00,0x00,
418 0x00,0x00,0x00,0x00 }},
419 /* /16 */ {{ 0xff,0xff,0x00,0x00,
422 0x00,0x00,0x00,0x00 }},
423 /* /17 */ {{ 0xff,0xff,0x80,0x00,
426 0x00,0x00,0x00,0x00 }},
427 /* /18 */ {{ 0xff,0xff,0xc0,0x00,
430 0x00,0x00,0x00,0x00 }},
431 /* /19 */ {{ 0xff,0xff,0xe0,0x00,
434 0x00,0x00,0x00,0x00 }},
435 /* /20 */ {{ 0xff,0xff,0xf0,0x00,
438 0x00,0x00,0x00,0x00 }},
439 /* /21 */ {{ 0xff,0xff,0xf8,0x00,
442 0x00,0x00,0x00,0x00 }},
443 /* /22 */ {{ 0xff,0xff,0xfc,0x00,
446 0x00,0x00,0x00,0x00 }},
447 /* /23 */ {{ 0xff,0xff,0xfe,0x00,
450 0x00,0x00,0x00,0x00 }},
451 /* /24 */ {{ 0xff,0xff,0xff,0x00,
454 0x00,0x00,0x00,0x00 }},
455 /* /25 */ {{ 0xff,0xff,0xff,0x80,
458 0x00,0x00,0x00,0x00 }},
459 /* /26 */ {{ 0xff,0xff,0xff,0xc0,
462 0x00,0x00,0x00,0x00 }},
463 /* /27 */ {{ 0xff,0xff,0xff,0xe0,
466 0x00,0x00,0x00,0x00 }},
467 /* /28 */ {{ 0xff,0xff,0xff,0xf0,
470 0x00,0x00,0x00,0x00 }},
471 /* /29 */ {{ 0xff,0xff,0xff,0xf8,
474 0x00,0x00,0x00,0x00 }},
475 /* /30 */ {{ 0xff,0xff,0xff,0xfc,
478 0x00,0x00,0x00,0x00 }},
479 /* /31 */ {{ 0xff,0xff,0xff,0xfe,
482 0x00,0x00,0x00,0x00 }},
483 /* /32 */ {{ 0xff,0xff,0xff,0xff,
486 0x00,0x00,0x00,0x00 }},
487 /* /33 */ {{ 0xff,0xff,0xff,0xff,
490 0x00,0x00,0x00,0x00 }},
491 /* /34 */ {{ 0xff,0xff,0xff,0xff,
494 0x00,0x00,0x00,0x00 }},
495 /* /35 */ {{ 0xff,0xff,0xff,0xff,
498 0x00,0x00,0x00,0x00 }},
499 /* /36 */ {{ 0xff,0xff,0xff,0xff,
502 0x00,0x00,0x00,0x00 }},
503 /* /37 */ {{ 0xff,0xff,0xff,0xff,
506 0x00,0x00,0x00,0x00 }},
507 /* /38 */ {{ 0xff,0xff,0xff,0xff,
510 0x00,0x00,0x00,0x00 }},
511 /* /39 */ {{ 0xff,0xff,0xff,0xff,
514 0x00,0x00,0x00,0x00 }},
515 /* /40 */ {{ 0xff,0xff,0xff,0xff,
518 0x00,0x00,0x00,0x00 }},
519 /* /41 */ {{ 0xff,0xff,0xff,0xff,
522 0x00,0x00,0x00,0x00 }},
523 /* /42 */ {{ 0xff,0xff,0xff,0xff,
526 0x00,0x00,0x00,0x00 }},
527 /* /43 */ {{ 0xff,0xff,0xff,0xff,
530 0x00,0x00,0x00,0x00 }},
531 /* /44 */ {{ 0xff,0xff,0xff,0xff,
534 0x00,0x00,0x00,0x00 }},
535 /* /45 */ {{ 0xff,0xff,0xff,0xff,
538 0x00,0x00,0x00,0x00 }},
539 /* /46 */ {{ 0xff,0xff,0xff,0xff,
542 0x00,0x00,0x00,0x00 }},
543 /* /47 */ {{ 0xff,0xff,0xff,0xff,
546 0x00,0x00,0x00,0x00 }},
547 /* /48 */ {{ 0xff,0xff,0xff,0xff,
550 0x00,0x00,0x00,0x00 }},
551 /* /49 */ {{ 0xff,0xff,0xff,0xff,
554 0x00,0x00,0x00,0x00 }},
555 /* /50 */ {{ 0xff,0xff,0xff,0xff,
558 0x00,0x00,0x00,0x00 }},
559 /* /51 */ {{ 0xff,0xff,0xff,0xff,
562 0x00,0x00,0x00,0x00 }},
563 /* /52 */ {{ 0xff,0xff,0xff,0xff,
566 0x00,0x00,0x00,0x00 }},
567 /* /53 */ {{ 0xff,0xff,0xff,0xff,
570 0x00,0x00,0x00,0x00 }},
571 /* /54 */ {{ 0xff,0xff,0xff,0xff,
574 0x00,0x00,0x00,0x00 }},
575 /* /55 */ {{ 0xff,0xff,0xff,0xff,
578 0x00,0x00,0x00,0x00 }},
579 /* /56 */ {{ 0xff,0xff,0xff,0xff,
582 0x00,0x00,0x00,0x00 }},
583 /* /57 */ {{ 0xff,0xff,0xff,0xff,
586 0x00,0x00,0x00,0x00 }},
587 /* /58 */ {{ 0xff,0xff,0xff,0xff,
590 0x00,0x00,0x00,0x00 }},
591 /* /59 */ {{ 0xff,0xff,0xff,0xff,
594 0x00,0x00,0x00,0x00 }},
595 /* /60 */ {{ 0xff,0xff,0xff,0xff,
598 0x00,0x00,0x00,0x00 }},
599 /* /61 */ {{ 0xff,0xff,0xff,0xff,
602 0x00,0x00,0x00,0x00 }},
603 /* /62 */ {{ 0xff,0xff,0xff,0xff,
606 0x00,0x00,0x00,0x00 }},
607 /* /63 */ {{ 0xff,0xff,0xff,0xff,
610 0x00,0x00,0x00,0x00 }},
611 /* /64 */ {{ 0xff,0xff,0xff,0xff,
614 0x00,0x00,0x00,0x00 }},
615 /* /65 */ {{ 0xff,0xff,0xff,0xff,
618 0x00,0x00,0x00,0x00 }},
619 /* /66 */ {{ 0xff,0xff,0xff,0xff,
622 0x00,0x00,0x00,0x00 }},
623 /* /67 */ {{ 0xff,0xff,0xff,0xff,
626 0x00,0x00,0x00,0x00 }},
627 /* /68 */ {{ 0xff,0xff,0xff,0xff,
630 0x00,0x00,0x00,0x00 }},
631 /* /69 */ {{ 0xff,0xff,0xff,0xff,
634 0x00,0x00,0x00,0x00 }},
635 /* /70 */ {{ 0xff,0xff,0xff,0xff,
638 0x00,0x00,0x00,0x00 }},
639 /* /71 */ {{ 0xff,0xff,0xff,0xff,
642 0x00,0x00,0x00,0x00 }},
643 /* /72 */ {{ 0xff,0xff,0xff,0xff,
646 0x00,0x00,0x00,0x00 }},
647 /* /73 */ {{ 0xff,0xff,0xff,0xff,
650 0x00,0x00,0x00,0x00 }},
651 /* /74 */ {{ 0xff,0xff,0xff,0xff,
654 0x00,0x00,0x00,0x00 }},
655 /* /75 */ {{ 0xff,0xff,0xff,0xff,
658 0x00,0x00,0x00,0x00 }},
659 /* /76 */ {{ 0xff,0xff,0xff,0xff,
662 0x00,0x00,0x00,0x00 }},
663 /* /77 */ {{ 0xff,0xff,0xff,0xff,
666 0x00,0x00,0x00,0x00 }},
667 /* /78 */ {{ 0xff,0xff,0xff,0xff,
670 0x00,0x00,0x00,0x00 }},
671 /* /79 */ {{ 0xff,0xff,0xff,0xff,
674 0x00,0x00,0x00,0x00 }},
675 /* /80 */ {{ 0xff,0xff,0xff,0xff,
678 0x00,0x00,0x00,0x00 }},
679 /* /81 */ {{ 0xff,0xff,0xff,0xff,
682 0x00,0x00,0x00,0x00 }},
683 /* /82 */ {{ 0xff,0xff,0xff,0xff,
686 0x00,0x00,0x00,0x00 }},
687 /* /83 */ {{ 0xff,0xff,0xff,0xff,
690 0x00,0x00,0x00,0x00 }},
691 /* /84 */ {{ 0xff,0xff,0xff,0xff,
694 0x00,0x00,0x00,0x00 }},
695 /* /85 */ {{ 0xff,0xff,0xff,0xff,
698 0x00,0x00,0x00,0x00 }},
699 /* /86 */ {{ 0xff,0xff,0xff,0xff,
702 0x00,0x00,0x00,0x00 }},
703 /* /87 */ {{ 0xff,0xff,0xff,0xff,
706 0x00,0x00,0x00,0x00 }},
707 /* /88 */ {{ 0xff,0xff,0xff,0xff,
710 0x00,0x00,0x00,0x00 }},
711 /* /89 */ {{ 0xff,0xff,0xff,0xff,
714 0x00,0x00,0x00,0x00 }},
715 /* /90 */ {{ 0xff,0xff,0xff,0xff,
718 0x00,0x00,0x00,0x00 }},
719 /* /91 */ {{ 0xff,0xff,0xff,0xff,
722 0x00,0x00,0x00,0x00 }},
723 /* /92 */ {{ 0xff,0xff,0xff,0xff,
726 0x00,0x00,0x00,0x00 }},
727 /* /93 */ {{ 0xff,0xff,0xff,0xff,
730 0x00,0x00,0x00,0x00 }},
731 /* /94 */ {{ 0xff,0xff,0xff,0xff,
734 0x00,0x00,0x00,0x00 }},
735 /* /95 */ {{ 0xff,0xff,0xff,0xff,
738 0x00,0x00,0x00,0x00 }},
739 /* /96 */ {{ 0xff,0xff,0xff,0xff,
742 0x00,0x00,0x00,0x00 }},
743 /* /97 */ {{ 0xff,0xff,0xff,0xff,
746 0x80,0x00,0x00,0x00 }},
747 /* /98 */ {{ 0xff,0xff,0xff,0xff,
750 0xc0,0x00,0x00,0x00 }},
751 /* /99 */ {{ 0xff,0xff,0xff,0xff,
754 0xe0,0x00,0x00,0x00 }},
755 /* /100 */ {{ 0xff,0xff,0xff,0xff,
758 0xf0,0x00,0x00,0x00 }},
759 /* /101 */ {{ 0xff,0xff,0xff,0xff,
762 0xf8,0x00,0x00,0x00 }},
763 /* /102 */ {{ 0xff,0xff,0xff,0xff,
766 0xfc,0x00,0x00,0x00 }},
767 /* /103 */ {{ 0xff,0xff,0xff,0xff,
770 0xfe,0x00,0x00,0x00 }},
771 /* /104 */ {{ 0xff,0xff,0xff,0xff,
774 0xff,0x00,0x00,0x00 }},
775 /* /105 */ {{ 0xff,0xff,0xff,0xff,
778 0xff,0x80,0x00,0x00 }},
779 /* /106 */ {{ 0xff,0xff,0xff,0xff,
782 0xff,0xc0,0x00,0x00 }},
783 /* /107 */ {{ 0xff,0xff,0xff,0xff,
786 0xff,0xe0,0x00,0x00 }},
787 /* /108 */ {{ 0xff,0xff,0xff,0xff,
790 0xff,0xf0,0x00,0x00 }},
791 /* /109 */ {{ 0xff,0xff,0xff,0xff,
794 0xff,0xf8,0x00,0x00 }},
795 /* /110 */ {{ 0xff,0xff,0xff,0xff,
798 0xff,0xfc,0x00,0x00 }},
799 /* /111 */ {{ 0xff,0xff,0xff,0xff,
802 0xff,0xfe,0x00,0x00 }},
803 /* /112 */ {{ 0xff,0xff,0xff,0xff,
806 0xff,0xff,0x00,0x00 }},
807 /* /113 */ {{ 0xff,0xff,0xff,0xff,
810 0xff,0xff,0x80,0x00 }},
811 /* /114 */ {{ 0xff,0xff,0xff,0xff,
814 0xff,0xff,0xc0,0x00 }},
815 /* /115 */ {{ 0xff,0xff,0xff,0xff,
818 0xff,0xff,0xe0,0x00 }},
819 /* /116 */ {{ 0xff,0xff,0xff,0xff,
822 0xff,0xff,0xf0,0x00 }},
823 /* /117 */ {{ 0xff,0xff,0xff,0xff,
826 0xff,0xff,0xf8,0x00 }},
827 /* /118 */ {{ 0xff,0xff,0xff,0xff,
830 0xff,0xff,0xfc,0x00 }},
831 /* /119 */ {{ 0xff,0xff,0xff,0xff,
834 0xff,0xff,0xfe,0x00 }},
835 /* /120 */ {{ 0xff,0xff,0xff,0xff,
838 0xff,0xff,0xff,0x00 }},
839 /* /121 */ {{ 0xff,0xff,0xff,0xff,
842 0xff,0xff,0xff,0x80 }},
843 /* /122 */ {{ 0xff,0xff,0xff,0xff,
846 0xff,0xff,0xff,0xc0 }},
847 /* /123 */ {{ 0xff,0xff,0xff,0xff,
850 0xff,0xff,0xff,0xe0 }},
851 /* /124 */ {{ 0xff,0xff,0xff,0xff,
854 0xff,0xff,0xff,0xf0 }},
855 /* /125 */ {{ 0xff,0xff,0xff,0xff,
858 0xff,0xff,0xff,0xf8 }},
859 /* /126 */ {{ 0xff,0xff,0xff,0xff,
862 0xff,0xff,0xff,0xfc }},
863 /* /127 */ {{ 0xff,0xff,0xff,0xff,
866 0xff,0xff,0xff,0xfe }},
867 /* /128 */ {{ 0xff,0xff,0xff,0xff,
870 0xff,0xff,0xff,0xff }},