/packages/modules/NetworkStack/src/android/net/dhcp/ |
D | DhcpPacket.java | 462 Inet4Address srcIp, short destUdp, short srcUdp, ByteBuffer buf, in fillInPacket() argument 474 buf.clear(); in fillInPacket() 475 buf.order(ByteOrder.BIG_ENDIAN); in fillInPacket() 478 buf.put(ETHER_BROADCAST); in fillInPacket() 479 buf.put(mClientMac); in fillInPacket() 480 buf.putShort((short) OsConstants.ETH_P_IP); in fillInPacket() 487 ipHeaderOffset = buf.position(); in fillInPacket() 488 buf.put(IP_VERSION_HEADER_LEN); in fillInPacket() 489 buf.put(IP_TOS_LOWDELAY); // tos: IPTOS_LOWDELAY in fillInPacket() 490 ipLengthOffset = buf.position(); in fillInPacket() [all …]
|
/packages/modules/NetworkStack/common/netlinkclient/src/android/net/netlink/ |
D | NduseroptMessage.java | 64 NduseroptMessage(@NonNull StructNlMsgHdr header, @NonNull ByteBuffer buf) in NduseroptMessage() argument 69 buf.order(ByteOrder.nativeOrder()); // Restored in the finally clause inside parse(). in NduseroptMessage() 70 final int start = buf.position(); in NduseroptMessage() 71 family = buf.get(); in NduseroptMessage() 72 buf.get(); // Skip 1 byte of padding. in NduseroptMessage() 73 opts_len = Short.toUnsignedInt(buf.getShort()); in NduseroptMessage() 74 ifindex = buf.getInt(); in NduseroptMessage() 75 icmp_type = buf.get(); in NduseroptMessage() 76 icmp_code = buf.get(); in NduseroptMessage() 77 buf.position(buf.position() + 6); // Skip 6 bytes of padding. in NduseroptMessage() [all …]
|
D | StructNdOptPref64.java | 110 private StructNdOptPref64(@NonNull ByteBuffer buf) { in StructNdOptPref64() argument 111 super(buf.get(), Byte.toUnsignedInt(buf.get())); in StructNdOptPref64() 115 int scaledLifetimePlc = Short.toUnsignedInt(buf.getShort()); in StructNdOptPref64() 119 buf.get(addressBytes, 0, 12); in StructNdOptPref64() 137 public static StructNdOptPref64 parse(@NonNull ByteBuffer buf) { in parse() argument 138 if (buf == null || buf.remaining() < STRUCT_SIZE) return null; in parse() 140 return new StructNdOptPref64(buf); in parse() 150 protected void writeToByteBuffer(ByteBuffer buf) { in writeToByteBuffer() argument 151 super.writeToByteBuffer(buf); in writeToByteBuffer() 152 buf.putShort(getScaledLifetimePlc(lifetime, prefixLengthToPlc(prefix.getPrefixLength()))); in writeToByteBuffer() [all …]
|
D | NdOption.java | 53 public static NdOption parse(ByteBuffer buf) { in parse() argument 54 if (buf == null || buf.remaining() < STRUCT_SIZE) return null; in parse() 57 byte type = buf.get(buf.position()); in parse() 58 int length = Byte.toUnsignedInt(buf.get(buf.position() + 1)); in parse() 63 return StructNdOptPref64.parse(buf); in parse() 66 int newPosition = Math.min(buf.limit(), buf.position() + length * 8); in parse() 67 buf.position(newPosition); in parse() 72 void writeToByteBuffer(ByteBuffer buf) { in writeToByteBuffer() argument 73 buf.put(type); in writeToByteBuffer() 74 buf.put((byte) length); in writeToByteBuffer()
|
/packages/modules/NetworkStack/tests/unit/src/android/net/netlink/ |
D | NduseroptMessageTest.java | 93 ByteBuffer buf = toBuffer(hexBytes); in testParseWithinNetlinkMessage() local 94 assertEquals(68, buf.limit()); in testParseWithinNetlinkMessage() 95 buf.order(ByteOrder.nativeOrder()); in testParseWithinNetlinkMessage() 97 NetlinkMessage nlMsg = NetlinkMessage.parse(buf); in testParseWithinNetlinkMessage() 122 ByteBuffer buf = toBuffer(hexBytes); in testParseUnknownOptionWithinNetlinkMessage() local 123 assertEquals(76, buf.limit()); in testParseUnknownOptionWithinNetlinkMessage() 124 buf.order(ByteOrder.nativeOrder()); in testParseUnknownOptionWithinNetlinkMessage() 126 NetlinkMessage nlMsg = NetlinkMessage.parse(buf); in testParseUnknownOptionWithinNetlinkMessage() 138 ByteBuffer buf = toBuffer(MSG_PREF64); in testUnknownOption() local 141 assertEquals(38, buf.get(optionStart)); in testUnknownOption() [all …]
|
D | StructNdOptPref64Test.java | 74 ByteBuffer buf = ByteBuffer.allocate(16) in makeNdOptPref64() local 80 buf.flip(); in makeNdOptPref64() 81 return buf; in makeNdOptPref64() 106 ByteBuffer buf = makeNdOptPref64(600, prefixBytes(PREFIX1), 0); in testParsing() local 107 StructNdOptPref64 opt = StructNdOptPref64.parse(buf); in testParsing() 111 buf = makeNdOptPref64(0, prefixBytes(PREFIX1), 1); in testParsing() 112 opt = StructNdOptPref64.parse(buf); in testParsing() 116 buf = makeNdOptPref64(8, prefixBytes(PREFIX2), 2); in testParsing() 117 opt = StructNdOptPref64.parse(buf); in testParsing() 122 buf = makeNdOptPref64(65528, prefixBytes(PREFIX2), 5); in testParsing() [all …]
|
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/common/ |
D | BlobCache.java | 196 byte[] buf = mIndexHeader; in loadIndex() 197 if (mIndexFile.read(buf) != INDEX_HEADER_SIZE) { in loadIndex() 202 if (readInt(buf, IH_MAGIC) != MAGIC_INDEX_FILE) { in loadIndex() 207 if (readInt(buf, IH_VERSION) != mVersion) { in loadIndex() 212 mMaxEntries = readInt(buf, IH_MAX_ENTRIES); in loadIndex() 213 mMaxBytes = readInt(buf, IH_MAX_BYTES); in loadIndex() 214 mActiveRegion = readInt(buf, IH_ACTIVE_REGION); in loadIndex() 215 mActiveEntries = readInt(buf, IH_ACTIVE_ENTRIES); in loadIndex() 216 mActiveBytes = readInt(buf, IH_ACTIVE_BYTES); in loadIndex() 218 int sum = readInt(buf, IH_CHECKSUM); in loadIndex() [all …]
|
/packages/modules/DnsResolver/ |
D | gethnamaddr.cpp | 99 uint8_t buf[MAXPACKET]; member 129 struct hostent* hent, char* buf, size_t buflen, int* he) { in getanswer() argument 149 eom = answer->buf + anslen; in getanswer() 171 bp = buf; in getanswer() 172 ep = buf + buflen; in getanswer() 173 cp = answer->buf; in getanswer() 177 n = dn_expand(answer->buf, eom, cp, bp, (int) (ep - bp)); in getanswer() 198 n = dn_expand(answer->buf, eom, cp, bp, (int) (ep - bp)); in getanswer() 219 n = dn_expand(answer->buf, eom, cp, tbuf, (int) sizeof tbuf); in getanswer() 246 n = dn_expand(answer->buf, eom, cp, tbuf, (int) sizeof tbuf); in getanswer() [all …]
|
D | res_mkquery.cpp | 105 uint8_t* buf, // buffer to put query in res_nmkquery() argument 119 if ((buf == NULL) || (buflen < HFIXEDSZ)) return (-1); in res_nmkquery() 120 memset(buf, 0, HFIXEDSZ); in res_nmkquery() 121 hp = (HEADER*) (void*) buf; in res_nmkquery() 127 cp = buf + HFIXEDSZ; in res_nmkquery() 128 ep = buf + buflen; in res_nmkquery() 130 *dpp++ = buf; in res_nmkquery() 191 return (cp - buf); in res_nmkquery() 195 uint8_t* buf, /* buffer to put query */ in res_nopt() argument 205 hp = (HEADER*) (void*) buf; in res_nopt() [all …]
|
D | res_send.cpp | 149 static int send_vc(res_state statp, res_params* params, const uint8_t* buf, int buflen, 152 static int send_dg(res_state statp, res_params* params, const uint8_t* buf, int buflen, 349 int res_nameinquery(const char* name, int type, int cl, const uint8_t* buf, const uint8_t* eom) { in res_nameinquery() argument 350 const uint8_t* cp = buf + HFIXEDSZ; in res_nameinquery() 351 int qdcount = ntohs(((const HEADER*) (const void*) buf)->qdcount); in res_nameinquery() 355 int n = dn_expand(buf, eom, cp, tname, sizeof tname); in res_nameinquery() 423 int res_nsend(res_state statp, const uint8_t* buf, int buflen, uint8_t* ans, int anssiz, int* rcode, in res_nsend() argument 433 res_pquery(buf, buflen); in res_nsend() 438 resolv_cache_lookup(statp->netid, buf, buflen, ans, anssiz, &anslen, flags); in res_nsend() 446 dnsQueryEvent->set_type(getQueryType(buf, buflen)); in res_nsend() [all …]
|
D | sethostent.cpp | 70 char *buf, *ptr; in _hf_gethtbyname2() local 85 if ((ptr = buf = (char*) malloc(len = info->buflen)) == NULL) { in _hf_gethtbyname2() 99 hp = netbsd_gethostent_r(hf, info->hp, info->buf, info->buflen, &he); in _hf_gethtbyname2() 125 if ((size_t)(ptr - buf) >= info->buflen) goto nospc; in _hf_gethtbyname2() 136 free(buf); in _hf_gethtbyname2() 144 ptr = info->buf; in _hf_gethtbyname2() 170 free(buf); in _hf_gethtbyname2() 173 free(buf); in _hf_gethtbyname2() 194 while ((hp = netbsd_gethostent_r(hf, info->hp, info->buf, info->buflen, &he)) != NULL) in _hf_gethtbyaddr()
|
/packages/apps/CellBroadcastReceiver/src/com/android/cellbroadcastreceiver/ |
D | CellBroadcastResources.java | 57 SpannableStringBuilder buf = new SpannableStringBuilder(); in getMessageDetails() local 59 appendMessageDetail(context, buf, R.string.delivery_time_heading, in getMessageDetails() 64 appendMessageDetail(context, buf, R.string.message_identifier, in getMessageDetails() 66 appendMessageDetail(context, buf, R.string.message_serial_number, in getMessageDetails() 72 appendCmasAlertDetails(context, buf, message.getCmasWarningInfo()); in getMessageDetails() 76 appendMessageDetail(context, buf, R.string.data_coding_scheme, in getMessageDetails() 79 appendMessageDetail(context, buf, R.string.message_content, message.getMessageBody()); in getMessageDetails() 81 appendMessageDetail(context, buf, R.string.location_check_time, locationCheckTime == -1 in getMessageDetails() 85 appendMessageDetail(context, buf, R.string.maximum_waiting_time, in getMessageDetails() 89 appendMessageDetail(context, buf, R.string.message_displayed, in getMessageDetails() [all …]
|
/packages/modules/NetworkStack/src/com/android/networkstack/arp/ |
D | ArpPacket.java | 70 final ByteBuffer buf = ByteBuffer.allocate(ARP_ETHER_IPV4_LEN); in buildArpPacket() local 73 buf.put(dstMac); in buildArpPacket() 74 buf.put(srcMac); in buildArpPacket() 75 buf.putShort((short) ETH_P_ARP); in buildArpPacket() 78 buf.putShort((short) ARP_HWTYPE_ETHER); // hrd in buildArpPacket() 79 buf.putShort((short) ETH_P_IP); // pro in buildArpPacket() 80 buf.put((byte) ETHER_ADDR_LEN); // hln in buildArpPacket() 81 buf.put((byte) IPV4_ADDR_LEN); // pln in buildArpPacket() 82 buf.putShort(opCode); // op in buildArpPacket() 83 buf.put(srcMac); // sha in buildArpPacket() [all …]
|
/packages/apps/Bluetooth/jni/ |
D | com_android_bluetooth_hid_device.cpp | 241 uint32_t* buf = (uint32_t*)calloc(len, sizeof(uint32_t)); in fill_qos() local 243 if (buf == NULL) return; in fill_qos() 245 env->GetIntArrayRegion(in, 0, len, (jint*)buf); in fill_qos() 247 out->service_type = (uint8_t)buf[0]; in fill_qos() 248 out->token_rate = buf[1]; in fill_qos() 249 out->token_bucket_size = buf[2]; in fill_qos() 250 out->peak_bandwidth = buf[3]; in fill_qos() 251 out->access_latency = buf[4]; in fill_qos() 252 out->delay_variation = buf[5]; in fill_qos() 254 free(buf); in fill_qos() [all …]
|
/packages/apps/Gallery2/jni_jpegstream/src/ |
D | jpeg_reader.cpp | 179 void JpegReader::formatPixels(uint8_t* buf, int32_t len) { in formatPixels() argument 180 uint8_t *iter = buf; in formatPixels() 188 c = buf[i + 0]; in formatPixels() 189 m = buf[i + 1]; in formatPixels() 190 y = buf[i + 2]; in formatPixels() 191 k = buf[i + 3]; in formatPixels() 219 buf[i] = 255; in formatPixels() 220 buf[i - 1] = *--iter; in formatPixels() 221 buf[i - 2] = *--iter; in formatPixels() 222 buf[i - 3] = *--iter; in formatPixels() [all …]
|
D | jpeg_writer.cpp | 166 void JpegWriter::formatPixels(uint8_t* buf, int32_t len) { in formatPixels() argument 169 uint8_t* d = buf; in formatPixels() 173 for (int i = 0; i < len / 4; ++i, buf += 4) { in formatPixels() 174 *d++ = buf[0]; in formatPixels() 175 *d++ = buf[1]; in formatPixels() 176 *d++ = buf[2]; in formatPixels() 183 *d++ = buf[3]; in formatPixels() 185 *d++ = buf[2]; in formatPixels() 188 for (int i = 1; i < len / 4; ++i, buf += 4) { in formatPixels() 189 *d++ = buf[3]; in formatPixels() [all …]
|
/packages/apps/LegacyCamera/jni/feature_mos/src/mosaic_renderer/ |
D | Renderer.cpp | 49 char* buf = (char*) malloc(infoLen); in loadShader() local 50 if (buf) { in loadShader() 51 glGetShaderInfoLog(shader, infoLen, NULL, buf); in loadShader() 53 shaderType, buf); in loadShader() 54 free(buf); in loadShader() 98 char* buf = (char*) malloc(bufLength); in createProgram() local 99 if (buf) in createProgram() 101 glGetProgramInfoLog(program, bufLength, NULL, buf); in createProgram() 102 LOGE("Could not link program:\n%s\n", buf); in createProgram() 103 free(buf); in createProgram()
|
/packages/services/Telephony/src/com/android/phone/settings/fdn/ |
D | DeleteFdnContactScreen.java | 110 StringBuilder buf = new StringBuilder(); in deleteContact() local 112 buf.append("number='"); in deleteContact() 114 buf.append("tag='"); in deleteContact() 115 buf.append(mName); in deleteContact() 116 buf.append("' AND number='"); in deleteContact() 118 buf.append(mNumber); in deleteContact() 119 buf.append("' AND pin2='"); in deleteContact() 120 buf.append(mPin2); in deleteContact() 121 buf.append("'"); in deleteContact() 126 mQueryHandler.startDelete(0, null, uri, buf.toString(), null); in deleteContact()
|
/packages/apps/Gallery2/jni/filters/ |
D | edge.c | 43 uint8_t buf[buf_len]; in JNIFUNCF() local 47 memset(buf, 0, buf_len * sizeof(char)); in JNIFUNCF() 49 *(buf + j) = 255; // set initial alphas in JNIFUNCF() 100 *(buf + buf_row_ring + off) = ret; in JNIFUNCF() 101 *(buf + buf_row_ring + off + 1) = ret; in JNIFUNCF() 102 *(buf + buf_row_ring + off + 2) = ret; in JNIFUNCF() 103 *(buf + buf_row_ring + off + 3) = *(ptr + loc + 3); in JNIFUNCF() 110 memcpy((dst + row_stride * (j - 1)), (buf + buf_row_ring), row_stride * sizeof(char)); in JNIFUNCF() 117 memcpy((dst + second_last_row), (buf + buf_row_ring), row_stride * sizeof(char)); in JNIFUNCF()
|
/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/exif/ |
D | ExifReader.java | 72 byte buf[] = new byte[parser.getCompressedImageSize()]; in read() 73 if (buf.length == parser.read(buf)) { in read() 74 exifData.setCompressedThumbnail(buf); in read() 80 buf = new byte[parser.getStripSize()]; in read() 81 if (buf.length == parser.read(buf)) { in read() 82 exifData.setStripBytes(parser.getStripIndex(), buf); in read() local
|
/packages/apps/Camera2/src/com/android/camera/exif/ |
D | ExifReader.java | 72 byte buf[] = new byte[parser.getCompressedImageSize()]; in read() 73 if (buf.length == parser.read(buf)) { in read() 74 exifData.setCompressedThumbnail(buf); in read() 80 buf = new byte[parser.getStripSize()]; in read() 81 if (buf.length == parser.read(buf)) { in read() 82 exifData.setStripBytes(parser.getStripIndex(), buf); in read() local
|
/packages/apps/Messaging/src/com/android/messaging/util/exif/ |
D | ExifReader.java | 73 byte buf[] = new byte[parser.getCompressedImageSize()]; in read() 74 if (buf.length == parser.read(buf)) { in read() 75 exifData.setCompressedThumbnail(buf); in read() 81 buf = new byte[parser.getStripSize()]; in read() 82 if (buf.length == parser.read(buf)) { in read() 83 exifData.setStripBytes(parser.getStripIndex(), buf); in read() local
|
/packages/providers/MediaProvider/src/com/android/providers/media/util/ |
D | XmpInterface.java | 157 final byte[] buf; in fromContainer() 160 buf = exif.getAttributeBytes(ExifInterface.TAG_XMP); in fromContainer() 163 buf = EmptyArray.BYTE; in fromContainer() 166 return new XmpInterface(new ByteArrayInputStream(buf), redactedExifTags, xmpOffsets); in fromContainer() 176 byte[] buf = null; in fromContainer() 178 if (buf == null) { in fromContainer() 180 buf = iso.getBoxBytes(uuid); in fromContainer() 183 if (buf == null) { in fromContainer() 184 buf = iso.getBoxBytes(IsoInterface.BOX_XMP); in fromContainer() 187 if (buf == null) { in fromContainer() [all …]
|
/packages/modules/NetworkStack/tests/unit/jni/ |
D | apf_jni.cpp | 41 std::vector<uint8_t> buf(program_len + data_len, 0); in com_android_server_ApfTest_apfSimulate() local 43 env->GetByteArrayRegion(jprogram, 0, program_len, reinterpret_cast<jbyte*>(buf.data())); in com_android_server_ApfTest_apfSimulate() 47 reinterpret_cast<jbyte*>(buf.data() + program_len)); in com_android_server_ApfTest_apfSimulate() 51 accept_packet(buf.data(), program_len, program_len + data_len, in com_android_server_ApfTest_apfSimulate() 56 reinterpret_cast<jbyte*>(buf.data() + program_len)); in com_android_server_ApfTest_apfSimulate() 194 std::vector<uint8_t> buf(apf_program_len + data_len, 0); in com_android_server_ApfTest_dropsAllPackets() local 197 env->GetByteArrayRegion(jprogram, 0, apf_program_len, reinterpret_cast<jbyte*>(buf.data())); in com_android_server_ApfTest_dropsAllPackets() 199 reinterpret_cast<jbyte*>(buf.data() + apf_program_len)); in com_android_server_ApfTest_dropsAllPackets() 211 int result = accept_packet(buf.data(), apf_program_len, in com_android_server_ApfTest_dropsAllPackets() 217 reinterpret_cast<jbyte*>(buf.data() + apf_program_len)); in com_android_server_ApfTest_dropsAllPackets() [all …]
|
/packages/apps/Dialer/java/com/android/voicemail/impl/utils/ |
D | IndentingPrintWriter.java | 95 final char[] buf = new char[len]; in write() local 96 s.getChars(off, len - off, buf, 0); in write() 97 write(buf, 0, len); in write() 101 public void write(char[] buf, int offset, int count) { in write() argument 109 char ch = buf[lineEnd++]; in write() 113 super.write(buf, lineStart, lineEnd - lineStart); in write() 129 super.write(buf, lineStart, lineEnd - lineStart); in write() 140 super.write(buf, lineStart, lineEnd - lineStart); in write()
|