ReactOS  r76032
svc.c File Reference
#include <wintirpc.h>
#include <reentrant.h>
#include <sys/types.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <rpc/rpc.h>
#include "rpc_com.h"
Include dependency graph for svc.c:

Go to the source code of this file.

Classes

struct  svc_callout
 

Macros

#define RQCRED_SIZE   400 /* this size is excessive */
 
#define SVC_VERSQUIET   0x0001 /* keep quiet about vers mismatch */
 
#define version_keepquiet(xp)   ((u_long)(xp)->xp_p3 & SVC_VERSQUIET)
 
#define max(a, b)   (a > b ? a : b)
 

Functions

static struct svc_calloutsvc_find (rpcprog_t, rpcvers_t, struct svc_callout **, char *)
 
static void __xprt_do_unregister (SVCXPRT *xprt, bool_t dolock)
 
void xprt_register (SVCXPRT *xprt)
 
void xprt_unregister (SVCXPRT *xprt)
 
void __xprt_unregister_unlocked (SVCXPRT *xprt)
 
bool_t svc_reg (SVCXPRT *xprt, const rpcprog_t prog, const rpcvers_t vers, void *dispatch, const struct netconfig *nconf)
 
void svc_unreg (rpcprog_t prog, const rpcvers_t vers) const
 
bool_t svc_sendreply (SVCXPRT *xprt, xdrproc_t xdr_results, void *xdr_location)
 
void svcerr_noproc (SVCXPRT *xprt)
 
void svcerr_decode (SVCXPRT *xprt)
 
void svcerr_systemerr (SVCXPRT *xprt)
 
void svcerr_auth (SVCXPRT *xprt, enum auth_stat why)
 
void svcerr_weakauth (SVCXPRT *xprt)
 
void svcerr_noprog (SVCXPRT *xprt)
 
void svcerr_progvers (SVCXPRT *xprt, rpcvers_t low_vers, rpcvers_t high_vers)
 
void svc_getreq (int rdfds)
 
void svc_getreqset (fd_set *readfds)
 
void svc_getreq_common (SOCKET fd)
 
void svc_getreq_poll (struct pollfd *pfdp, int pollretval)
 
bool_t rpc_control (int what, void *arg)
 

Variables

static struct svc_calloutsvc_head
 
rwlock_t svc_lock
 
rwlock_t svc_fd_lock
 

Macro Definition Documentation

#define max (   a,
  b 
)    (a > b ? a : b)

Definition at line 63 of file svc.c.

