BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len,
char *srcname, int src_type,
char *dstname, int dest_type,
- struct in_addr dest_ip,struct in_addr src_ip);
+ struct in_addr dest_ip,struct in_addr src_ip,
+ int dest_port);
/*The following definitions come from nmbd/nmbd_processlogon.c */
to %s for workgroup %s.\n", namestr(&work->dmb_name), work->work_group ));
send_mailslot(True, BROWSE_MAILSLOT, outbuf,PTR_DIFF(p,outbuf),
- global_myname, 0x0, work->dmb_name.name, 0x0, work->dmb_addr, FIRST_SUBNET->myip);
+ global_myname, 0x0, work->dmb_name.name, 0x0,
+ work->dmb_addr, FIRST_SUBNET->myip, DGRAM_PORT);
}
send_mailslot(False, BROWSE_MAILSLOT, outbuf, PTR_DIFF(p,outbuf),
global_myname, 0,
workgroup_name, 0x1e,
- subrec->bcast_ip, subrec->myip);
+ subrec->bcast_ip, subrec->myip, DGRAM_PORT);
}
/*******************************************************************
/****************************************************************************
Send a backup list response.
*****************************************************************************/
-
static void send_backup_list_response(struct subnet_record *subrec,
- struct work_record *work,
- struct nmb_name *send_to_name,
- unsigned char max_number_requested,
- uint32 token, struct in_addr sendto_ip)
+ struct work_record *work,
+ struct nmb_name *send_to_name,
+ unsigned char max_number_requested,
+ uint32 token, struct in_addr sendto_ip,
+ int port)
{
char outbuf[1024];
char *p, *countptr, *nameptr;
outbuf,PTR_DIFF(p,outbuf),
global_myname, 0,
send_to_name->name,0,
- sendto_ip, subrec->myip);
+ sendto_ip, subrec->myip, port);
}
/*******************************************************************
}
send_backup_list_response(subrec, work, &dgram->source_name,
- max_number_requested, token, p->ip);
+ max_number_requested, token, p->ip, p->port);
}
/*******************************************************************
/****************************************************************************
Construct and send a netbios DGRAM.
- Note that this currently sends all packets to port 138.
**************************************************************************/
-
BOOL send_mailslot(BOOL unique, char *mailslot,char *buf,int len,
char *srcname, int src_type,
char *dstname, int dest_type,
- struct in_addr dest_ip,struct in_addr src_ip)
+ struct in_addr dest_ip,struct in_addr src_ip,
+ int dest_port)
{
BOOL loopback_this_packet = False;
struct packet_struct p;
dgram->datasize = PTR_DIFF(p2,ptr+4); /* +4 for tcp length. */
p.ip = dest_ip;
- p.port = DGRAM_PORT;
+ p.port = dest_port;
p.fd = find_subnet_mailslot_fd_for_address( src_ip );
p.timestamp = time(NULL);
p.packet_type = DGRAM_PACKET;
dgram->dest_name.name_type,
dgram->source_name.name,
dgram->source_name.name_type,
- p->ip, *iface_ip(p->ip));
+ p->ip, *iface_ip(p->ip), p->port);
break;
}
dgram->dest_name.name_type,
dgram->source_name.name,
dgram->source_name.name_type,
- p->ip, *iface_ip(p->ip));
+ p->ip, *iface_ip(p->ip), p->port);
return;
}
dgram->dest_name.name_type,
dgram->source_name.name,
dgram->source_name.name_type,
- p->ip, *iface_ip(p->ip));
+ p->ip, *iface_ip(p->ip), p->port);
break;
}
p++;
send_mailslot(True, BROWSE_MAILSLOT, outbuf,PTR_DIFF(p,outbuf),
- global_myname, 0x0, to_name, to_type, to_ip, FIRST_SUBNET->myip);
+ global_myname, 0x0, to_name, to_type, to_ip,
+ FIRST_SUBNET->myip, DGRAM_PORT);
}
/****************************************************************************
p = skip_string(p,1);
send_mailslot(False, BROWSE_MAILSLOT, outbuf,PTR_DIFF(p,outbuf),
- global_myname, 0x0, work->work_group,0x1e, subrec->bcast_ip, subrec->myip);
+ global_myname, 0x0, work->work_group,0x1e, subrec->bcast_ip,
+ subrec->myip, DGRAM_PORT);
}
/****************************************************************************
p = skip_string(p,1);
send_mailslot(False,BROWSE_MAILSLOT, outbuf, PTR_DIFF(p,outbuf),
- from_name, 0x0, to_name, to_type, to_ip, subrec->myip);
+ from_name, 0x0, to_name, to_type, to_ip, subrec->myip,
+ DGRAM_PORT);
}
/****************************************************************************
p = skip_string(p,1);
send_mailslot(False,LANMAN_MAILSLOT, outbuf, PTR_DIFF(p,outbuf),
- from_name, 0x0, to_name, to_type, to_ip, subrec->myip);
+ from_name, 0x0, to_name, to_type, to_ip, subrec->myip,
+ DGRAM_PORT);
}
/****************************************************************************
global_myname, inet_ntoa(addr) ));
send_mailslot(True, BROWSE_MAILSLOT, outbuf,PTR_DIFF(p,outbuf),
- global_myname, 0x0, "*", 0x0, addr, FIRST_SUBNET->myip);
+ global_myname, 0x0, "*", 0x0, addr, FIRST_SUBNET->myip, DGRAM_PORT);
}
}