• Home
  • Raw
  • Download

Lines Matching refs:iface

52 open_socket(struct interface *iface, int protocol)  in open_socket()  argument
89 strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name)); in open_socket()
96 if (iface->buffer_size != (size_t)buf_len) { in open_socket()
97 free(iface->buffer); in open_socket()
98 iface->buffer_size = buf_len; in open_socket()
99 iface->buffer = xmalloc(buf_len); in open_socket()
100 iface->buffer_len = iface->buffer_pos = 0; in open_socket()
113 fdp = &iface->arp_fd; in open_socket()
117 fdp = &iface->raw_fd; in open_socket()
131 free(iface->buffer); in open_socket()
132 iface->buffer = NULL; in open_socket()
138 send_raw_packet(const struct interface *iface, int protocol, in send_raw_packet() argument
153 fd = iface->arp_fd; in send_raw_packet()
155 fd = iface->raw_fd; in send_raw_packet()
162 get_raw_packet(struct interface *iface, int protocol, in get_raw_packet() argument
171 fd = iface->arp_fd; in get_raw_packet()
173 fd = iface->raw_fd; in get_raw_packet()
179 if (iface->buffer_len == 0) { in get_raw_packet()
180 bytes = read(fd, iface->buffer, iface->buffer_size); in get_raw_packet()
185 iface->buffer_len = bytes; in get_raw_packet()
186 iface->buffer_pos = 0; in get_raw_packet()
189 memcpy(&packet, iface->buffer + iface->buffer_pos, in get_raw_packet()
193 if (iface->buffer_pos + packet.bh_caplen + packet.bh_hdrlen > in get_raw_packet()
194 iface->buffer_len) in get_raw_packet()
196 payload = iface->buffer + packet.bh_hdrlen + ETHER_HDR_LEN; in get_raw_packet()
202 iface->buffer_pos += BPF_WORDALIGN(packet.bh_hdrlen + in get_raw_packet()
204 if (iface->buffer_pos >= iface->buffer_len) in get_raw_packet()
205 iface->buffer_len = iface->buffer_pos = 0; in get_raw_packet()