#define NCHUNKS 16
#define CHUNK0SIZE 1024
struct chunk {
- u_int n_left;
+ size_t n_left;
void *m;
};
static struct chunk chunks[NCHUNKS];
static int cur_chunk;
-static void *newchunk(u_int);
+static void *newchunk(size_t);
static void freechunks(void);
static inline struct block *new_block(int);
static inline struct slist *new_stmt(int);
static struct block *gen_msg_abbrev(int type);
static void *
-newchunk(n)
- u_int n;
+newchunk(size_t n)
{
struct chunk *cp;
int k;
sdup(s)
register const char *s;
{
- int n = strlen(s) + 1;
+ size_t n = strlen(s) + 1;
char *cp = newchunk(n);
strlcpy(cp, s, n);
* No need to copy the data - we're doing a fetch.
*/
oid_data_arg->Oid = oid;
- oid_data_arg->Length = len;
+ oid_data_arg->Length = (ULONG)len; /* XXX - check for ridiculously large value? */
if (!PacketRequest(p->adapter, FALSE, oid_data_arg)) {
pcap_win32_err_to_str(GetLastError(), errbuf);
snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
}
oid_data_arg->Oid = oid;
- oid_data_arg->Length = len;
+ oid_data_arg->Length = (ULONG)len; /* XXX - check for ridiculously large value? */
memcpy(oid_data_arg->Data, data, len);
if (!PacketRequest(p->adapter, TRUE, oid_data_arg)) {
pcap_win32_err_to_str(GetLastError(), errbuf);
}
/* Set the name of the dump file */
- res = PacketSetDumpName(p->adapter, filename, strlen(filename));
+ res = PacketSetDumpName(p->adapter, filename, (int)strlen(filename));
if(res == FALSE){
snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
"Error setting kernel dump file name");
return (-1);
}
- PacketInitPacket(PacketToSend,(PVOID)buf,size);
+ PacketInitPacket(PacketToSend, (PVOID)buf, (UINT)size);
if(PacketSendPacket(p->adapter,PacketToSend,TRUE) == FALSE){
snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "send error: PacketSendPacket failed");
PacketFreePacket(PacketToSend);
* "pcap_inject()" is expected to return the number of bytes
* sent.
*/
- return (size);
+ return ((int)size);
}
static void
* correctly in the savefile header. If the caplen isn't
* grossly wrong, try to salvage.
*/
- bpf_u_int32 bytes_to_discard;
+ size_t bytes_to_discard;
size_t bytes_to_read, bytes_read;
char discard_buf[4096];
{
FILE *f;
int linktype;
- int amt_read;
+ size_t amt_read;
struct pcap_file_header ph;
linktype = dlt_to_linktype(p->linktype);