Diff for /embedaddon/libnet/src/libnet_link_dlpi.c between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2012/02/21 22:14:23 version 1.1.1.2, 2013/07/22 11:54:42
Line 100  static int send_request(int, int8_t *, int, int8_t *,  Line 100  static int send_request(int, int8_t *, int, int8_t *, 
 static int strioctl(int, int, int, int8_t *);  static int strioctl(int, int, int, int8_t *);
 #endif  #endif
 #ifdef HAVE_HPUX9  #ifdef HAVE_HPUX9
static int dlpi_kread(int, off_t, void *, u_int, int8_t *);static int dlpi_kread(int, off_t, void *, uint, int8_t *);
 #endif  #endif
 #ifdef HAVE_DEV_DLPI  #ifdef HAVE_DEV_DLPI
 static int get_dlpi_ppa(int, const int8_t *, int, int8_t *);  static int get_dlpi_ppa(int, const int8_t *, int, int8_t *);
Line 277  libnet_open_link(libnet_t *l) Line 277  libnet_open_link(libnet_t *l)
             break;              break;
         default:          default:
             sprintf(l->err_buf, "%s(): unknown mac type 0x%lu\n", __func__,              sprintf(l->err_buf, "%s(): unknown mac type 0x%lu\n", __func__,
                    (u_int32_t) infop->dl_mac_type);                    (uint32_t) infop->dl_mac_type);
             goto bad;              goto bad;
     }      }
   
Line 491  register int8_t *ebuf) Line 491  register int8_t *ebuf)
     register dl_hp_ppa_ack_t *ap;      register dl_hp_ppa_ack_t *ap;
     register dl_hp_ppa_info_t *ip;      register dl_hp_ppa_info_t *ip;
     register int i;      register int i;
    register u_int32_t majdev;    register uint32_t majdev;
     dl_hp_ppa_req_t     req;      dl_hp_ppa_req_t     req;
     struct stat statbuf;      struct stat statbuf;
     bpf_u_int32 buf[MAXDLBUF];      bpf_u_int32 buf[MAXDLBUF];
Line 514  register int8_t *ebuf) Line 514  register int8_t *ebuf)
     }      }
   
     ap = (dl_hp_ppa_ack_t *)buf;      ap = (dl_hp_ppa_ack_t *)buf;
    ip = (dl_hp_ppa_info_t *)((u_int8_t *)ap + ap->dl_offset);    ip = (dl_hp_ppa_info_t *)((uint8_t *)ap + ap->dl_offset);
   
     for (i = 0; i < ap->dl_count; i++)      for (i = 0; i < ap->dl_count; i++)
     {      {
         if (ip->dl_mjr_num == majdev && ip->dl_instance_num == unit)          if (ip->dl_mjr_num == majdev && ip->dl_instance_num == unit)
         break;          break;
   
        ip = (dl_hp_ppa_info_t *)((u_int8_t *)ip + ip->dl_next_offset);        ip = (dl_hp_ppa_info_t *)((uint8_t *)ip + ip->dl_next_offset);
     }      }
   
     if (i == ap->dl_count)      if (i == ap->dl_count)
Line 618  get_dlpi_ppa(register int fd, register const int8_t *i Line 618  get_dlpi_ppa(register int fd, register const int8_t *i
   
 static int  static int
 dlpi_kread(register int fd, register off_t addr, register void *buf,  dlpi_kread(register int fd, register off_t addr, register void *buf,
register u_int len, register int8_t *ebuf)register uint len, register int8_t *ebuf)
 {  {
     register int cc;      register int cc;
   
Line 646  register u_int len, register int8_t *ebuf) Line 646  register u_int len, register int8_t *ebuf)
 struct  EnetHeaderInfo  struct  EnetHeaderInfo
 {  {
     struct libnet_ether_addr   DestEtherAddr;      struct libnet_ether_addr   DestEtherAddr;
    u_int16_t EtherFrameType;    uint16_t EtherFrameType;
 };  };
   
   
Line 655  libnet_close_link(libnet_t *l) Line 655  libnet_close_link(libnet_t *l)
 {  {
     if (close(l->fd) == 0)      if (close(l->fd) == 0)
     {      {
         free(l);  
         return (1);          return (1);
     }      }
     else      else
     {      {
         free(l);  
         return (-1);          return (-1);
     }      }
 }  }
   
 #ifdef HAVE_HPUX11  #ifdef HAVE_HPUX11
 int   int 
libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size)   libnet_write_link(libnet_t *l, const uint8_t *packet, uint32_t size)   
 {                                                               {                                                             
     struct strbuf data, ctl;      struct strbuf data, ctl;
     dl_hp_rawdata_req_t *rdata;      dl_hp_rawdata_req_t *rdata;
Line 705  libnet_write_link(libnet_t *l, u_int8_t *packet, u_int Line 703  libnet_write_link(libnet_t *l, u_int8_t *packet, u_int
 }     }   
 #else  #else
 int  int
libnet_write_link(libnet_t *l, u_int8_t *packet, u_int32_t size)libnet_write_link(libnet_t *l, const uint8_t *packet, uint32_t size)
 {  {
     int c;      int c;
     struct strbuf data;      struct strbuf data;
Line 737  libnet_write_link(libnet_t *l, u_int8_t *packet, u_int Line 735  libnet_write_link(libnet_t *l, u_int8_t *packet, u_int
 struct libnet_ether_addr *  struct libnet_ether_addr *
 libnet_get_hwaddr(libnet_t *l)  libnet_get_hwaddr(libnet_t *l)
 {  {
    int8_t buf[2048];    /* This implementation is not-reentrant. */
     static int8_t buf[2048];
     union DL_primitives *dlp;      union DL_primitives *dlp;
     struct libnet_ether_addr *eap;      struct libnet_ether_addr *eap;
   

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>