Lines Matching full:record

36 			     struct ndef_record *record)
42 record->type_length = *pos++;
46 record->payload_length = *pos++;
55 record->payload_length = len;
62 record->id_length = *pos++;
64 record->id_length = 0;
66 if (record->type_length > data + size - pos)
68 record->type = record->type_length == 0 ? NULL : pos;
69 pos += record->type_length;
71 if (record->id_length > data + size - pos)
73 record->id = record->id_length == 0 ? NULL : pos;
74 pos += record->id_length;
76 if (record->payload_length > (size_t) (data + size - pos))
78 record->payload = record->payload_length == 0 ? NULL : pos;
79 pos += record->payload_length;
81 record->total_length = pos - data;
82 if (record->total_length > size ||
83 record->total_length < record->payload_length)
92 struct ndef_record record;
97 if (ndef_parse_record(data, len, &record) < 0) {
101 if (filter == NULL || filter(&record))
102 return wpabuf_alloc_copy(record.payload,
103 record.payload_length);
104 data += record.total_length;
105 len -= record.total_length;
107 wpa_printf(MSG_ERROR, "NDEF : Record not found");
117 struct wpabuf *record;
131 record = wpabuf_alloc(total_len);
132 if (record == NULL) {
134 "record for build");
143 wpabuf_put_u8(record, local_flag);
145 wpabuf_put_u8(record, type_length);
148 wpabuf_put_u8(record, payload_length);
150 wpabuf_put_be32(record, payload_length);
153 wpabuf_put_u8(record, id_length);
154 wpabuf_put_data(record, type, type_length);
155 wpabuf_put_data(record, id, id_length);
156 wpabuf_put_buf(record, payload);
157 return record;
161 static int wifi_filter(struct ndef_record *record)
163 if (record->type == NULL ||
164 record->type_length != os_strlen(wifi_handover_type))
166 if (os_memcmp(record->type, wifi_handover_type,
187 static int p2p_filter(struct ndef_record *record)
189 if (record->type == NULL ||
190 record->type_length != os_strlen(p2p_handover_type))
192 if (os_memcmp(record->type, p2p_handover_type,