Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 111) sorted by relevance

12345

/cts/hostsidetests/net/app/src/com/android/cts/net/hostside/
DPacketReflector.java67 private static void swapBytes(byte[] buf, int pos1, int pos2, int len) { in swapBytes() argument
69 byte b = buf[pos1 + i]; in swapBytes()
70 buf[pos1 + i] = buf[pos2 + i]; in swapBytes()
71 buf[pos2 + i] = b; in swapBytes()
75 private static void swapAddresses(byte[] buf, int version) { in swapAddresses() argument
89 swapBytes(buf, addrPos, addrPos + addrLen, addrLen); in swapAddresses()
94 private void processTcpPacket(byte[] buf, int version, int len, int hdrLen) { in processTcpPacket() argument
100 swapAddresses(buf, version); in processTcpPacket()
103 writePacket(buf, len); in processTcpPacket()
108 private void processUdpPacket(byte[] buf, int version, int len, int hdrLen) { in processUdpPacket() argument
[all …]
/cts/tests/tests/net/jni/
DNativeDnsJni.c45 char buf[256]; in Java_android_net_cts_DnsTest_testNativeDns() local
48 buf, sizeof(buf)); in Java_android_net_cts_DnsTest_testNativeDns()
50 ALOGD(" %s", buf); in Java_android_net_cts_DnsTest_testNativeDns()
53 buf, sizeof(buf)); in Java_android_net_cts_DnsTest_testNativeDns()
55 ALOGD(" %s", buf); in Java_android_net_cts_DnsTest_testNativeDns()
78 char buf[256]; in Java_android_net_cts_DnsTest_testNativeDns() local
81 buf, sizeof(buf)); in Java_android_net_cts_DnsTest_testNativeDns()
82 ALOGD(" %s", buf); in Java_android_net_cts_DnsTest_testNativeDns()
86 buf, sizeof(buf)); in Java_android_net_cts_DnsTest_testNativeDns()
87 ALOGD(" %s", buf); in Java_android_net_cts_DnsTest_testNativeDns()
[all …]
DNativeMultinetworkJni.cpp73 int makeQuery(const char* name, int qtype, uint8_t* buf, size_t buflen) { in makeQuery() argument
74 return res_mkquery(ns_o_query, name, ns_c_in, qtype, NULL, 0, NULL, buf, buflen); in makeQuery()
77 int getAsyncResponse(JNIEnv* env, int fd, int timeoutMs, int* rcode, uint8_t* buf, size_t bufLen) { in getAsyncResponse() argument
82 int n = android_res_nresult(fd, rcode, buf, bufLen); in getAsyncResponse()
93 int extractIpAddressAnswers(uint8_t* buf, size_t bufLen, int family) { in extractIpAddressAnswers() argument
95 if (ns_initparse((const uint8_t*) buf, bufLen, &handle) < 0) { in extractIpAddressAnswers()
122 uint8_t buf[MAXPACKET] = {}; in expectAnswersValid() local
123 int res = getAsyncResponse(env, fd, TIMEOUT_MS, &rcode, buf, MAXPACKET); in expectAnswersValid()
131 return extractIpAddressAnswers(buf, res, family); in expectAnswersValid()
138 uint8_t buf[MAXPACKET] = {}; in expectAnswersNotValid() local
[all …]
/cts/tests/tests/location/src/android/location/cts/asn1/base/
DAsn1Object.java92 ByteBuffer buf = ByteBuffer.allocate(getBerLength()); in encodeBer() local
93 encodeBer(buf); in encodeBer()
94 return buf.array(); in encodeBer()
97 void encodeBer(ByteBuffer buf) { in encodeBer() argument
105 tag.writeTagAndLength(buf, true, innerValueLen); in encodeBer()
109 tag.writeTagAndLength(buf, isConstructed(), valueLen); in encodeBer()
110 encodeBerValue(buf); in encodeBer()
120 abstract void encodeBerValue(ByteBuffer buf); in encodeBerValue() argument
133 void decodeBer(ByteBuffer buf) { in decodeBer() argument
134 Asn1Tag tag = Asn1Tag.readTag(buf); in decodeBer()
[all …]
DAsn1Choice.java44 public void writeTagAndLength(ByteBuffer buf, boolean constructed, int valueLength) {
134 public void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
145 select.getTag().writeTagAndLength(buf, value.isConstructed(), value.getBerValueLength()); in encodeBerValue()
146 value.encodeBerValue(buf); in encodeBerValue()
148 select.getTag().writeTagAndLength(buf, true, value.getBerLength()); in encodeBerValue()
149 value.encodeBer(buf); in encodeBerValue()
152 value.encodeBer(buf); in encodeBerValue()
157 public void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
158 Asn1Tag tag = Asn1Tag.peekTag(buf); in decodeBerValue()
165 Asn1Tag.readTag(buf); // Read the tag off. in decodeBerValue()
[all …]
DAsn1Tag.java97 public void writeTagAndLength(ByteBuffer buf, boolean constructed, int valueLength) { in writeTagAndLength() argument
98 this.writeTag(buf, constructed); in writeTagAndLength()
99 writeLength(buf, valueLength); in writeTagAndLength()
102 private void writeTag(ByteBuffer buf, boolean constructed) { in writeTag() argument
107 buf.put((byte) (getValue() | CONSTRUCTED_BIT)); in writeTag()
109 buf.put((byte) getValue()); in writeTag()
113 static Asn1Tag readTag(ByteBuffer buf) { in readTag() argument
114 return Asn1Tag.fromValue(buf.get() & 0xFF); in readTag()
120 static Asn1Tag peekTag(ByteBuffer buf) { in peekTag() argument
121 return Asn1Tag.fromValue(buf.get(buf.position()) & 0xFF); in peekTag()
[all …]
DAsn1Sequence.java73 public void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
79 obj.encodeBer(buf); in encodeBerValue()
82 componentTag.writeTagAndLength(buf, obj.isConstructed(), obj.getBerValueLength()); in encodeBerValue()
83 obj.encodeBerValue(buf); in encodeBerValue()
85 componentTag.writeTagAndLength(buf, true, obj.getBerLength()); in encodeBerValue()
86 obj.encodeBer(buf); in encodeBerValue()
98 public void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
101 while (buf.hasRemaining()) { in decodeBerValue()
102 int bufStartPos = buf.position(); in decodeBerValue()
103 int bufEndPos = buf.limit(); in decodeBerValue()
[all …]
DAsn1SequenceOf.java76 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
78 component.encodeBer(buf); in encodeBerValue()
82 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
83 while (buf.hasRemaining()) { in decodeBerValue()
84 Asn1Tag tag = Asn1Tag.readTag(buf); in decodeBerValue()
85 int valueLength = Asn1Tag.readLength(buf); in decodeBerValue()
91 checkTag(value.getDefaultTag(), Asn1Tag.readTag(buf)); in decodeBerValue()
92 valueLength = Asn1Tag.readLength(buf); in decodeBerValue()
97 ByteBuffer subBuf = ByteBuffer.wrap(buf.array(), buf.position(), valueLength); in decodeBerValue()
102 buf.position(buf.position() + valueLength); in decodeBerValue()
DAsn1Boolean.java46 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
47 buf.put(value ? (byte) 0xFF : (byte) 0x00); in encodeBerValue()
50 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
51 if (buf.remaining() != 1) { in decodeBerValue()
52 throw new IllegalArgumentException("Invalid remaining bytes: " + buf.remaining()); in decodeBerValue()
54 value = (buf.get() != 0); in decodeBerValue()
DAsn1Null.java44 @Override void encodeBerValue(ByteBuffer buf) { in encodeBerValue() argument
47 @Override void decodeBerValue(ByteBuffer buf) { in decodeBerValue() argument
48 if (buf.remaining() != 0) { in decodeBerValue()
49 throw new IllegalArgumentException("Invalid remaining bytes: " + buf.remaining()); in decodeBerValue()
/cts/tests/tests/content/src/android/content/res/cts/
DAssetFileDescriptor_AutoCloseInputStreamTest.java90 byte[] buf = new byte[FILE_LENGTH]; in testReadBufferLen()
91 assertEquals(3, mInput.read(buf, 0, 3)); in testReadBufferLen()
92 assertEquals(3, mInput.read(buf, 3, 3)); in testReadBufferLen()
93 assertEquals(3, mInput.read(buf, 6, 4)); in testReadBufferLen()
94 MoreAsserts.assertEquals(FILE_DATA, buf); in testReadBufferLen()
95 assertEquals(FILE_END, mInput.read(buf, 0, 4)); in testReadBufferLen()
100 byte[] buf = new byte[6]; in testReadBuffer()
101 assertEquals(6, mInput.read(buf)); in testReadBuffer()
102 assertEquals(FILE_DATA[0], buf[0]); in testReadBuffer()
103 assertEquals(3, mInput.read(buf)); in testReadBuffer()
[all …]
/cts/tests/tests/media/libmediandkjni/
Dmd5_utils.cpp28 byteSwap(UWORD32 *buf, unsigned words) { in byteSwap() argument
37 p = (md5byte *)buf; in byteSwap()
40 *buf++ = (UWORD32)((unsigned)p[3] << 8 | p[2]) << 16 | in byteSwap()
52 ctx->buf[0] = 0x67452301; in MD5Init()
53 ctx->buf[1] = 0xefcdab89; in MD5Init()
54 ctx->buf[2] = 0x98badcfe; in MD5Init()
55 ctx->buf[3] = 0x10325476; in MD5Init()
66 MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len) { in MD5Update() argument
79 memcpy((md5byte *)ctx->in + 64 - t, buf, len); in MD5Update()
84 memcpy((md5byte *)ctx->in + 64 - t, buf, t); in MD5Update()
[all …]
Dmd5_utils.h35 UWORD32 buf[4]; member
41 void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len);
43 void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]);
/cts/tests/tests/secure_element/sample_applet/src/com/android/cts/omapi/test/
DCtsAndroidOmapiTestApplet.java102 byte[] buf = apdu.getBuffer(); in process()
105 byte p1 = buf[ISO7816.OFFSET_P1]; in process()
106 byte p2 = buf[ISO7816.OFFSET_P2]; in process()
109 lc = buf[ISO7816.OFFSET_LC]; in process()
110 if (buf[(short)(lc + ISO7816.OFFSET_CDATA - 1)] == 0x31) { in process()
118 Util.arrayCopy(respBuf, (short)0, buf, (short)0, (short)respBuf.length); in process()
119 apdu.sendBytesLong(buf, respBuffOffset, sendLen); in process()
123 switch (buf[ISO7816.OFFSET_INS]) { in process()
134 Util.arrayCopy(respBuf, (short)0, buf, (short)0, (short)respBuf.length); in process()
135 apdu.sendBytesLong(buf, respBuffOffset, sendLen); in process()
[all …]
/cts/tests/tests/net/native/dns/
DNativeDnsAsyncTest.cpp37 int getAsyncResponse(int fd, int timeoutMs, int* rcode, uint8_t* buf, size_t bufLen) { in getAsyncResponse() argument
46 int n = android_res_nresult(fd, rcode, buf, bufLen); in getAsyncResponse()
57 std::vector<std::string> extractIpAddressAnswers(uint8_t* buf, size_t bufLen, int ipType) { in extractIpAddressAnswers() argument
59 if (ns_initparse((const uint8_t*) buf, bufLen, &handle) < 0) { in extractIpAddressAnswers()
80 uint8_t buf[MAXPACKET] = {}; in expectAnswersValid() local
81 int res = getAsyncResponse(fd, TIMEOUT_MS, &rcode, buf, MAXPACKET); in expectAnswersValid()
86 auto answers = extractIpAddressAnswers(buf, res, ipType); in expectAnswersValid()
97 uint8_t buf[MAXPACKET] = {}; in expectAnswersNotValid() local
98 int res = getAsyncResponse(fd, TIMEOUT_MS, &rcode, buf, MAXPACKET); in expectAnswersNotValid()
166 uint8_t buf[MAXPACKET] = {}; in TEST() local
[all …]
/cts/tests/tests/security/jni/
Dandroid_security_cts_EncryptionTest.cpp49 uint8_t *buf; in android_security_cts_EncryptionTest_aesIsFast() local
64 buf = new (std::nothrow) uint8_t[TEST_BUFSIZE + in android_security_cts_EncryptionTest_aesIsFast()
67 if (!buf) { in android_security_cts_EncryptionTest_aesIsFast()
73 memset(buf, 0xF0, TEST_BUFSIZE); in android_security_cts_EncryptionTest_aesIsFast()
79 EVP_DecryptUpdate(&ctx, buf, &len, buf, TEST_BUFSIZE); in android_security_cts_EncryptionTest_aesIsFast()
84 delete[] buf; in android_security_cts_EncryptionTest_aesIsFast()
/cts/apps/VpnApp/src/com/android/cts/vpnfirewall/
DPingReflector.java63 private void processPacket(byte[] buf, int version, int len, int hdrLen) throws IOException { in processPacket() argument
67 DataInputStream stream = new DataInputStream(new ByteArrayInputStream(buf)); in processPacket()
90 private void writePacket(byte[] buf) { in writePacket() argument
92 Os.write(mFd, buf, 0, buf.length); in writePacket()
98 private int readPacket(byte[] buf) { in readPacket() argument
100 return Os.read(mFd, buf, 0, buf.length); in readPacket()
/cts/common/device-side/util/src/com/android/compatibility/common/util/
DBroadcastUtils.java40 StringBuilder buf = new StringBuilder(); in toBundleString() local
42 buf.append("extras: "); in toBundleString()
44 buf.append("(" + s + " = " + bundle.get(s) + "), "); in toBundleString()
47 return buf.toString(); in toBundleString()
/cts/common/device-side/util-axt/src/com/android/compatibility/common/util/
DBroadcastUtils.java40 StringBuilder buf = new StringBuilder(); in toBundleString() local
42 buf.append("extras: "); in toBundleString()
44 buf.append("(" + s + " = " + bundle.get(s) + "), "); in toBundleString()
47 return buf.toString(); in toBundleString()
/cts/tests/tests/keystore/src/android/keystore/cts/
DHexEncoding.java56 public static String encode(ByteBuffer buf) { in encode() argument
57 return encode(buf.array(), buf.arrayOffset() + buf.position(), buf.remaining()); in encode()
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2017-13273/
Dpoc.c39 char buf[256]; in thread_entry() local
41 memset(buf, 0x0, 256); in thread_entry()
52 len = sprintf(buf, "d %lu", (unsigned long)0); in thread_entry()
55 len = sprintf(buf, "t %d", sock_fd); in thread_entry()
59 ret = write(ctrl_fd, buf, len); in thread_entry()
/cts/tests/tests/graphics/src/android/graphics/fonts/
DNativeSystemFontHelper.java32 char[] buf = new char[4]; in tagToStr() local
33 buf[0] = (char) ((tag >> 24) & 0xFF); in tagToStr()
34 buf[1] = (char) ((tag >> 16) & 0xFF); in tagToStr()
35 buf[2] = (char) ((tag >> 8) & 0xFF); in tagToStr()
36 buf[3] = (char) (tag & 0xFF); in tagToStr()
37 return String.valueOf(buf); in tagToStr()
/cts/hostsidetests/cpptools/test-apps/ConnectorNativeProgram/
Dconnector.cpp57 char buf[kBufferSize]; in main() local
58 memset(buf, 0, kBufferSize); in main()
59 ssize_t result = TEMP_FAILURE_RETRY(read(fd, buf, kBufferSize - 1)); in main()
61 printf("%s\n", buf); in main()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/
DBleCocServerService.java271 private void sendMessage(byte[] buf) { in sendMessage() argument
272 mChatService.write(buf); in sendMessage()
278 final byte[] buf = new byte[]{1,2,3,4,5,6,7,8}; in sendData8bytes()
281 sendMessage(buf); in sendData8bytes()
288 byte[] buf = new byte[len]; in sendDataLargeBuf()
290 buf[i] = (byte)(i + 1); in sendDataLargeBuf()
294 sendMessage(buf); in sendDataLargeBuf()
498 byte[] buf = characteristic.getValue();
499 if (buf != null) {
500 int len = Math.min((buf.length - offset), mMtuSize);
[all …]
/cts/tests/tests/opengl/libopengltest/
Dcolor_one.cpp58 char* buf = (char*) malloc(bufLength); in initColorOne() local
59 if (buf) { in initColorOne()
60 glGetProgramInfoLog(gProgram, bufLength, NULL, buf); in initColorOne()
61 LOGE("Could not link program:\n%s\n", buf); in initColorOne()
62 free(buf); in initColorOne()

12345