Referenced by __ext4_ext_check(), basic_filebuf< _CharT, _Traits >::_M_allocate_buffers(), _M_append_sum(), _M_append_sum_pos(), vector< CTestInfo >::_M_compute_next_size(), __BVECTOR_QUALIFIED::_M_fill_insert(), _Deque_base< _Tp, _Alloc >::_M_initialize_map(), deque< _Tp, >::_M_reallocate_map(), basic_filebuf< _CharT, _Traits >::_M_setup_codecvt(), _mesa_get_format_max_bits(), _mesa_max_buffer_index(), _mesa_pack_rgba_span_float(), _mesa_scale_and_bias_depth_uint(), _readex_expect_async(), _S_apply_to_pieces(), _Stl_expand_array(), _Strftime(), _tnl_draw_prims(), _tpopen(), AbbrevStr(), ACTION_RecurseSearchDirectory(), action_RegDeleteTreeA(), add_chunk(), add_dir_child(), add_func_desc(), add_index(), add_line_to_buffer(), add_name(), add_option(), add_var_desc(), KeyTranslator::AddGlobalDef(), adns__findlabel_start(), adns__update_expires(), af_glyph_hints_align_strong_points(), af_latin_hints_link_segments(), alloc_user_entry(), append_data(), arc2polybezier(), arial_enum_proc(), arial_enum_procw(), ata_check_unit(), ata_send_ioctl(), AtaSetTransferMode(), ATTDlgWinProc(), AVIFILE_ReadBlock(), balance_data_chunk(), bdf_cmap_char_index(), bdf_cmap_char_next(), bezier_deviation_squared(), bitmap_info_size(), BlpDeviceCompare(), Brush(), BUTTON_GetIdealSize(), calc_thumb_dimensions(), Mapdesc::calcPartialVelocity(), calculate_dds_file_size(), calculate_dds_surface_size(), CalculateBitmapSize(), CBDropDown(), CC_PaintLumBar(), CC_RGBtoHSL(), CdRomDeviceControlDispatch(), CdRomInitDevice(), CdRomPickDvdRegion(), NumPutGetTest::check_get_float(), check_height_font_enumproc(), check_index_bounds(), check_keywords(), check_output_buffer_space(), check_with_margin(), CheckListWndProc(), ChildWndProc(), choose_font(), ClassInterpretSenseInfo(), ClassSendDeviceIoControlSynchronous(), clean_space_cache_chunk(), ClipOrCenterRectToMonitor(), CmpInitializeHive(), CmpOpenHiveFiles(), co_IntGetScrollBarInfo(), co_IntSetScrollInfo(), co_WinPosGetMinMaxInfo(), codeview_add_type(), color_key_arbfp(), ColorRGBToHLS(), ColorsProc(), CombineRgn(), COMBOEX_ReSize(), CompBattGetBatteryInformation(), CompositeMonikerMarshalImpl_UnmarshalInterface(), compress2(), ComputeCompatibleFormat(), CUiWindow< CStatusBar >::ComputeContentBounds(), CUiSplitPanel::ComputeContentBounds(), CUiMeasure::ComputeMeasure(), CUiBox::ComputeMinimalSize(), CUiSplitPanel::ComputeMinimalSize(), ConCfgReadUserSettings(), ConDrvReadConsole(), ConDrvSetConsoleCursorInfo(), ConioGetIntersection(), ConioGetUnion(), ConioWriteConsole(), CONSOLE_SCREEN_BUFFER_Initialize(), ConSrvApplyUserSettings(), ConSrvReadUserSettings(), ConSrvTermReadStream(), cp2range(), cpu_blitter_clear(), create_child_window(), create_taskdialog_template(), CreateProcessInternalW(), CRYPT_AsnDecodeMaximum(), CRYPT_AsnDecodeSequence(), CRYPT_LMhash(), ctrl_container_resize(), ctrl_resize(), CURSORICON_GetCursorDataFromBMI(), customctrl_resize(), d3d8_device_prepare_index_buffer(), d3d8_device_prepare_vertex_buffer(), d3d9_device_prepare_index_buffer(), d3d9_device_prepare_vertex_buffer(), d3d_device_prepare_index_buffer(), d3d_device_prepare_vertex_buffer(), d3d_execute_buffer_SetExecuteData(), d3drm_array_reserve(), d3dx9_base_effect_get_int(), d3dx9_base_effect_set_vector(), D3DXCheckTextureRequirements(), D3DXCheckVolumeTextureRequirements(), D3DXSHRotateZ(), DATETIME_IncreaseField(), ddraw_find_decl(), ddraw_surface_create(), DECLARE_INTERFACE_(), DefWndDoSizeMove(), DefWndHandleWindowPosChanging(), DefWndStartSizeMove(), KeyTranslator::DeleteAllDefs(), DequeueFreeTransferPacket(), device_clear_render_targets(), device_get_fvf_declaration(), devinst_RegDeleteTreeW(), DIALOG_NEW_DlgProc(), DIB_BitmapInfoSize(), DispatchEx_GetDispID(), DispatchEx_InvokeEx(), TMapLoader::Display(), Display_OnVScroll(), do_write_file(), dotest_spi_iconhorizontalspacing(), dotest_spi_iconverticalspacing(), DPA_CreateEx(), DPA_DeletePtr(), DPA_Grow(), draw_chunk_bar_V(), CImgAreaWindow::drawZoomFrame(), DrvLineTo(), DSA_Create(), EDIT_AdjustFormatRect(), EDIT_BuildLineDefs_ML(), EDIT_ConfinePoint(), EDIT_EM_LineScroll_internal(), EDIT_EM_Scroll(), EDIT_GetLineRect(), EDIT_PaintLine(), EDIT_WM_Copy(), EDIT_WM_Paint(), EMFDRV_ArcChordPie(), EMFDRV_ExtTextOut(), EMFDRV_LineTo(), EMFDRV_UpdateBBox(), EngLineTo(), enum_font_data_proc(), enum_fullname_data_proc(), enum_ms_shell_dlg2_proc(), enum_ms_shell_dlg_proc(), Erase(), expr_common_type(), ext4_ext_max_entries(), Fast486FpuAdd(), fdi_Zipinflate_codes(), FILEDLG95_LOOKIN_Init(), FillTMEx(), find_arb_pshader(), find_arb_vshader(), find_builtin_prop(), find_entry_by_id(), find_entry_by_name(), find_glsl_pshader(), find_glsl_vshader(), find_html_symbol(), find_new_dup_stripes(), find_pe_resource(), FindFonts(), FindMUIEntriesOfPage(), FindMUIErrorEntries(), FindMUIStringEntries(), NumPutGetTest::fix_float_long(), FloatDown(), flush_partial_stripe(), format_insert(), format_string(), FormatMessageA(), FormatMessageW(), FrLdrHeapAllocateEx(), FsdSetFsLabelInformation(), GdipCreateLineBrushFromRect(), GdipGetPathWorldBounds(), get_builtin_func(), get_builtin_id(), get_dir_last_child(), get_escaped_string(), get_geoinfo_dataptr(), get_nextvalue(), get_olemisc_value(), get_points_bounds(), get_pointsize_minmax(), get_selection_rect(), get_superblock_size(), get_table_size(), get_tag_desc(), get_target_info(), get_vertical_line_count(), CMenuBand::GetBandInfo(), GetDeviceData(), CSysPagerWnd::GetSize(), GraphCtrl_InvalidateCtrl(), gray_convert_glyph(), GreGradientFill(), grow_output_buffer(), GuiConsoleHandleScroll(), GuiConsoleUpdateSelection(), guiProgress(), gxv_kern_subtable_fmt3_validate(), gz_comp(), gz_load(), handle_readdir(), HandleHorizontalScrollEvents(), HandleMouseScrollEvents(), HandleVerticalScrollEvents(), hash_table_destroy(), HEADER_ChangeItemOrder(), HEXEDIT_Update(), HistoryRecallHistory(), HLPFILE_Uncompress_Phrases40(), IAVIStream_fnWrite(), ICSeqCompressFrameStart(), IdeSendCommand(), IFileDialog2_fnSetFileTypeIndex(), III_dequantize_sample(), IKsPin_PrepareStreamHeader(), image_list_init(), ImageList_Create(), IMAGELIST_InternalExpandBitmaps(), ImageList_Merge(), inflate_table(), TConfig::init_aliases(), init_argb_conversion_info(), InitD3D9ResourceManager(), InitializeContextEx(), InitializePool(), InitMetrics(), __BVECTOR_QUALIFIED::insert(), InstallEngineTiming_GetInstallProgress(), IntCalculateThumb(), IntEngBitBlt(), IntEngGradientFillRect(), IntEngLineTo(), IntEngPolyline(), IntersectRect(), IntGdiLineTo(), IntGdiPolygon(), IntHideMousePointer(), IntMapWindowPoints(), IntRectangle(), IntRoundRect(), IntScrollDrawSizeGrip(), IntScrollGetScrollBarRect(), IntShowMousePointer(), IoGetDeviceInterfaces(), IPropertyStorage_fnWriteMultiple(), is_comctl32_class(), is_cp_event(), iterator_frameditems_absolute(), KeSetTimeIncrement(), layout_merge_segments(), layout_recall_merge(), LayoutProc(), LineInputRecallHistory(), CUSBQueue::LinkInterruptQueueHead(), LISTBOX_FindFileStrPos(), LISTBOX_FindStringPos(), LISTBOX_GetMaxTopIndex(), LISTBOX_MoveCaret(), LISTBOX_SetTopItem(), ListBoxWndProc_common(), LISTVIEW_AddGroupSelection(), LISTVIEW_CalculateItemHeight(), LISTVIEW_CalculateItemWidth(), LISTVIEW_GetAreaRect(), LISTVIEW_GetCountPerColumn(), LISTVIEW_GetCountPerRow(), LISTVIEW_GetItemMetrics(), LISTVIEW_MouseMove(), LISTVIEW_Notify(), LISTVIEW_RedrawItems(), LISTVIEW_ScrollTimer(), LISTVIEW_SetColumnWidth(), LISTVIEW_SetGroupSelection(), LISTVIEW_SetItemCount(), LISTVIEW_UpdateHScroll(), LISTVIEW_UpdateSize(), LISTVIEW_UpdateVScroll(), load_cube_texture_from_dds(), load_texture_from_dds(), load_volume_texture_from_dds(), LoadIniFile(), log_file(), TMapLoader::LookForPart(), KeyTranslator::LookOnGlobal(), lookup_assembly(), lookup_style_tbl(), MACRO_CreateButton(), MainWndProc(), MapWindowPoints(), Math_max(), MaxTest::max1(), MaxTest::max2(), ME_BeginRow(), ME_DrawParaDecoration(), ME_DrawParagraph(), ME_DrawTableBorders(), ME_HandleMessage(), ME_InsertRowStart(), ME_PostSetScrollRangeVisibility(), ME_ProtectPartialTableDeletion(), ME_RunOfsFromCharOfs(), ME_ScrollAbs(), ME_StreamOutRTF(), ME_WmCreate(), ME_WrapMarkedParagraphs(), ME_WrapTextParagraph(), measure_ranges_callback(), memcpy_max(), memp_init(), MENU_CalcItemSize(), MENU_DrawMenuItem(), MENU_MenuBarCalcSize(), MENU_PopupMenuCalcSize(), MenuInit(), MessageBoxTimeoutIndirectW(), METAFILE_AllocateRecord(), METAFILE_GraphicsDeleted(), MFDRV_WriteRecord(), MiEnablePagingOfDriver(), MiFindInitializationCode(), MiInitializeMemoryEvents(), MiLocateKernelSections(), AlgTest::min_max(), MiTrimMemoryConsumer(), MiWriteProtectSystemImage(), mixerGetControlDetailsA(), MmAdjustWorkingSetSize(), MmArmInitSystem(), mmioAdvance(), MmMapViewOfSection(), SelectionModel::ModifyDestRect(), ModifyStatus(), MONTHCAL_SetMaxSelCount(), MONTHCAL_UpdateSize(), move_across_subvols(), mru_RegDeleteTreeA(), MSI_IterateRecords(), MsiEnumComponentCostsW(), msvcrt_init_io(), MUIDefaultKeyboardLayout(), MUIGetGeoID(), MUIGetLayoutsList(), myRegDeleteTreeA(), myRegDeleteTreeW(), NdrFullPointerQueryRefId(), near_match(), nearest_texel_location(), NEtoSW(), notify_measureitem(), NtGdiEllipse(), NtGdiGetBoundsRect(), NtGdiPolyPolyDraw(), NumPutGetTest::num_put_float(), NWtoSE(), ObpAllocateObject(), on_wm_initdialog(), CMainWindow::OnLink(), CUiSplitPanel::OnParentSize(), OnScroll(), CGridView::OnVScroll(), OnVScroll(), OptionsProc(), strstreambuf::overflow(), package_RegDeleteTreeW(), PAGER_PositionChildWnd(), paraformat_proc(), parse_ctab_constant_type(), parse_encoding_name(), parse_vertex_colors(), ParseMinMaxQuantifier(), patch_offset_get_filepatches(), patch_offset_get_files(), patch_offset_modify_db(), PATH_CreatePath(), pattern_fork(), pbuf_memfind(), pcf_cmap_char_index(), pcf_cmap_char_next(), pfr_cmap_char_index(), pfr_cmap_char_next(), pfr_face_init(), pfr_lookup_bitmap_data(), poll_isset(), POLYGONFILL_FillScanLineWinding(), POLYGONFILL_MakeEdge(), POLYGONFILL_UpdateScanline(), pool_alloc(), pqDelete(), prepare_raid5_write(), prepare_raid6_write(), PROGRESS_Draw(), PropertyHandler_Level(), protect_superblocks(), ps_dimension_add_t1stem(), ArcTessellator::pwl(), qsort(), query_reg_path(), CUSBQueue::QueueHeadInterruptCompletion(), quirk_apple_glsl_constants(), quirk_r200_constants(), ranges_add(), ranges_shift(), RawMountVolume(), read_data_raid5(), read_data_raid6(), read_file(), read_reply(), readerinput_grow(), REBAR_CalcHorzBand(), REBAR_CalcVertBand(), REBAR_LayoutRow(), REBAR_NCCalcSize(), REBAR_SetBandsHeight(), REBAR_ShrinkBandsLTR(), REBAR_ShrinkBandsRTL(), REBAR_SizeChildrenToHeight(), REBAR_ValidateBand(), RECTL_bIntersectRect(), RECTL_bUnionRect(), RecycleBin5_Create(), RegDeleteTreeW(), REGION_CropRegion(), REGION_IntersectO(), REGION_RegionOp(), REGION_SetPolyPolygonRgn(), REGION_UnionRegion(), remove_target_tasks(), Replace(), basic_string< _CharT, _Traits, _Alloc >::reserve(), reserve(), resize_9x(), resize_table(), ResizeTextConsole(), ResizeWnd(), round_child_height(), RpnpEvaluateStack(), RQueryServiceConfig2A(), RQueryServiceConfig2W(), RtlIsTextUnicode(), RtlpClassifyChars(), RtlpCollapsePath(), s_mp_add(), s_mp_sub(), scan_revoke_records(), ScmDeleteRegKey(), ScmSetFailureActions(), SCROLL_GetThumbVal(), scrollbar_test_default(), scrub_chunk(), scrub_chunk_raid56_stripe_run(), scrub_extent(), scrub_extent_raid10(), SdbpGetLongPathName(), set_avg(), set_bumpmat_arbfp(), set_rename_information(), SEtoNW(), SelectionModel::SetSrcAndDestRectFromPoints(), SETUP_CreateInterfaceList(), shader_arb_load_constants_f(), shader_arb_select(), shader_arb_update_float_pixel_constants(), shader_arb_update_float_vertex_constants(), shader_find_free_input_register(), shader_glsl_alloc(), shader_glsl_generate_patch_constant_setup(), shader_glsl_generate_transform_feedback_varyings(), shader_glsl_pointsize_uniform(), shader_reg_maps_add_tgsm(), shader_set_limits(), SHQueryValueExA(), SHQueryValueExW(), SOFTWARE_GdipDrawThinPath(), source_new(), space_list_add2(), SpiFixupValues(), SpiGetSet(), stabs_find_ref(), StackDropProc(), Defragment::Start(), start_balance(), state_arb_specularenable(), state_pscale(), state_psizemin_arb(), state_psizemin_ext(), state_psizemin_w(), state_texfactor_arbfp(), state_tss_constant_arbfp(), STATUSBAR_ComputeHeight(), STATUSBAR_DrawSizeGrip(), STATUSBAR_SetMinHeight(), sti_compar(), StorageImpl_StreamSetSize(), store_user_dirid(), strstreambuf::strstreambuf(), SubstituteVars(), KeyTranslator::SwitchTo(), SWtoNE(), symt_new_array(), SYSLINK_WrapLine(), system(), T1_Get_Kerning(), TAB_SetItemBounds(), taskdialog_init_button(), tcp_current_ssthresh(), tcp_initialize_rcv_mss(), tcp_moderate_sndbuf(), tcp_recalc_ssthresh(), tcp_select_initial_window(), Subdivider::tessellate(), test_boundsrect(), test_CreateIcon(), test_float_limits(), test_format_rect(), test_GetPwrDiskSpindownRange(), test_GetSystemMetrics(), test_GetSystemPreferredUILanguages(), test_GetUserPreferredUILanguages(), test_hotspot(), test_hotspot_v6(), test_hv_scroll_2(), test_integral_limits(), test_integral_limits_base(), test_marshal_LPSAFEARRAY(), test_mbs_help(), test_not_full(), test_pen_thickness(), test_rasenum(), test_scroll(), test_scroll_messages(), test_setpos(), test_SHQueryValueEx(), test_SPI_SETNONCLIENTMETRICS(), test_tab(), TestEventConcurrent(), TestEventsGeneration(), TestLockBytes_SetSize(), TestSynchronizeExecution(), tex_bumpenvlum_arbfp(), TEXTMODE_BUFFER_Initialize(), textrange_setend(), texture_apply_base_level(), texture_init(), TIME_SetEventInternal(), TOOLBAR_DrawButton(), TOOLBAR_GetIdealSize(), TOOLBAR_GetImageListCount(), TOOLBAR_LButtonDown(), TOOLBAR_MeasureButton(), TOOLBAR_SetButtonSize(), TOOLTIPS_CalcTipSize(), TOOLTIPS_Show(), TRACKBAR_SetRangeMax(), TransactedSnapshotImpl_StreamWriteAt(), transform_color(), TREEVIEW_Command(), TREEVIEW_EditLabel(), TREEVIEW_EnsureVisible(), TREEVIEW_UpdateDispInfo(), TREEVIEW_UpdateScrollBars(), TREEVIEW_VScroll(), triangle(), TRIO_ARGS2(), TRIO_ARGS5(), tt_face_get_kerning(), type_buffer_alignment(), UDFAddXSpaceBitmap(), UDFCompleteMount(), UDFEjectReqWaiter(), UDFGetDiskInfo(), UDFGetFreeSpace(), UDFLoadLogicalVolInt(), UDFQueryFsFullSizeInfo(), UDFQueryFsSizeInfo(), UDFReadAndProcessFullToc(), UDFReadDiscTrackInfo(), UDFReadEntityID_Domain(), UDFRelocateSector(), UDFRemapPacket(), UDFUnmapRange(), UDFUpdateLogicalVol(), UDFUpdateLogicalVolInt(), UDFUpdateVolIdent(), UDFUseStandard(), UDFVerifyXSpaceBitmap(), UmaMgrInitialize(), uncompress2(), UniataAhciDetect(), UniataAhciSetupCmdPtr(), UniataQueueRequest(), UnionRect(), update_min_band_height(), update_preview_sizes(), UpdateScrollbox(), UpdateSelection(), CStartButton::UpdateSize(), UpdateWindowScrollState(), UsbAudioGetDataRanges(), USBSTOR_FdoHandleDeviceRelations(), UserClipCursor(), usp10_array_reserve(), UXTHEME_LoadImage(), validate_indices(), VARIANT_FormatNumber(), VARIANT_UserMarshal(), VerQueryValueW(), vfatMakeFullName(), VGADDI_ComputePointerRect(), VGADDI_IntersectRect(), VGADDIIntersectRect(), VgaMarkForUpdate(), vgaNEtoSW(), vgaNWtoSE(), vgaSEtoNW(), vgaSWtoNE(), VidBiosScrollWindow(), volumetexture_init(), warp_check(), WCacheInit__(), weld_dec3n(), weld_float16_2(), weld_float16_4(), weld_float2(), weld_float3(), weld_float4(), weld_short2(), weld_short4(), weld_ubyte4(), weld_udec3(), weld_ushort2n(), weld_ushort4n(), whilePaintingL(), WhoamiGroups(), WhoamiPrintTable(), wined3d_array_reserve(), wined3d_cs_st_require_space(), wined3d_device_update_texture(), wined3d_get_device_caps(), wined3d_sampler_desc_from_sampler_states(), wined3d_swapchain_desc_from_present_parameters(), wined3d_texture_get_level_depth(), wined3d_texture_get_level_height(), wined3d_texture_get_level_pow2_height(), wined3d_texture_get_level_pow2_width(), wined3d_texture_get_level_width(), wined3d_texture_init(), WINHELP_ButtonBoxWndProc(), WINHELP_GetPopupWindowInfo(), WinPosFixupFlags(), WinPosGetMinMaxInfo(), WinPrev_OnDraw(), WndProc(), wnetInit(), write_file2(), write_new_procformatstring_type(), x86_64_find_runtime_function(), xbuf_resize(), xHalExamineMBR(), xHalIoReadPartitionTable(), xHalIoSetPartitionInformation(), xHalIoWritePartitionTable(), xmlParseNmtoken(), xmlParseStringName(), xmlSaveUri(), xmlSplitQName(), xprt_register(), xsltGetProfileInformation(), xsltNumberFormat(), xsltSaveProfiling(), and zoomTo().

