Lines Matching defs:record
35 struct ndef_record *record)
41 record->type_length = *pos++;
45 record->payload_length = *pos++;
49 record->payload_length = ntohl(*(u32 *)pos);
56 record->id_length = *pos++;
58 record->id_length = 0;
60 record->type = record->type_length == 0 ? NULL : pos;
61 pos += record->type_length;
63 record->id = record->id_length == 0 ? NULL : pos;
64 pos += record->id_length;
66 record->payload = record->payload_length == 0 ? NULL : pos;
67 pos += record->payload_length;
69 record->total_length = pos - data;
70 if (record->total_length > size)
79 struct ndef_record record;
84 if (ndef_parse_record(data, len, &record) < 0) {
88 if (filter == NULL || filter(&record))
89 return wpabuf_alloc_copy(record.payload,
90 record.payload_length);
91 data += record.total_length;
92 len -= record.total_length;
104 struct wpabuf *record;
118 record = wpabuf_alloc(total_len);
119 if (record == NULL) {
121 "record for build");
130 wpabuf_put_u8(record, local_flag);
132 wpabuf_put_u8(record, type_length);
135 wpabuf_put_u8(record, payload_length);
137 wpabuf_put_be32(record, payload_length);
140 wpabuf_put_u8(record, id_length);
141 wpabuf_put_data(record, type, type_length);
142 wpabuf_put_data(record, id, id_length);
143 wpabuf_put_buf(record, payload);
144 return record;
148 static int wifi_filter(struct ndef_record *record)
150 if (record->type_length != os_strlen(wifi_handover_type))
152 if (os_memcmp(record->type, wifi_handover_type,