Lines Matching refs:hdr
36 #define GET_CONTAINER(m, i) ((i) < (m)->n_containers ? (struct rtattr*)((uint8_t*)(m)->hdr + (m)->containers[i].offset) : NULL)
37 #define PUSH_CONTAINER(m, new) (m)->container_offsets[(m)->n_containers ++] = (uint8_t*)(new) - (uint8_t*)(m)->hdr;
85 m->hdr = malloc0(size);
86 if (!m->hdr)
89 m->hdr->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
92 m->hdr->nlmsg_len = size;
93 m->hdr->nlmsg_type = type;
103 assert_return(m->hdr, -EINVAL);
104 assert_return(m->hdr->nlmsg_type == RTM_GETLINK ||
105 m->hdr->nlmsg_type == RTM_GETADDR ||
106 m->hdr->nlmsg_type == RTM_GETROUTE ||
107 m->hdr->nlmsg_type == RTM_GETNEIGH,
111 m->hdr->nlmsg_flags |= NLM_F_DUMP;
113 m->hdr->nlmsg_flags &= ~NLM_F_DUMP;
129 free(m->hdr);
146 *type = m->hdr->nlmsg_type;
155 m->hdr->nlmsg_flags = flags;
178 assert(m->hdr);
180 assert(NLMSG_ALIGN(m->hdr->nlmsg_len) == m->hdr->nlmsg_len);
184 offset = m->hdr->nlmsg_len;
193 new_hdr = realloc(m->hdr, message_length);
196 m->hdr = new_hdr;
199 rta = (struct rtattr *) ((uint8_t *) m->hdr + offset);
220 padding_length = (uint8_t*)m->hdr + message_length - (uint8_t*)padding;
224 m->hdr->nlmsg_len = message_length;
534 rta = (struct rtattr*)((uint8_t *) m->hdr + attribute->offset);
754 attributes[type].offset = (uint8_t *) rta - (uint8_t *) m->hdr;
877 assert(m->hdr);
879 return m->hdr->nlmsg_seq;
884 assert_return(m->hdr, 0);
886 return m->hdr->nlmsg_type == NLMSG_ERROR;
893 assert_return(m->hdr, -EINVAL);
898 err = NLMSG_DATA(m->hdr);
925 assert(m->hdr);
927 r = type_system_get_type(&type_system_root, &nl_type, m->hdr->nlmsg_type);
944 (struct rtattr*)((uint8_t*)NLMSG_DATA(m->hdr) + NLMSG_ALIGN(size)),
945 NLMSG_PAYLOAD(m->hdr, size));