#define RQCRED_SIZE   400 /* this size is excessive */

Definition at line 57 of file svc.c.

Referenced by svc_getreq_common().

#define SVC_VERSQUIET   0x0001 /* keep quiet about vers mismatch */

Definition at line 59 of file svc.c.

#define version_keepquiet (   xp)    ((u_long)(xp)->xp_p3 & SVC_VERSQUIET)

Definition at line 60 of file svc.c.

Function Documentation

static void __xprt_do_unregister ( SVCXPRT xprt,
bool_t  dolock 
)
static

Definition at line 143 of file svc.c.

Referenced by __xprt_unregister_unlocked(), and xprt_unregister().

146 {
147  SOCKET sock;
148 
149  assert (xprt != NULL);
150 
151  sock = xprt->xp_fd;
152 
153 #ifndef _WIN32
154  if (dolock)
156  if ((sock < FD_SETSIZE) && (__svc_xports[sock] == xprt)) {
158  FD_CLR (sock, &svc_fdset);
159  if (sock >= svc_maxfd) {
160  for (svc_maxfd--; svc_maxfd >= 0; svc_maxfd--)
161  if (__svc_xports[svc_maxfd])
162  break;
163  }
164  }
165  if (dolock)
167 #else
168  fprintf(stderr, "%s: Yikes! Figure out __svc_xports[] issue!!\n", __FUNCTION__);
169 #endif
170 }
static SOCKET sock
Definition: syslog.c:45
#define rwlock_wrlock(l)
Definition: reentrant.h:140
SVCXPRT ** __svc_xports
Definition: rpc_com.h:96
fd_set svc_fdset
#define assert(x)
Definition: debug.h:53
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define rwlock_unlock(l)
Definition: reentrant.h:142
smooth NULL
Definition: ftsmooth.c:557
#define FD_SETSIZE
Definition: winsock.h:50
SOCKET xp_fd
Definition: svc.h:91
rwlock_t svc_fd_lock
Definition: mt_misc.c:22
int svc_maxfd
FILE * stderr
#define FD_CLR(fd, set)
Definition: winsock.h:74
UINT_PTR SOCKET
Definition: winsock.h:47
#define __FUNCTION__
Definition: compiler.h:205
void __xprt_unregister_unlocked ( SVCXPRT xprt)

