Searched refs:rtm (Results 1 - 25 of 48) sorted by relevance

12

/freebsd-head/tests/sys/net/routing/
H A Dtest_rtsock_l3.c156 prepare_route_message(struct rt_msghdr *rtm, int cmd, struct sockaddr *dst, argument
160 rtsock_prepare_route_message(rtm, cmd, dst, mask, gw);
163 rtm->rtm_flags |= RTF_STATIC;
167 verify_route_message(struct rt_msghdr *rtm, int cmd, struct sockaddr *dst, argument
174 RTSOCK_ATF_REQUIRE_MSG(rtm, rtm->rtm_type == cmd,
176 rtm->rtm_type, rtsock_print_cmdtype(rtm->rtm_type));
177 RTSOCK_ATF_REQUIRE_MSG(rtm, rtm
207 verify_route_message_extra(struct rt_msghdr *rtm, int ifindex, int rtm_flags) argument
227 verify_link_gateway(struct rt_msghdr *rtm, int ifindex) argument
[all...]
H A Dtest_rtsock_lladdr.c87 prepare_route_message(struct rt_msghdr *rtm, int cmd, struct sockaddr *dst, argument
91 rtsock_prepare_route_message(rtm, cmd, dst, NULL, gw);
93 rtm->rtm_flags |= (RTF_HOST | RTF_STATIC | RTF_LLDATA);
102 struct rt_msghdr *rtm = (struct rt_msghdr *)buffer; \
142 prepare_route_message(rtm, RTM_ADD, (struct sockaddr *)&sin6, (struct sockaddr *)&ether);
143 rtsock_send_rtm(c->rtsock_fd, rtm);
153 rtm = rtsock_read_rtm_reply(c->rtsock_fd, buffer, sizeof(buffer), rtm->rtm_seq);
155 sa = rtsock_find_rtm_sa(rtm, RTA_DST);
157 RTSOCK_ATF_REQUIRE_MSG(rtm, re
[all...]
H A Drtsock_print.h42 printf("-- CONDITION FAILED, rtm dump --\n\n");\
50 printf("-- CONDITION FAILED, rtm hexdump--\n\n");\
261 rtsock_print_rtm(struct rt_msghdr *rtm) argument
270 printf("Got message of size %hu on %s\n", rtm->rtm_msglen, buf);
273 rtsock_print_rtm_flags(flags_buf, sizeof(flags_buf), rtm->rtm_flags);
275 printf("%s: len %hu, pid: %d, seq %d, errno %d, flags: %s\n", msgtypes[rtm->rtm_type],
276 rtm->rtm_msglen, rtm->rtm_pid, rtm->rtm_seq, rtm
346 rtsock_print_message_hd(struct rt_msghdr *rtm) argument
365 rtsock_print_message(struct rt_msghdr *rtm) argument
[all...]
H A Drtsock_common.h72 void rtsock_update_rtm_len(struct rt_msghdr *rtm);
74 void rtsock_add_rtm_sa(struct rt_msghdr *rtm, int addr_type, struct sockaddr *sa);
656 rtsock_send_rtm(int fd, struct rt_msghdr *rtm) argument
661 rtsock_update_rtm_len(rtm);
663 len = write(fd, rtm, rtm->rtm_msglen);
665 RTSOCK_ATF_REQUIRE_MSG(rtm, len == rtm->rtm_msglen,
667 rtm->rtm_msglen, len, strerror(my_errno));
699 struct rt_msghdr *rtm; local
719 rtsock_prepare_route_message_base(struct rt_msghdr *rtm, int cmd) argument
729 rtsock_prepare_route_message(struct rt_msghdr *rtm, int cmd, struct sockaddr *dst, struct sockaddr *mask, struct sockaddr *gw) argument
747 rtsock_add_rtm_sa(struct rt_msghdr *rtm, int addr_type, struct sockaddr *sa) argument
762 rtsock_find_rtm_sa(struct rt_msghdr *rtm, int addr_type) argument
778 rtsock_calc_rtm_len(struct rt_msghdr *rtm) argument
796 rtsock_update_rtm_len(struct rt_msghdr *rtm) argument
841 struct rt_msghdr *rtm; local
868 rtsock_validate_pid_ours(struct rt_msghdr *rtm) argument
875 rtsock_validate_pid_user(struct rt_msghdr *rtm) argument
882 rtsock_validate_pid_kernel(struct rt_msghdr *rtm) argument
[all...]
/freebsd-head/usr.sbin/rtsold/
H A Drtsock.c99 struct rt_msghdr *rtm; local
104 offsetof(struct rt_msghdr, rtm_msglen) + sizeof(rtm->rtm_msglen);
110 rtm = (struct rt_msghdr *)(void *)next;
113 len = rtm->rtm_msglen;
119 "rtmsg type %d, len=%lu", rtm->rtm_type,
124 if (rtm->rtm_type != rtsock_dispatch[idx].type)
126 if (rtm->rtm_msglen < rtsock_dispatch[idx].minlen) {
128 "rtmsg type %d too short!", rtm->rtm_type);
132 ret = (*rtsock_dispatch[idx].func)(s, rtm, lim);
141 rtsock_input_ifannounce(int s __unused, struct rt_msghdr *rtm, cha argument
[all...]
/freebsd-head/libexec/bootpd/
H A Drtmsg.c125 struct rt_msghdr *rtm = &(m_rtmsg.m_rtm); local
149 sin = (struct sockaddr_in *)(rtm + 1);
153 !(rtm->rtm_flags & RTF_GATEWAY)) switch (sdl->sdl_type) {
184 struct rt_msghdr *rtm = &m_rtmsg.m_rtm; local
190 rtm->rtm_flags = flags;
191 rtm->rtm_version = RTM_VERSION;
199 rtm->rtm_addrs |= RTA_GATEWAY;
200 rtm->rtm_rmx.rmx_expire = expire_time;
201 rtm->rtm_inits = RTV_EXPIRE;
202 rtm
[all...]
/freebsd-head/lib/libc/net/
H A Dgetifmaddrs.c69 struct rt_msghdr *rtm; local
93 for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
94 rtm = (struct rt_msghdr *)(void *)next;
95 if (rtm->rtm_version != RTM_VERSION)
97 switch (rtm->rtm_type) {
99 ifmam = (struct ifma_msghdr *)(void *)rtm;
129 for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
130 rtm = (struct rt_msghdr *)(void *)next;
131 if (rtm->rtm_version != RTM_VERSION)
134 switch (rtm
[all...]
H A Dgetifaddrs.c92 struct rt_msghdr *rtm; local
137 for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
138 rtm = (struct rt_msghdr *)(void *)next;
139 if (rtm->rtm_version != RTM_VERSION)
141 switch (rtm->rtm_type) {
143 ifm = (struct if_msghdrl *)(void *)rtm;
158 ifam = (struct ifa_msghdrl *)(void *)rtm;
220 for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
221 rtm = (struct rt_msghdr *)(void *)next;
222 if (rtm
[all...]
/freebsd-head/usr.sbin/arp/
H A Darp.c85 struct rt_msghdr *rtm);
322 struct rt_msghdr *rtm; local
407 rtm = rtmsg(RTM_GET, dst, NULL);
408 if (rtm == NULL) {
412 addr = (struct sockaddr_in *)(rtm + 1);
416 (rtm->rtm_flags & RTF_GATEWAY) ||
467 struct rt_msghdr *rtm; local
480 rtm = rtmsg(RTM_GET, dst, NULL);
481 if (rtm == NULL) {
485 addr = (struct sockaddr_in *)(rtm
532 struct rt_msghdr *rtm; local
588 print_entry(struct sockaddr_dl *sdl, struct sockaddr_in *addr, struct rt_msghdr *rtm) argument
688 nuke_entry(struct sockaddr_dl *sdl __unused, struct sockaddr_in *addr, struct rt_msghdr *rtm) argument
729 struct rt_msghdr *rtm = &m_rtmsg.m_rtm; local
[all...]
/freebsd-head/contrib/netbsd-tests/net/if_loop/
H A Dt_pr.c66 #define rtm m_rtmsg.m_rtm macro
93 rtm.rtm_type = RTM_CHANGE;
94 rtm.rtm_flags = RTF_STATIC;
95 rtm.rtm_version = RTM_VERSION;
96 rtm.rtm_seq = 3;
97 rtm.rtm_inits = RTV_MTU;
98 rtm.rtm_addrs = RTA_DST;
99 rtm.rtm_rmx.rmx_mtu = 100;
100 rtm.rtm_msglen = sizeof(m_rtmsg);
/freebsd-head/usr.bin/netstat/
H A Dnhgrp.c119 print_nhgroup_entry_sysctl(const char *name, struct rt_msghdr *rtm, argument
201 struct rt_msghdr *rtm; local
229 for (next = buf; next < lim; next += rtm->rtm_msglen) {
230 rtm = (struct rt_msghdr *)next;
231 if (rtm->rtm_version != RTM_VERSION)
239 nhg = (struct nhgrp_external *)(rtm + 1);
241 nhg_map[nhg_count].rtm = rtm;
257 struct rt_msghdr *rtm; local
272 rtm
316 struct rt_msghdr *rtm; local
[all...]
H A Dnhops.c242 print_nhop_entry_sysctl(const char *name, struct rt_msghdr *rtm, struct nhop_external *nh) argument
290 print_flags_generic(rtm->rtm_flags, rt_bits, buffer, "rt_flags_pretty");
344 struct rt_msghdr *rtm; local
372 for (next = buf; next < lim; next += rtm->rtm_msglen) {
373 rtm = (struct rt_msghdr *)next;
374 if (rtm->rtm_version != RTM_VERSION)
382 nh = (struct nhop_external *)(rtm + 1);
384 nh_map[nh_count].rtm = rtm;
401 struct rt_msghdr *rtm; local
[all...]
H A Droute.c242 struct rt_msghdr *rtm; local
266 for (next = buf; next < lim; next += rtm->rtm_msglen) {
267 rtm = (struct rt_msghdr *)next;
268 if (rtm->rtm_version != RTM_VERSION)
273 sa = (struct sockaddr *)(rtm + 1);
296 p_rtentry_sysctl("rt-entry", rtm);
308 p_rtentry_sysctl(const char *name, struct rt_msghdr *rtm) argument
316 sa = (struct sockaddr *)(rtm + 1);
318 if (rtm->rtm_addrs & (1 << i)) {
326 rtm
[all...]
H A Dcommon.h60 struct rt_msghdr *rtm; member in struct:nhops_map
/freebsd-head/sbin/route/
H A Droute.c446 struct rt_msghdr *rtm; local
483 for (next = buf; next < lim; next += rtm->rtm_msglen) {
484 rtm = (struct rt_msghdr *)(void *)next;
486 print_rtmsg(rtm, rtm->rtm_msglen);
487 if ((rtm->rtm_flags & RTF_GATEWAY) == 0)
490 struct sockaddr *sa = (struct sockaddr *)(rtm + 1);
497 rtm->rtm_type = RTM_DELETE;
498 rtm->rtm_seq = seqno;
499 rlen = write(s, next, rtm
1418 struct rt_msghdr *rtm; local
1530 #define rtm macro
1584 #undef rtm macro
1629 print_rtmsg(struct rt_msghdr *rtm, size_t msglen) argument
1732 print_getmsg(struct rt_msghdr *rtm, int msglen, int fib) argument
1812 pmsg_common(struct rt_msghdr *rtm, size_t msglen) argument
[all...]
/freebsd-head/usr.sbin/rtadvd/
H A Dif.c169 struct rt_msghdr *rtm; local
174 for (rtm = (struct rt_msghdr *)buf;
175 rtm < (struct rt_msghdr *)lim;
176 rtm = (struct rt_msghdr *)(((char *)rtm) + rtm->rtm_msglen)) {
178 if (!rtm->rtm_msglen) {
180 "(buf=%p lim=%p rtm=%p)", __func__,
181 buf, lim, rtm);
187 "(buf=%p lim=%p rtm
263 struct rt_msghdr *rtm = (struct rt_msghdr *)buf; local
275 struct rt_msghdr *rtm = (struct rt_msghdr *)buf; local
287 struct rt_msghdr *rtm = (struct rt_msghdr *)buf; local
[all...]
/freebsd-head/usr.sbin/ndp/
H A Dndp.c115 if (rtm->rtm_addrs & (w)) { \
389 register struct rt_msghdr *rtm = &(m_rtmsg.m_rtm); local
430 sin = (struct sockaddr_in6 *)(rtm + 1);
434 !(rtm->rtm_flags & RTF_GATEWAY)) {
495 register struct rt_msghdr *rtm = &m_rtmsg.m_rtm; local
519 sin = (struct sockaddr_in6 *)(rtm + 1);
523 !(rtm->rtm_flags & RTF_GATEWAY)) {
540 rtm->rtm_flags |= RTF_LLDATA;
565 struct rt_msghdr *rtm; local
604 for (next = buf; next && next < lim; next += rtm
841 register struct rt_msghdr *rtm = &m_rtmsg.m_rtm; local
[all...]
/freebsd-head/contrib/bsnmp/snmp_mibII/
H A DmibII_route.c94 mib_sroute_process(struct rt_msghdr *rtm, struct sockaddr *gw, argument
111 if (rtm->rtm_flags & RTF_HOST)
140 if (rtm->rtm_type == RTM_DELETE) {
171 if ((ifp = mib_find_if_sys(rtm->rtm_index)) == NULL) {
172 if (rtm->rtm_type == RTM_ADD) {
174 mib_send_rtmsg(rtm, gw, dst, mask);
188 r->type = (rtm->rtm_flags & RTF_REJECT) ? 2 : 4;
191 r->proto = (rtm->rtm_flags & RTF_LOCAL) ? 2 :
192 (rtm->rtm_flags & RTF_STATIC) ? 3 :
193 (rtm
231 struct rt_msghdr *rtm; local
[all...]
H A DmibII.c1005 process_arp(const struct rt_msghdr *rtm, const struct sockaddr_dl *sdl, argument
1022 if (rtm->rtm_rmx.rmx_expire == 0)
1033 handle_rtmsg(struct rt_msghdr *rtm) argument
1049 if (rtm->rtm_version != RTM_VERSION) {
1050 syslog(LOG_ERR, "Bogus RTM version %u", rtm->rtm_version);
1054 switch (rtm->rtm_type) {
1057 ifamp = (struct ifa_msghdr *)rtm;
1085 ifamp = (struct ifa_msghdr *)rtm;
1100 ifmam = (struct ifma_msghdr *)rtm;
1123 ifmam = (struct ifma_msghdr *)rtm;
1204 mib_send_rtmsg(struct rt_msghdr *rtm, struct sockaddr *gw, struct sockaddr *dst, struct sockaddr *mask) argument
1307 struct rt_msghdr *rtm; local
1370 struct rt_msghdr *rtm; local
1412 struct rt_msghdr *rtm; local
[all...]
/freebsd-head/sys/net/
H A Drtsock.c186 struct rt_msghdr *rtm, struct rib_cmd_info *rc);
190 static void send_rtm_reply(struct socket *so, struct rt_msghdr *rtm,
565 * Fills in @info based on userland-provided @rtm message.
570 fill_addrinfo(struct rt_msghdr *rtm, int len, u_int fibnum, struct rt_addrinfo *info) argument
575 rtm->rtm_pid = curproc->p_pid;
576 info->rti_addrs = rtm->rtm_addrs;
578 info->rti_mflags = rtm->rtm_inits;
579 info->rti_rmx = &rtm->rtm_rmx;
586 if (rt_xaddrs((caddr_t)(rtm + 1), len + (caddr_t)rtm, inf
679 handle_rtm_get(struct rt_addrinfo *info, u_int fibnum, struct rt_msghdr *rtm, struct rib_cmd_info *rc) argument
781 struct rt_msghdr *rtm, *orig_rtm = NULL; local
874 struct rt_msghdr *rtm = NULL; local
1061 send_rtm_reply(struct socket *so, struct rt_msghdr *rtm, struct mbuf *m, sa_family_t saf, u_int fibnum, int rtm_errno) argument
1198 struct rt_msghdr *rtm; local
1285 struct rt_msghdr *rtm = NULL; local
1413 struct rt_msghdr *rtm; local
1548 struct rt_msghdr *rtm; local
1806 struct rt_msghdr *rtm = (struct rt_msghdr *)w->w_tmem; local
[all...]
/freebsd-head/contrib/ipfilter/ipsend/
H A D44arp.c66 struct rt_msghdr *rtm; local
105 for (next = buf; next < lim; next += rtm->rtm_msglen)
107 rtm = (struct rt_msghdr *)next;
108 sin = (struct sockaddr_in *)(rtm + 1);
/freebsd-head/sbin/routed/
H A Dtable.c885 rtm_add(struct rt_msghdr *rtm, argument
894 if (rtm->rtm_flags & RTF_HOST) {
899 msglog("ignore %s without mask", rtm_type_name(rtm->rtm_type));
908 rtm_type_name(rtm->rtm_type));
912 rtm_type_name(rtm->rtm_type),
917 k->k_metric = rtm->rtm_rmx.rmx_hopcount;
926 if (rtm->rtm_flags & RTF_GATEWAY)
928 if (rtm->rtm_flags & RTF_STATIC)
931 if (0 != (rtm->rtm_flags & (RTF_DYNAMIC | RTF_MODIFIED))) {
989 rtm_lose(struct rt_msghdr *rtm, argument
1049 struct rt_msghdr *rtm; local
1163 struct rt_msghdr rtm; member in struct:__anon145::__anon146
[all...]
/freebsd-head/contrib/netbsd-tests/net/config/
H A Dnetconfig.c131 #define rtm m_rtmsg.m_rtm macro
145 rtm.rtm_type = RTM_ADD;
146 rtm.rtm_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC;
147 rtm.rtm_version = RTM_VERSION;
148 rtm.rtm_seq = 2;
149 rtm.rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK;
176 rtm.rtm_msglen = len;
/freebsd-head/tools/tools/net80211/wlanwatch/
H A Dwlanwatch.c77 static void print_rtmsg(struct rt_msghdr *rtm, int msglen);
287 print_rtmsg(struct rt_msghdr *rtm, int msglen) argument
294 if (rtm->rtm_version != RTM_VERSION) {
296 rtm->rtm_version);
299 switch (rtm->rtm_type) {
301 ifm = (struct if_msghdr *)rtm;
321 ifan = (struct if_announcemsghdr *)rtm;
340 ifan = (struct if_announcemsghdr *)rtm;
/freebsd-head/usr.sbin/ppp/
H A Droute.c311 route_ParseHdr(struct rt_msghdr *rtm, struct sockaddr *sa[RTAX_MAX]) argument
316 wp = (char *)(rtm + 1);
319 if (rtm->rtm_addrs & (1 << rtax)) {
331 struct rt_msghdr *rtm; local
359 for (cp = sp; cp < ep; cp += rtm->rtm_msglen) {
360 rtm = (struct rt_msghdr *)cp;
362 route_ParseHdr(rtm, sa);
368 p_flags(arg->prompt, rtm->rtm_flags, 6);
369 prompt_Printf(arg->prompt, " %s\n", Index2Nam(rtm->rtm_index));
383 struct rt_msghdr *rtm; local
474 struct rt_msghdr *rtm; local
[all...]

Completed in 176 milliseconds

12