int cached_error_packet(char *outbuf,files_struct *fsp,int line,const char *file) { write_bmpx_struct *wbmpx = fsp->wbmpx_ptr; int32 eclass = wbmpx->wr_errclass; int32 err = wbmpx->wr_error; NTSTATUS ntstatus = wbmpx->wr_status; /* We can now delete the auxiliary struct */ SAFE_FREE(fsp->wbmpx_ptr); return error_packet(outbuf,eclass,err,ntstatus,line,file); }
int unix_error_packet(char *outbuf,int def_class,uint32 def_code, NTSTATUS def_status, int line, const char *file) { int eclass=def_class; int ecode=def_code; NTSTATUS ntstatus = def_status; int i=0; if (errno != 0) { DEBUG(3,("unix_error_packet: error string = %s\n",strerror(errno))); while (unix_dos_nt_errmap[i].dos_class != 0) { if (unix_dos_nt_errmap[i].unix_error == errno) { eclass = unix_dos_nt_errmap[i].dos_class; ecode = unix_dos_nt_errmap[i].dos_code; ntstatus = unix_dos_nt_errmap[i].nt_error; break; } i++; } } return error_packet(outbuf,eclass,ecode,ntstatus,line,file); }
void packet_ok(packet_t *packet) { error_packet(packet, AD_ERROR_OK, 0, NULL); }
int player_send_msg(int target, char *sender, char *msg) { packet_t packet; error_packet(&packet, AD_ERROR_OK, AD_ERROR_FLAG_MSG, NULL); snprintf(packet.error.msg, 128, "[%s%s%s] %s", CL_FRONT_CYAN, sender, CL_FRONT_DEFAULT, msg); return player_send(target, &packet); }