Home
last modified time | relevance | path

Searched refs:length (Results 1 – 25 of 338) sorted by relevance

12345678910>>...14

/system/connectivity/dhcp_client/
Ddhcp_options_writer_unittest.cc55 int length = options_writer_->WriteUInt8Option(&option, in TEST_F() local
58 EXPECT_NE(-1, length); in TEST_F()
61 length)); in TEST_F()
74 int length = options_writer_->WriteUInt16Option(&option, in TEST_F() local
77 EXPECT_NE(-1, length); in TEST_F()
80 length)); in TEST_F()
93 int length = options_writer_->WriteUInt32Option(&option, in TEST_F() local
96 EXPECT_NE(-1, length); in TEST_F()
99 length)); in TEST_F()
112 int length = options_writer_->WriteUInt8ListOption(&option, in TEST_F() local
[all …]
Ddhcp_options_parser.cc34 uint8_t length, in GetOption() argument
36 if (length != sizeof(uint8_t)) { in GetOption()
46 uint8_t length, in GetOption() argument
48 if (length != sizeof(uint16_t)) { in GetOption()
58 uint8_t length, in GetOption() argument
60 if (length != sizeof(uint32_t)) { in GetOption()
70 uint8_t length, in GetOption() argument
72 if (length == 0) { in GetOption()
78 for (int i = 0; i < length; i++) { in GetOption()
87 uint8_t length, in GetOption() argument
[all …]
Ddhcp_options_writer.cc45 uint8_t length = sizeof(uint8_t); in WriteUInt8Option() local
48 buffer->Append(ByteString(reinterpret_cast<const char*>(&length), in WriteUInt8Option()
52 return length + 2; in WriteUInt8Option()
58 uint8_t length = sizeof(uint16_t); in WriteUInt16Option() local
62 buffer->Append(ByteString(reinterpret_cast<const char*>(&length), in WriteUInt16Option()
66 return length + 2; in WriteUInt16Option()
72 uint8_t length = sizeof(uint32_t); in WriteUInt32Option() local
76 buffer->Append(ByteString(reinterpret_cast<const char*>(&length), in WriteUInt32Option()
80 return length + 2; in WriteUInt32Option()
91 uint8_t length = value.size() * sizeof(uint8_t); in WriteUInt8ListOption() local
[all …]
Ddhcp_options_parser.h27 uint8_t length,
36 uint8_t length,
44 uint8_t length,
52 uint8_t length,
60 uint8_t length,
68 uint8_t length,
76 uint8_t length,
84 uint8_t length,
92 uint8_t length,
100 uint8_t length,
[all …]
/system/gatekeeper/
Dgatekeeper_messages.cpp36 return sizeof(buf.length) + buf.length; in serialized_buffer_size()
40 memcpy(*buffer, &to_append->length, sizeof(to_append->length)); in append_to_buffer()
41 *buffer += sizeof(to_append->length); in append_to_buffer()
42 if (to_append->length != 0) { in append_to_buffer()
43 memcpy(*buffer, to_append->buffer.get(), to_append->length); in append_to_buffer()
44 *buffer += to_append->length; in append_to_buffer()
50 if (*buffer + sizeof(target->length) > end) return ERROR_INVALID; in read_from_buffer()
52 memcpy(&target->length, *buffer, sizeof(target->length)); in read_from_buffer()
53 *buffer += sizeof(target->length); in read_from_buffer()
54 if (target->length != 0) { in read_from_buffer()
[all …]
/system/bt/osi/src/
Dringbuffer.c59 size_t ringbuffer_insert(ringbuffer_t *rb, const uint8_t *p, size_t length) { in ringbuffer_insert() argument
63 if (length > ringbuffer_available(rb)) in ringbuffer_insert()
64 length = ringbuffer_available(rb); in ringbuffer_insert()
66 for (size_t i = 0; i != length; ++i) { in ringbuffer_insert()
72 rb->available -= length; in ringbuffer_insert()
73 return length; in ringbuffer_insert()
76 size_t ringbuffer_delete(ringbuffer_t *rb, size_t length) { in ringbuffer_delete() argument
79 if (length > ringbuffer_size(rb)) in ringbuffer_delete()
80 length = ringbuffer_size(rb); in ringbuffer_delete()
82 rb->head += length; in ringbuffer_delete()
[all …]
Dbuffer.c32 size_t length; member
43 buffer->length = size; in buffer_new()
50 return buffer_new_slice(buf, buf->length); in buffer_new_ref()
56 assert(slice_size <= buf->length); in buffer_new_slice()
62 ret->length = slice_size; in buffer_new_slice()
86 return buf->root->data + buf->root->length - buf->length; in buffer_ptr()
91 return buf->length; in buffer_length()
/system/extras/verity/
DBootSignature.java70 private ASN1Integer length; field in BootSignature
81 public BootSignature(String target, int length) { in BootSignature() argument
84 this.length = new ASN1Integer(length); in BootSignature()
115 length = (ASN1Integer) attrs.getObjectAt(1); in BootSignature()
123 attrs.add(length); in getAuthenticatedAttributes()
157 byte[] signable = Arrays.copyOf(image, image.length + attrs.length); in generateSignableImage()
158 for (int i=0; i < attrs.length; i++) { in generateSignableImage()
159 signable[i+image.length] = attrs[i]; in generateSignableImage()
170 if (length.getValue().intValue() != image.length) { in verify()
207 int length = pageSize // include the page aligned image header in getSignableImageSize() local
[all …]
Dverify_boot_signature.c45 ASN1_INTEGER *length; member
50 ASN1_SIMPLE(AuthAttrs, length, ASN1_INTEGER)
164 static int validate_signature_block(const BootSignature *bs, uint64_t length) in validate_signature_block() argument
195 length = htobe64(length); in validate_signature_block()
196 BN_bin2bn((const unsigned char *) &length, sizeof(length), &expected); in validate_signature_block()
198 ASN1_INTEGER_to_BN(bs->authenticatedAttributes->length, &value); in validate_signature_block()
222 static int hash_image(int fd, uint64_t length, const AuthAttrs *aa, in hash_image() argument
256 if ((length - total) < BUFFER_SIZE) { in hash_image()
257 bytes = length - total; in hash_image()
267 } while (total < length); in hash_image()
[all …]
/system/tools/aidl/tests/java_app/src/android/aidl/tests/
DTestServiceClient.java161 for (int i = 0; i < query.length; i++) { in checkPrimitiveRepeat()
197 " of length " + query.length() + in checkPrimitiveRepeat()
199 " of length " + response.length()); in checkPrimitiveRepeat()
233 boolean echoed[] = new boolean[input.length]; in checkArrayReversal()
238 if (input.length != reversed.length) { in checkArrayReversal()
241 for (int i = 0; i < input.length; ++i) { in checkArrayReversal()
242 int j = reversed.length - (1 + i); in checkArrayReversal()
252 byte echoed[] = new byte[input.length]; in checkArrayReversal()
257 if (input.length != reversed.length) { in checkArrayReversal()
260 for (int i = 0; i < input.length; ++i) { in checkArrayReversal()
[all …]
/system/core/fastboot/
Dsocket.cpp51 ssize_t Socket::ReceiveAll(void* data, size_t length, int timeout_ms) { in ReceiveAll() argument
54 while (total < length) { in ReceiveAll()
55 ssize_t bytes = Receive(reinterpret_cast<char*>(data) + total, length - total, timeout_ms); in ReceiveAll()
114 bool Send(const void* data, size_t length) override;
116 ssize_t Receive(void* data, size_t length, int timeout_ms) override;
135 bool UdpSocket::Send(const void* data, size_t length) { in Send() argument
136 return TEMP_FAILURE_RETRY(sendto(sock_, reinterpret_cast<const char*>(data), length, 0, in Send()
138 static_cast<ssize_t>(length); in Send()
144 total_length += buffer.length; in Send()
151 ssize_t UdpSocket::Receive(void* data, size_t length, int timeout_ms) { in Receive() argument
[all …]
Dtcp.cpp50 static void EncodeMessageLength(uint64_t length, void* buffer) { in EncodeMessageLength() argument
52 reinterpret_cast<uint8_t*>(buffer)[i] = length >> (56 - i * 8); in EncodeMessageLength()
64 ssize_t Read(void* data, size_t length) override;
65 ssize_t Write(const void* data, size_t length) override;
127 ssize_t TcpTransport::Read(void* data, size_t length) { in Read() argument
143 if (length > message_bytes_left_) { in Read()
144 length = message_bytes_left_; in Read()
146 ssize_t bytes_read = socket_->ReceiveAll(data, length, 0); in Read()
155 ssize_t TcpTransport::Write(const void* data, size_t length) { in Write() argument
162 EncodeMessageLength(length, header); in Write()
[all …]
Dsocket_mock.cpp41 bool SocketMock::Send(const void* data, size_t length) { in Send() argument
52 std::string message(reinterpret_cast<const char*>(data), length); in Send()
68 data.append(reinterpret_cast<const char*>(buffer.data), buffer.length); in Send()
73 ssize_t SocketMock::Receive(void* data, size_t length, int /*timeout_ms*/) { in Receive() argument
86 if (message.length() > length) { in Receive()
87 ADD_FAILURE() << "Receive(): not enough bytes (" << length << ") for " << message; in Receive()
92 ssize_t return_value = message.length(); in Receive()
98 memcpy(data, message.data(), message.length()); in Receive()
/system/update_engine/common/
Dhash_calculator.cc38 bool HashCalculator::Update(const void* data, size_t length) { in Update() argument
43 TEST_AND_RETURN_FALSE(SHA256_Update(&ctx_, data, length) == 1); in Update()
47 off_t HashCalculator::UpdateFile(const string& name, off_t length) { in UpdateFile() argument
56 while (length < 0 || bytes_processed < length) { in UpdateFile()
58 if (length >= 0 && bytes_to_read > length - bytes_processed) { in UpdateFile()
59 bytes_to_read = length - bytes_processed; in UpdateFile()
90 size_t length, in RawHashOfBytes() argument
93 TEST_AND_RETURN_FALSE(calc.Update(data, length)); in RawHashOfBytes()
104 off_t HashCalculator::RawHashOfFile(const string& name, off_t length, in RawHashOfFile() argument
107 off_t res = calc.UpdateFile(name, length); in RawHashOfFile()
[all …]
/system/core/toolbox/
Dioctl.c68 int length = -1; in ioctl_main() local
87 length = xstrtoi(optarg, "length"); in ioctl_main()
129 length = 4; in ioctl_main()
132 if(length < 0) { in ioctl_main()
133 length = (argc - optind) * arg_size; in ioctl_main()
135 if(length) { in ioctl_main()
136 ioctl_args = calloc(1, length); in ioctl_main()
139 rem = length; in ioctl_main()
152 rem = length; in ioctl_main()
161 else if(length) in ioctl_main()
[all …]
/system/gatekeeper/tests/
Dgatekeeper_messages_test.cpp37 result->length = size; in make_buffer()
56 msg.Serialize(serialized_msg.buffer.get(), serialized_msg.buffer.get() + serialized_msg.length); in TEST()
60 + serialized_msg.length); in TEST()
67 ASSERT_EQ((uint32_t) password_size, deserialized_password->length); in TEST()
69 ASSERT_EQ((uint32_t) 0, deserialized_msg.enrolled_password.length); in TEST()
71 ASSERT_EQ((uint32_t) 0, deserialized_msg.password_handle.length); in TEST()
85 msg.Serialize(serialized_msg.buffer.get(), serialized_msg.buffer.get() + serialized_msg.length); in TEST()
89 + serialized_msg.length); in TEST()
96 ASSERT_EQ((uint32_t) password_size, deserialized_password->length); in TEST()
98 ASSERT_EQ((uint32_t) 0, deserialized_msg.enrolled_password.length); in TEST()
[all …]
/system/connectivity/shill/net/
Dbyte_string.h37 explicit ByteString(size_t length) : data_(length) {} in ByteString() argument
39 ByteString(const unsigned char* data, size_t length) in ByteString() argument
40 : data_(data, data + length) {} in ByteString()
42 ByteString(const char* data, size_t length) in ByteString() argument
43 : data_(data, data + length) {} in ByteString()
45 ByteString(const signed char* data, size_t length) in ByteString() argument
46 : data_(data, data + length) {} in ByteString()
51 data.length() + in ByteString()
65 ByteString GetSubstring(size_t offset, size_t length) const;
/system/bt/btif/src/
Dbtif_debug_btsnoop.c45 static size_t btsnoop_calculate_packet_length(uint16_t type, const uint8_t *data, size_t length);
47 static void btsnoop_cb(const uint16_t type, const uint8_t *data, const size_t length) { in btsnoop_cb() argument
50 size_t included_length = btsnoop_calculate_packet_length(type, data, length); in btsnoop_cb()
58 ringbuffer_delete(buffer, header.length - 1); in btsnoop_cb()
66 header.length = included_length + 1; // +1 for type byte in btsnoop_cb()
67 header.packet_length = length + 1; // +1 for type byte. in btsnoop_cb()
75 static size_t btsnoop_calculate_packet_length(uint16_t type, const uint8_t *data, size_t length) { in btsnoop_calculate_packet_length() argument
90 return length; in btsnoop_calculate_packet_length()
93 return length; in btsnoop_calculate_packet_length()
100 if (length > len_hci_acl) { in btsnoop_calculate_packet_length()
[all …]
/system/bt/hci/src/
Dbtsnoop_mem.c38 size_t length = 0; in btsnoop_mem_capture() local
43 length = data[2] + 3; in btsnoop_mem_capture()
48 length = data[1] + 2; in btsnoop_mem_capture()
54 length = (data[2] | (data[3] << 8)) + 4; in btsnoop_mem_capture()
60 length = data[2] + 3; in btsnoop_mem_capture()
64 if (length) in btsnoop_mem_capture()
65 (*data_callback)(type, data, length); in btsnoop_mem_capture()
/system/bt/tools/scripts/
Dbtsnooz.py98 length, delta_time_ms, type = struct.unpack_from('=HIb', decompressed, offset)
99 offset += 7 + length - 1
105 length, delta_time_ms, type = struct.unpack_from('=HIb', decompressed, offset)
108 sys.stdout.write(struct.pack('>II', length, length))
112 sys.stdout.write(decompressed[offset : offset + length - 1])
113 offset += length - 1
125length, packet_length, delta_time_ms, snooz_type = struct.unpack_from('=HHIb', decompressed, offse…
126 offset += 9 + length - 1
132length, packet_length, delta_time_ms, snooz_type = struct.unpack_from('=HHIb', decompressed, offse…
135 sys.stdout.write(struct.pack('>II', packet_length, length))
[all …]
/system/bt/device/src/
Dinterop.c63 strlen(name) >= interop_name_database[i].length && in interop_match_name()
64 strncmp(name, interop_name_database[i].name, interop_name_database[i].length) == 0) { in interop_match_name()
72 void interop_database_add(const uint16_t feature, const bt_bdaddr_t *addr, size_t length) { in interop_database_add() argument
74 assert(length > 0); in interop_database_add()
75 assert(length < sizeof(bt_bdaddr_t)); in interop_database_add()
78 memcpy(&entry->addr, addr, length); in interop_database_add()
80 entry->length = length; in interop_database_add()
143 if (feature == entry->feature && memcmp(addr, &entry->addr, entry->length) == 0) in interop_match_dynamic_()
157 memcmp(addr, &interop_addr_database[i].addr, interop_addr_database[i].length) == 0) { in interop_match_fixed_()
/system/security/keystore/
Dblob.cpp42 mBlob.length = valueLength; in Blob()
106 size_t dataLength = mBlob.length + sizeof(mBlob.length); in writeBlob()
112 memmove(&mBlob.encrypted[encryptedLength], &mBlob.value[mBlob.length], mBlob.info); in writeBlob()
114 memset(mBlob.value + mBlob.length, 0, digestedLength - dataLength); in writeBlob()
116 mBlob.length = htonl(mBlob.length); in writeBlob()
203 ssize_t maxValueLength = digestedLength - sizeof(mBlob.length); in readBlob()
204 mBlob.length = ntohl(mBlob.length); in readBlob()
205 if (mBlob.length < 0 || mBlob.length > maxValueLength) { in readBlob()
210 memmove(&mBlob.value[mBlob.length], &mBlob.value[maxValueLength], mBlob.info); in readBlob()
/system/vold/
DProcess.cpp37 int length; in readSymLink() local
45 length = readlink(path, link, max- 1); in readSymLink()
46 if (length <= 0) in readSymLink()
48 link[length] = 0; in readSymLink()
53 int length = strlen(mountPoint); in pathMatchesMountPoint() local
54 if (length > 1 && strncmp(path, mountPoint, length) == 0) { in pathMatchesMountPoint()
56 if (mountPoint[length - 1] == '/') in pathMatchesMountPoint()
60 return (path[length] == 0 || path[length] == '/'); in pathMatchesMountPoint()
73 int length = read(fd, buffer, max - 1); in getProcessName() local
74 buffer[length] = 0; in getProcessName()
/system/extras/ksmutils/
Dlookup3.c176 size_t length, /* the length of the key, in uint32_ts */ in hashword() argument
182 a = b = c = 0xdeadbeef + (((uint32_t)length)<<2) + initval; in hashword()
185 while (length > 3) in hashword()
191 length -= 3; in hashword()
196 switch(length) /* all the case statements fall through */ in hashword()
220 size_t length, /* the length of the key, in uint32_ts */ in hashword2() argument
227 a = b = c = 0xdeadbeef + ((uint32_t)(length<<2)) + *pc; in hashword2()
231 while (length > 3) in hashword2()
237 length -= 3; in hashword2()
242 switch(length) /* all the case statements fall through */ in hashword2()
[all …]
/system/core/libcutils/
Duevent.c32 ssize_t uevent_kernel_multicast_recv(int socket, void *buffer, size_t length) in uevent_kernel_multicast_recv() argument
35 return uevent_kernel_multicast_uid_recv(socket, buffer, length, &uid); in uevent_kernel_multicast_recv()
47 ssize_t uevent_kernel_multicast_uid_recv(int socket, void *buffer, size_t length, uid_t *uid) in uevent_kernel_multicast_uid_recv() argument
49 return uevent_kernel_recv(socket, buffer, length, true, uid); in uevent_kernel_multicast_uid_recv()
52 ssize_t uevent_kernel_recv(int socket, void *buffer, size_t length, bool require_group, uid_t *uid) in uevent_kernel_recv() argument
54 struct iovec iov = { buffer, length }; in uevent_kernel_recv()
99 bzero(buffer, length); in uevent_kernel_recv()

12345678910>>...14