Definition at line 134 of file svc.c.

Referenced by __svc_clean_idle().

135 {
136  __xprt_do_unregister (xprt, FALSE);
137 }
#define FALSE
Definition: types.h:117
static void __xprt_do_unregister(SVCXPRT *xprt, bool_t dolock)
Definition: svc.c:143
bool_t rpc_control ( int  what,
void arg 
)

Definition at line 784 of file svc.c.

785 {
786  int val;
787 
788  switch (what)
789  {
791  val = *(int *) arg;
792  if (val <= 0)
793  return FALSE;
794  __svc_maxrec = val;
795  return TRUE;
797  *(int *) arg = __svc_maxrec;
798  return TRUE;
799  default:
800  break;
801  }
802  return FALSE;
803 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define RPC_SVC_CONNMAXREC_SET
Definition: svc.h:78
GLuint GLfloat * val
Definition: glext.h:7180
#define RPC_SVC_CONNMAXREC_GET
Definition: svc.h:79
int __svc_maxrec
Definition: rpc_com.h:97
static struct svc_callout * svc_find ( rpcprog_t  prog,
rpcvers_t  vers,
struct svc_callout **  prev,
char netid 
)
static

Definition at line 370 of file svc.c.

Referenced by svc_reg(), and svc_unreg().

375 {
376  struct svc_callout *s, *p;
377 
378  assert (prev != NULL);
379 
380  p = NULL;
381  for (s = svc_head; s != NULL; s = s->sc_next)
382  {
383  if (((s->sc_prog == prog) && (s->sc_vers == vers)) &&
384  ((netid == NULL) || (s->sc_netid == NULL) ||
385  (strcmp (netid, s->sc_netid) == 0)))
386  break;
387  p = s;
388  }
389  *prev = p;
390  return (s);
391 }
char * sc_netid
Definition: svc.c:77
char * prog
Definition: isohybrid.c:47
#define assert(x)
Definition: debug.h:53
static struct svc_callout * svc_head
smooth NULL
Definition: ftsmooth.c:557
GLdouble s
Definition: gl.h:2039
rpcvers_t sc_vers
Definition: svc.c:76
struct svc_callout * sc_next
Definition: svc.c:74
rpcprog_t sc_prog
Definition: svc.c:75
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
GLfloat GLfloat p
Definition: glext.h:8902
void svc_getreq ( int  rdfds)

Definition at line 604 of file svc.c.

606 {
607  fd_set readfds;
608 
609  FD_ZERO (&readfds);
610  //XXX Windows!! readfds.fds_bits[0] = rdfds;
611  svc_getreqset (&readfds);
612 }
Definition: winsock.h:66
#define FD_ZERO(set)
Definition: winsock.h:96
void svc_getreqset(fd_set *readfds)
Definition: svc.c:615
void svc_getreq_common ( SOCKET  fd)

Definition at line 641 of file svc.c.

Referenced by clnt_raw_call(), svc_getreq_poll(), and svc_getreqset().

642 {
643  SVCXPRT *xprt;
644  struct svc_req r;
645  struct rpc_msg msg;
646  int prog_found;
647  rpcvers_t low_vers;
648  rpcvers_t high_vers;
649  enum xprt_stat stat;
650  char cred_area[2 * MAX_AUTH_BYTES + RQCRED_SIZE];
651 
652  msg.rm_call.cb_cred.oa_base = cred_area;
653  msg.rm_call.cb_verf.oa_base = &(cred_area[MAX_AUTH_BYTES]);
654  r.rq_clntcred = &(cred_area[2 * MAX_AUTH_BYTES]);
655 
657  xprt = __svc_xports[fd];
659  if (xprt == NULL)
660  /* But do we control sock? */
661  return;
662  /* now receive msgs from xprtprt (support batch calls) */
663  do
664  {
665  if (SVC_RECV (xprt, &msg))
666  {
667 
668  /* now find the exported program and call it */
669  struct svc_callout *s;
670  enum auth_stat why;
671 
672  r.rq_xprt = xprt;
673  r.rq_prog = msg.rm_call.cb_prog;
674  r.rq_vers = msg.rm_call.cb_vers;
675  r.rq_proc = msg.rm_call.cb_proc;
676  r.rq_cred = msg.rm_call.cb_cred;
677  /* first authenticate the message */
678  if ((why = _authenticate (&r, &msg)) != AUTH_OK)
679  {
680  svcerr_auth (xprt, why);
681  goto call_done;
682  }
683  /* now match message with a registered service */
684  prog_found = FALSE;
685  low_vers = (rpcvers_t) - 1L;
686  high_vers = (rpcvers_t) 0L;
687  for (s = svc_head; s != NULL; s = s->sc_next)
688  {
689  if (s->sc_prog == r.rq_prog)
690  {
691  if (s->sc_vers == r.rq_vers)
692  {
693  (*s->sc_dispatch) (&r, xprt);
694  goto call_done;
695  } /* found correct version */
696  prog_found = TRUE;
697  if (s->sc_vers < low_vers)
698  low_vers = s->sc_vers;
699  if (s->sc_vers > high_vers)
700  high_vers = s->sc_vers;
701  } /* found correct program */
702  }
703  /*
704  * if we got here, the program or version
705  * is not served ...
706  */
707  if (prog_found)
708  svcerr_progvers (xprt, low_vers, high_vers);
709  else
710  svcerr_noprog (xprt);
711  /* Fall through to ... */
712  }
713  /*
714  * Check if the xprt has been disconnected in a
715  * recursive call in the service dispatch routine.
716  * If so, then break.
717  */
719 
720  if (xprt != __svc_xports[fd])
721  {
723  break;
724  }
726  call_done:
727  if ((stat = SVC_STAT (xprt)) == XPRT_DIED)
728  {
729  SVC_DESTROY (xprt);
730  break;
731  }
732  else if ((xprt->xp_auth != NULL)
733 #ifdef HAVE_LIBGSSAPI
734  && (xprt->xp_auth->svc_ah_ops != &svc_auth_gss_ops)
735 #endif
736  ) {
737  xprt->xp_auth = NULL;
738  }
739  }
740  while (stat == XPRT_MOREREQS);
741 }
#define MAX_AUTH_BYTES
Definition: auth.h:77
#define TRUE
Definition: types.h:120
xprt_stat
Definition: svc.h:81
u_int32_t rpcvers_t
Definition: types.h:105
Definition: bidi.c:75
#define SVC_RECV(xprt, msg)
Definition: svc.h:159
SVCXPRT ** __svc_xports
Definition: rpc_com.h:96
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
Definition: svc.h:82
void(* sc_dispatch)(struct svc_req *, SVCXPRT *)
Definition: svc.c:78
static struct svc_callout * svc_head
#define RQCRED_SIZE
Definition: svc.c:57
#define SVC_STAT(xprt)
Definition: svc.h:164
#define FALSE
Definition: types.h:117
#define rwlock_unlock(l)
Definition: reentrant.h:142
auth_stat
Definition: auth.h:144
Definition: auth.h:145
smooth NULL
Definition: ftsmooth.c:557
void svcerr_progvers(SVCXPRT *xprt, rpcvers_t low_vers, rpcvers_t high_vers)
Definition: svc.c:567
#define SVC_DESTROY(xprt)
Definition: svc.h:184
rwlock_t svc_fd_lock
Definition: mt_misc.c:22
SVCAUTH * xp_auth
Definition: svc.h:122
struct svc_auth_ops svc_auth_gss_ops
Definition: svc_auth_gss.c:60
struct __svcauth::svc_auth_ops * svc_ah_ops
enum auth_stat _authenticate(struct svc_req *rqst, struct rpc_msg *msg)
Definition: svc_auth.c:86
GLdouble s
Definition: gl.h:2039
rpcvers_t sc_vers
Definition: svc.c:76
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
static HANDLE fd
Definition: io.c:55
void svcerr_noprog(SVCXPRT *xprt)
Definition: svc.c:549
Definition: svc.h:132
#define rwlock_rdlock(l)
Definition: reentrant.h:139
struct svc_callout * sc_next
Definition: svc.c:74
rpcprog_t sc_prog
Definition: svc.c:75
UINT msg
Definition: msvc.h:92
void svcerr_auth(SVCXPRT *xprt, enum auth_stat why)
Definition: svc.c:517
void svc_getreq_poll ( struct pollfd pfdp,
int  pollretval 
)

Definition at line 745 of file svc.c.

748 {
749  int i;
750  int fds_found;
751 
752  for (i = fds_found = 0; fds_found < pollretval; i++)
753  {
754  struct pollfd *p = &pfdp[i];
755 
756  if (p->revents)
757  {
758  /* fd has input waiting */
759  fds_found++;
760  /*
761  * We assume that this function is only called
762  * via someone _select()ing from svc_fdset or
763  * _poll()ing from svc_pollset[]. Thus it's safe
764  * to handle the POLLNVAL event by simply turning
765  * the corresponding bit off in svc_fdset. The
766  * svc_pollset[] array is derived from svc_fdset
767  * and so will also be updated eventually.
768  *
769  * XXX Should we do an xprt_unregister() instead?
770  */
771  if (p->revents & POLLNVAL)
772  {
774  FD_CLR (p->fd, &svc_fdset);
776  }
777  else
778  svc_getreq_common (p->fd);
779  }
780  }
781 }
#define rwlock_wrlock(l)
Definition: reentrant.h:140
fd_set svc_fdset
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define rwlock_unlock(l)
Definition: reentrant.h:142
rwlock_t svc_fd_lock
Definition: mt_misc.c:22
Definition: linux.h:1867
#define POLLNVAL
Definition: linux.h:1858
int fd
Definition: linux.h:1868
void svc_getreq_common(SOCKET fd)
Definition: svc.c:641
short revents
Definition: linux.h:1870
#define FD_CLR(fd, set)
Definition: winsock.h:74
GLfloat GLfloat p
Definition: glext.h:8902
void svc_getreqset ( fd_set readfds)

Definition at line 615 of file svc.c.

Referenced by svc_getreq(), and svc_run().

617 {
618 #ifndef _WIN32
619  int bit, fd;
620  fd_mask mask, *maskp;
621  int sock;
622 
623  assert (readfds != NULL);
624 
625  maskp = readfds->fds_bits;
626  for (sock = 0; sock < FD_SETSIZE; sock += NFDBITS)
627  {
628  for (mask = *maskp++; (bit = ffs (mask)) != 0; mask ^= (1 << (bit - 1)))
629  {
630  /* sock has input waiting */
631  fd = sock + bit - 1;
632  svc_getreq_common (fd);
633  }
634  }
635 #else
636  fprintf(stderr, "%s: Yikes!\n", __FUNCTION__);
637 #endif
638 }
static SOCKET sock
Definition: syslog.c:45
int ffs(int x)
#define assert(x)
Definition: debug.h:53
GLuint const GLubyte mask[]
Definition: s_context.h:57
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
smooth NULL
Definition: ftsmooth.c:557
#define FD_SETSIZE
Definition: winsock.h:50
static HANDLE fd
Definition: io.c:55
void svc_getreq_common(SOCKET fd)
Definition: svc.c:641
FILE * stderr
#define __FUNCTION__
Definition: compiler.h:205
bool_t svc_reg ( SVCXPRT xprt,
const rpcprog_t  prog,
const rpcvers_t  vers,
void dispatch,
const struct netconfig nconf 
)

Definition at line 178 of file svc.c.

Referenced by rpc_reg(), svc_create(), and svc_tp_create().

184 {
185  bool_t dummy;
186  struct svc_callout *prev;
187  struct svc_callout *s;
188  struct netconfig *tnconf;
189  char *netid = NULL;
190  int flag = 0;
191 
192 /* VARIABLES PROTECTED BY svc_lock: s, prev, svc_head */
193  if (xprt->xp_netid)
194  {
195  netid = strdup (xprt->xp_netid);
196  flag = 1;
197  }
198  else if (nconf && nconf->nc_netid)
199  {
200  netid = strdup (nconf->nc_netid);
201  flag = 1;
202  }
203  else if ((tnconf = __rpcgettp (xprt->xp_fd)) != NULL)
204  {
205  netid = strdup (tnconf->nc_netid);
206  flag = 1;
207  freenetconfigent (tnconf);
208  } /* must have been created with svc_raw_create */
209  if ((netid == NULL) && (flag == 1))
210  {
211  return (FALSE);
212  }
213 
215  if ((s = svc_find (prog, vers, &prev, netid)) != NULL)
216  {
217  if (netid)
218  free (netid);
219  if (s->sc_dispatch == dispatch)
220  goto rpcb_it; /* he is registering another xptr */
222  return (FALSE);
223  }
224  s = mem_alloc (sizeof (struct svc_callout));
225  if (s == NULL)
226  {
227  if (netid)
228  free (netid);
230  return (FALSE);
231  }
232 
233  s->sc_prog = prog;
234  s->sc_vers = vers;
235  s->sc_dispatch = dispatch;
236  s->sc_netid = netid;
237  s->sc_next = svc_head;
238  svc_head = s;
239 
240  if ((xprt->xp_netid == NULL) && (flag == 1) && netid)
241  ((SVCXPRT *) xprt)->xp_netid = strdup (netid);
242 
243 rpcb_it:
245  /* now register the information with the local binder service */
246  if (nconf)
247  {
248  /*LINTED const castaway */
249  dummy = rpcb_set (prog, vers, (struct netconfig *) nconf,
250  &((SVCXPRT *) xprt)->xp_ltaddr);
251  return (dummy);
252  }
253  return (TRUE);
254 }
char * sc_netid
Definition: svc.c:77
#define TRUE
Definition: types.h:120
#define rwlock_wrlock(l)
Definition: reentrant.h:140
int32_t bool_t
Definition: types.h:101
char * prog
Definition: isohybrid.c:47
#define free
Definition: debug_ros.c:5
void(* sc_dispatch)(struct svc_req *, SVCXPRT *)
Definition: svc.c:78
static struct svc_callout * svc_head
#define mem_alloc(bsize)
Definition: types.h:123
#define FALSE
Definition: types.h:117
#define rwlock_unlock(l)
Definition: reentrant.h:142
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
void freenetconfigent(struct netconfig *netconfigp)
Definition: getnetconfig.c:530
bool_t rpcb_set(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf, const struct netbuf *address)
Definition: rpcb_clnt.c:520
smooth NULL
Definition: ftsmooth.c:557
struct netconfig * __rpcgettp(SOCKET)
Definition: rpc_generic.c:464
void dispatch(void)
Definition: dispatch.c:66
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean flag
Definition: glfuncs.h:72
SOCKET xp_fd
Definition: svc.h:91
char * nc_netid
Definition: netconfig.h:11
GLdouble s
Definition: gl.h:2039
rpcvers_t sc_vers
Definition: svc.c:76
unsigned char dummy
Definition: maze.c:118
struct svc_callout * sc_next
Definition: svc.c:74
rpcprog_t sc_prog
Definition: svc.c:75
char * xp_netid
Definition: svc.h:118
static struct svc_callout * svc_find(rpcprog_t, rpcvers_t, struct svc_callout **, char *)
Definition: svc.c:370
rwlock_t svc_lock
Definition: mt_misc.c:19
bool_t svc_sendreply ( SVCXPRT xprt,
xdrproc_t  xdr_results,
void xdr_location 
)

Definition at line 399 of file svc.c.

Referenced by _svcauth_gss(), and universal().

403 {
404  struct rpc_msg rply;
405 
406  assert (xprt != NULL);
407 
408  rply.rm_direction = REPLY;
409  rply.rm_reply.rp_stat = MSG_ACCEPTED;
410  rply.acpted_rply.ar_verf = xprt->xp_verf;
411  rply.acpted_rply.ar_stat = SUCCESS;
412  rply.acpted_rply.ar_results.where = xdr_location;
413  rply.acpted_rply.ar_results.proc = xdr_results;
414  return (SVC_REPLY (xprt, &rply));
415 }
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:557
#define SVC_REPLY(xprt, msg)
Definition: svc.h:174
Definition: rpc_msg.h:79
struct opaque_auth xp_verf
Definition: svc.h:121
void svc_unreg ( rpcprog_t  prog,
const rpcvers_t  vers 
) const

Definition at line 260 of file svc.c.

263 {
264  struct svc_callout *prev;
265  struct svc_callout *s;
266 
267  /* unregister the information anyway */
268  (void) rpcb_unset (prog, vers, NULL);
270  while ((s = svc_find (prog, vers, &prev, NULL)) != NULL)
271  {
272  if (prev == NULL)
273  {
274  svc_head = s->sc_next;
275  }
276  else
277  {
278  prev->sc_next = s->sc_next;
279  }
280  s->sc_next = NULL;
281  if (s->sc_netid)
282  mem_free (s->sc_netid, sizeof (s->sc_netid) + 1);
283  mem_free (s, sizeof (struct svc_callout));
284  }
286 }
char * sc_netid
Definition: svc.c:77
#define rwlock_wrlock(l)
Definition: reentrant.h:140
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
char * prog
Definition: isohybrid.c:47
static struct svc_callout * svc_head
#define rwlock_unlock(l)
Definition: reentrant.h:142
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
smooth NULL
Definition: ftsmooth.c:557
bool_t rpcb_unset(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf)
Definition: rpcb_clnt.c:581
GLdouble s
Definition: gl.h:2039
struct svc_callout * sc_next
Definition: svc.c:74
#define mem_free(ptr, bsize)
Definition: types.h:124
static struct svc_callout * svc_find(rpcprog_t, rpcvers_t, struct svc_callout **, char *)
Definition: svc.c:370
rwlock_t svc_lock
Definition: mt_misc.c:19
void svcerr_auth ( SVCXPRT xprt,
enum auth_stat  why 
)

Definition at line 517 of file svc.c.

Referenced by svc_getreq_common(), and svcerr_weakauth().

520 {
521  struct rpc_msg rply;
522 
523  assert (xprt != NULL);
524 
525  rply.rm_direction = REPLY;
526  rply.rm_reply.rp_stat = MSG_DENIED;
527  rply.rjcted_rply.rj_stat = AUTH_ERROR;
528  rply.rjcted_rply.rj_why = why;
529  SVC_REPLY (xprt, &rply);
530 }
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:557
#define SVC_REPLY(xprt, msg)
Definition: svc.h:174
Definition: rpc_msg.h:79
void svcerr_decode ( SVCXPRT xprt)

Definition at line 439 of file svc.c.

Referenced by universal().

441 {
442  struct rpc_msg rply;
443 
444  assert (xprt != NULL);
445 
446  rply.rm_direction = REPLY;
447  rply.rm_reply.rp_stat = MSG_ACCEPTED;
448  rply.acpted_rply.ar_verf = xprt->xp_verf;
449  rply.acpted_rply.ar_stat = GARBAGE_ARGS;
450  SVC_REPLY (xprt, &rply);
451 }
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:557
#define SVC_REPLY(xprt, msg)
Definition: svc.h:174
Definition: rpc_msg.h:79
struct opaque_auth xp_verf
Definition: svc.h:121
void svcerr_noproc ( SVCXPRT xprt)

Definition at line 421 of file svc.c.

423 {
424  struct rpc_msg rply;
425 
426  assert (xprt != NULL);
427 
428  rply.rm_direction = REPLY;
429  rply.rm_reply.rp_stat = MSG_ACCEPTED;
430  rply.acpted_rply.ar_verf = xprt->xp_verf;
431  rply.acpted_rply.ar_stat = PROC_UNAVAIL;
432  SVC_REPLY (xprt, &rply);
433 }
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:557
#define SVC_REPLY(xprt, msg)
Definition: svc.h:174
Definition: rpc_msg.h:79
struct opaque_auth xp_verf
Definition: svc.h:121
void svcerr_noprog ( SVCXPRT xprt)

Definition at line 549 of file svc.c.

Referenced by svc_getreq_common().

551 {
552  struct rpc_msg rply;
553 
554  assert (xprt != NULL);
555 
556  rply.rm_direction = REPLY;
557  rply.rm_reply.rp_stat = MSG_ACCEPTED;
558  rply.acpted_rply.ar_verf = xprt->xp_verf;
559  rply.acpted_rply.ar_stat = PROG_UNAVAIL;
560  SVC_REPLY (xprt, &rply);
561 }
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:557
#define SVC_REPLY(xprt, msg)
Definition: svc.h:174
Definition: rpc_msg.h:79
struct opaque_auth xp_verf
Definition: svc.h:121
void svcerr_progvers ( SVCXPRT xprt,
rpcvers_t  low_vers,
rpcvers_t  high_vers 
)

Definition at line 567 of file svc.c.

Referenced by svc_getreq_common().

571 {
572  struct rpc_msg rply;
573 
574  assert (xprt != NULL);
575 
576  rply.rm_direction = REPLY;
577  rply.rm_reply.rp_stat = MSG_ACCEPTED;
578  rply.acpted_rply.ar_verf = xprt->xp_verf;
579  rply.acpted_rply.ar_stat = PROG_MISMATCH;
580  rply.acpted_rply.ar_vers.low = (u_int32_t) low_vers;
581  rply.acpted_rply.ar_vers.high = (u_int32_t) high_vers;
582  SVC_REPLY (xprt, &rply);
583 }
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:557
#define SVC_REPLY(xprt, msg)
Definition: svc.h:174
Definition: rpc_msg.h:79
struct opaque_auth xp_verf
Definition: svc.h:121
#define u_int32_t
Definition: icmp.c:53
void svcerr_systemerr ( SVCXPRT xprt)

Definition at line 457 of file svc.c.

459 {
460  struct rpc_msg rply;
461 
462  assert (xprt != NULL);
463 
464  rply.rm_direction = REPLY;
465  rply.rm_reply.rp_stat = MSG_ACCEPTED;
466  rply.acpted_rply.ar_verf = xprt->xp_verf;
467  rply.acpted_rply.ar_stat = SYSTEM_ERR;
468  SVC_REPLY (xprt, &rply);
469 }
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:557
#define SVC_REPLY(xprt, msg)
Definition: svc.h:174
Definition: rpc_msg.h:79
struct opaque_auth xp_verf
Definition: svc.h:121
void svcerr_weakauth ( SVCXPRT xprt)

Definition at line 536 of file svc.c.

538 {
539 
540  assert (xprt != NULL);
541 
542  svcerr_auth (xprt, AUTH_TOOWEAK);
543 }
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:557
void svcerr_auth(SVCXPRT *xprt, enum auth_stat why)
Definition: svc.c:517
void xprt_register ( SVCXPRT xprt)

Definition at line 97 of file svc.c.

Referenced by makefd_xprt(), svc_dg_create(), svc_raw_create(), and svc_vc_create().

99 {
100  SOCKET sock;
101 
102  assert (xprt != NULL);
103 
104  sock = xprt->xp_fd;
105 
107  if (__svc_xports == NULL) {
108  __svc_xports = (SVCXPRT **) mem_alloc (FD_SETSIZE * sizeof (SVCXPRT *));
109  if (__svc_xports == NULL) {
110  // XXX Give an error indication?
111  return;
112  }
113  memset (__svc_xports, 0, FD_SETSIZE * sizeof (SVCXPRT *));
114  }
115 #ifndef _WIN32
116  if (sock < FD_SETSIZE) {
117  __svc_xports[sock] = xprt;
118  FD_SET (sock, &svc_fdset);
119  svc_maxfd = max (svc_maxfd, sock);
120  }
121 #else
122  fprintf(stderr, "%s: Yikes! Figure out __svc_xports[] issue!!\n", __FUNCTION__);
123 #endif
125 }
#define max(a, b)
Definition: svc.c:63
static SOCKET sock
Definition: syslog.c:45
#define rwlock_wrlock(l)
Definition: reentrant.h:140
SVCXPRT ** __svc_xports
Definition: rpc_com.h:96
fd_set svc_fdset
#define assert(x)
Definition: debug.h:53
#define FD_SET(fd, set)
Definition: winsock.h:89
#define mem_alloc(bsize)
Definition: types.h:123
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define rwlock_unlock(l)
Definition: reentrant.h:142
smooth NULL
Definition: ftsmooth.c:557
#define FD_SETSIZE
Definition: winsock.h:50
SOCKET xp_fd
Definition: svc.h:91
rwlock_t svc_fd_lock
Definition: mt_misc.c:22
int svc_maxfd
FILE * stderr
UINT_PTR SOCKET
Definition: winsock.h:47
#define __FUNCTION__
Definition: compiler.h:205
#define memset(x, y, z)
Definition: compat.h:39
void xprt_unregister ( SVCXPRT xprt)

Definition at line 128 of file svc.c.

Referenced by svc_dg_destroy(), and svc_vc_destroy().

129 {
130  __xprt_do_unregister (xprt, TRUE);
131 }
#define TRUE
Definition: types.h:120
static void __xprt_do_unregister(SVCXPRT *xprt, bool_t dolock)
Definition: svc.c:143

Variable Documentation

rwlock_t svc_fd_lock

Definition at line 22 of file mt_misc.c.

struct svc_callout * svc_head
static
rwlock_t svc_lock

Definition at line 19 of file mt_misc.c.