Lines Matching refs:record

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