• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/libpcap-1.4.0/

Lines Matching defs:handle

358 static void pcap_cleanup_acn(pcap_t *handle) {
362 if (find_unit_by_fd(handle->fd, &chassis, &geoslot, &u) == 0)
367 pcap_cleanup_live_common(handle);
790 static int pcap_stats_acn(pcap_t *handle, struct pcap_stat *ps) {
793 send_to_fd(handle->fd, 1, (unsigned char *)"S"); /* send the get_stats command to the IOP */
795 if (read_client_nbytes(handle->fd, sizeof(buf), buf) == -1) return -1; /* try reading the required bytes */
859 static int pcap_setfilter_acn(pcap_t *handle, struct bpf_program *bpf) {
860 int fd = handle->fd;
885 static int pcap_setdirection_acn(pcap_t *handle, pcap_direction_t d) {
886 snprintf(handle->errbuf, sizeof(handle->errbuf),
891 static int acn_read_n_bytes_with_timeout(pcap_t *handle, int count) {
903 fd = handle->fd;
907 bp = handle->bp;
928 static int pcap_read_acn(pcap_t *handle, int max_packets, pcap_handler callback, u_char *user) {
934 acn_start_monitor(handle->fd, handle->snapshot, handle->md.timeout, handle->md.clear_promisc, handle->direction); /* maybe tell him to start monitoring */
937 handle->bp = packet_header;
938 if (acn_read_n_bytes_with_timeout(handle, HEADER_SIZE) == -1) return 0; /* try to read a packet header in so we can get the sizeof the packet data */
945 handle->bp = handle->buffer + handle->offset; /* start off the receive pointer at the right spot */
946 if (acn_read_n_bytes_with_timeout(handle, pcap_header.caplen) == -1) return 0; /* then try to read in the rest of the data */
948 callback(user, &pcap_header, handle->bp); /* call the user supplied callback function */
952 static int pcap_activate_sita(pcap_t *handle) {
955 if (handle->opt.rfmon) {
965 handle->inject_op = pcap_inject_acn;
966 handle->setfilter_op = pcap_setfilter_acn;
967 handle->setdirection_op = pcap_setdirection_acn;
968 handle->set_datalink_op = NULL; /* can't change data link type */
969 handle->getnonblock_op = pcap_getnonblock_fd;
970 handle->setnonblock_op = pcap_setnonblock_fd;
971 handle->cleanup_op = pcap_cleanup_acn;
972 handle->read_op = pcap_read_acn;
973 handle->stats_op = pcap_stats_acn;
975 fd = acn_open_live(handle->opt.source, handle->errbuf,
976 &handle->linktype);
979 handle->md.clear_promisc = handle->md.promisc;
980 handle->fd = fd;
981 handle->bufsize = handle->snapshot;
985 handle->buffer = malloc(handle->bufsize + handle->offset);
986 if (!handle->buffer) {
987 snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
989 pcap_cleanup_acn(handle);
994 * "handle->fd" is a socket, so "select()" and "poll()"
997 handle->selectable_fd = handle->fd;