OpenTransportProtocol.pas 139 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975
  1. {
  2. File: OT/OpenTransportProtocol.h
  3. Contains: Definitions likely to be used by low-level protocol stack implementation.
  4. Version: OpenTransport-97~544
  5. Copyright: © 1993-2005 by Apple Computer, Inc. and Mentat Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation Updated: Peter N Lewis, <[email protected]>, November 2005 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit OpenTransportProtocol;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,ConditionalMacros,Files,CodeFragments,OpenTransport;
  92. {$ALIGN MAC68K}
  93. { ***** Setup Default Compiler Variables *****}
  94. {
  95. OTKERNEL is used to indicate whether the code is being built
  96. for the kernel environment. It defaults to 0. If you include
  97. "OpenTransportKernel.h" before including this file,
  98. it will be 1 and you will only be able to see stuff available
  99. to kernel code.
  100. As we've included "OpenTransport.h" and it defaults this variable
  101. to 0 if it's not already been defined, it should always be defined
  102. by the time we get here. So we just assert that. Assertions in
  103. header files! Cool (-:
  104. }
  105. {$ifc undefined OTKERNEL}
  106. {$setc OTKERNEL := 0}
  107. {$endc}
  108. { ***** Shared Client Memory *****}
  109. {$ifc NOT OTKERNEL}
  110. {
  111. These allocators allocate memory in the shared client pool,
  112. which is shared between all clients and is not disposed when
  113. a particular client goes away. See DTS Technote ¥¥¥
  114. "Understanding Open Transport Memory Management" for details.
  115. }
  116. {
  117. * OTAllocSharedClientMem()
  118. *
  119. * Availability:
  120. * Mac OS X: not available
  121. * CarbonLib: not available
  122. * Non-Carbon CFM: not available
  123. }
  124. {
  125. * OTFreeSharedClientMem()
  126. *
  127. * Availability:
  128. * Mac OS X: not available
  129. * CarbonLib: not available
  130. * Non-Carbon CFM: not available
  131. }
  132. {$endc} { !OTKERNEL }
  133. { ***** UNIX Types *****}
  134. {$ifc CALL_NOT_IN_CARBON}
  135. {
  136. On UNIX, uid_t and gid_t are defined to be big enough
  137. to hold a user ID and group ID respectively. As Mac OS
  138. has no such concepts, we just define them as UInt32 place
  139. holders.
  140. }
  141. type
  142. uid_t = UInt32;
  143. gid_t = UInt32;
  144. { Similarly, dev_t is a UNIX type for denoting a device number.}
  145. type
  146. dev_t = UInt32;
  147. { ***** From the Mentat "strstat.h" *****}
  148. { module statistics structure }
  149. type
  150. module_statPtr = ^module_stat;
  151. module_stat = record
  152. ms_pcnt: SInt32; { count of calls to put proc }
  153. ms_scnt: SInt32; { count of calls to service proc }
  154. ms_ocnt: SInt32; { count of calls to open proc }
  155. ms_ccnt: SInt32; { count of calls to close proc }
  156. ms_acnt: SInt32; { count of calls to admin proc }
  157. ms_xptr: UnivPtr; { pointer to private statistics }
  158. ms_xsize: SInt16; { length of private statistics buffer }
  159. end;
  160. { ***** From the Mentat "cred.h" *****}
  161. type
  162. credPtr = ^cred;
  163. cred = record
  164. cr_ref: UInt16; { reference count on processes using cred structures }
  165. cr_ngroups: UInt16; { number of groups in cr_groups }
  166. cr_uid: uid_t; { effective user id }
  167. cr_gid: gid_t; { effective group id }
  168. cr_ruid: uid_t; { real user id }
  169. cr_rgid: gid_t; { real group id }
  170. cr_suid: uid_t; { user id saved by exec }
  171. cr_sgid: gid_t; { group id saved by exec }
  172. cr_groups: array [0..0] of gid_t; { supplementary groups list }
  173. end;
  174. type
  175. cred_t = cred;
  176. { Free return structure for esballoc }
  177. type
  178. FreeFuncType = procedure( var arg: char );
  179. free_rtnPtr = ^free_rtn;
  180. free_rtn = record
  181. free_func: FreeFuncType; { Routine to call to free buffer }
  182. free_arg: UnivPtr; { Parameter to free_func }
  183. end;
  184. type
  185. frtn_t = free_rtn;
  186. frtn_tPtr = ^frtn_t;
  187. { data descriptor }
  188. type
  189. databPtr = ^datab;
  190. datab_db_f = record
  191. case SInt16 of
  192. 0: (
  193. freep: databPtr;
  194. );
  195. 1: (
  196. frtnp: free_rtnPtr;
  197. );
  198. end;
  199. datab_db_fPtr = ^datab_db_f;
  200. datab = record
  201. db_f: datab_db_f;
  202. db_base: UInt8Ptr; { first byte of buffer }
  203. db_lim: UInt8Ptr; { last byte+1 of buffer }
  204. db_ref: UInt8; { count of messages pointing to block}
  205. db_type: UInt8; { message type }
  206. db_iswhat: UInt8; { message status }
  207. db_filler2: UInt8; { for spacing }
  208. db_size: UInt32; { used internally }
  209. db_msgaddr: UInt8Ptr; { used internally }
  210. db_filler: SInt32;
  211. end;
  212. type
  213. dblk_t = datab;
  214. dblk_tPtr = ^dblk_t;
  215. { message block }
  216. type
  217. msgbPtr = ^msgb;
  218. msgb = record
  219. b_next: struct msgb *; { next message on queue }
  220. b_prev: struct msgb *; { previous message on queue }
  221. b_cont: struct msgb *; { next message block of message }
  222. b_rptr: UInt8Ptr; { first unread data byte in buffer }
  223. b_wptr: UInt8Ptr; { first unwritten data byte }
  224. b_datap: databPtr; { data block }
  225. b_band: UInt8; { message priority }
  226. b_pad1: UInt8;
  227. b_flag: UInt16;
  228. end;
  229. type
  230. mblk_t = msgb;
  231. mblk_tPtr = ^mblk_t;
  232. { mblk flags }
  233. const
  234. MSGMARK = $01; { last byte of message is tagged }
  235. MSGNOLOOP = $02; { don't pass message to write-side of stream }
  236. MSGDELIM = $04; { message is delimited }
  237. MSGNOGET = $08;
  238. { STREAMS environments are expected to define these constants in a public header file.}
  239. const
  240. STRCTLSZ = 256; { Maximum Control buffer size for messages }
  241. STRMSGSZ = 8192; { Maximum # data bytes for messages }
  242. { Message types }
  243. const
  244. QNORM = 0;
  245. M_DATA = 0; { Ordinary data }
  246. M_PROTO = 1; { Internal control info and data }
  247. M_BREAK = $08; { Request a driver to send a break }
  248. M_PASSFP = $09; { Used to pass a file pointer }
  249. M_SIG = $0B; { Requests a signal to be sent }
  250. M_DELAY = $0C; { Request a real-time delay }
  251. M_CTL = $0D; { For inter-module communication }
  252. M_IOCTL = $0E; { Used internally for I_STR requests }
  253. M_SETOPTS = $10; { Alters characteristics of Stream head }
  254. M_RSE = $11; { Reserved for internal use }
  255. { MPS private type }
  256. const
  257. M_MI = $40;
  258. M_MI_READ_RESET = 1;
  259. M_MI_READ_SEEK = 2;
  260. M_MI_READ_END = 4;
  261. { Priority messages types }
  262. const
  263. QPCTL = $80;
  264. M_IOCACK = $81; { Positive ack of previous M_IOCTL }
  265. M_IOCNAK = $82; { Previous M_IOCTL failed }
  266. M_PCPROTO = $83; { Same as M_PROTO except for priority }
  267. M_PCSIG = $84; { Priority signal }
  268. M_FLUSH = $86; { Requests modules to flush queues }
  269. M_STOP = $87; { Request drivers to stop output }
  270. M_START = $88; { Request drivers to start output }
  271. M_HANGUP = $89; { Driver can no longer produce data }
  272. M_ERROR = $8A; { Reports downstream error condition }
  273. M_READ = $8B; { Reports client read at Stream head }
  274. M_COPYIN = $8C; { Requests the Stream to copy data in for a module }
  275. M_COPYOUT = $8D; { Requests the Stream to copy data out for a module }
  276. M_IOCDATA = $8E; { Status from M_COPYIN/M_COPYOUT message }
  277. M_PCRSE = $90; { Reserved for internal use }
  278. M_STOPI = $91; { Request drivers to stop input }
  279. M_STARTI = $92; { Request drivers to start input }
  280. M_HPDATA = $93; { MPS-private type; high priority data }
  281. { Defines for flush messages }
  282. const
  283. FLUSHALL = 1;
  284. FLUSHDATA = 0;
  285. const
  286. NOERROR = -1; { used in M_ERROR messages }
  287. type
  288. sth_sPtr = ^sth_s;
  289. sth_s = record
  290. dummy: UInt32;
  291. end;
  292. sqh_sPtr = ^sqh_s;
  293. sqh_s = record
  294. dummy: UInt32;
  295. end;
  296. q_xtraPtr = ^q_xtra;
  297. q_xtra = record
  298. dummy: UInt32;
  299. end;
  300. {$ifc OTKERNEL}
  301. {
  302. module_info is aligned differently on 68K than
  303. on PowerPC. Yucky. I can't defined a conditionalised
  304. pad field because a) you can't conditionalise specific
  305. fields in the interface definition language used to
  306. create Universal Interfaces, and b) lots of code
  307. assigns C structured constants to global variables
  308. of this type, and these assignments break if you
  309. add an extra field to the type. Instead, I
  310. set the alignment appropriately before defining the
  311. structure. The problem with doing that is that
  312. the interface definition language doesn't allow
  313. my to set the alignment in the middle of a file,
  314. so I have to do this via "pass throughs". This
  315. works fine for the well known languages (C, Pascal),
  316. but may cause problems for other languages (Java,
  317. Asm).
  318. }
  319. {$ALIGN POWER}
  320. type
  321. module_info = record
  322. mi_idnum: UInt16; { module ID number }
  323. mi_idname: UnivPtr; { module name }
  324. mi_minpsz: SInt32; { min pkt size, for developer use }
  325. mi_maxpsz: SInt32; { max pkt size, for developer use }
  326. mi_hiwat: UInt32; { hi-water mark, for flow control }
  327. mi_lowat: UInt32; { lo-water mark, for flow control }
  328. end;
  329. module_infoPtr = ^module_info;
  330. {$ALIGN MAC68K}
  331. type
  332. queuePtr = ^queue;
  333. admin_t = function: OTInt32;
  334. bufcall_t = procedure( size: SInt32 );
  335. bufcallp_t = procedure( size: SInt32 );
  336. closep_t = function( q: queuePtr; foo: OTInt32; var cred: cred_t ): OTInt32;
  337. old_closep_t = function( q: queuePtr ): OTInt32;
  338. openp_t = function( q: queuePtr; var dev: dev_t; foo: OTInt32; bar: OTInt32; var cred: cred_t ): OTInt32;
  339. openOld_t = function( q: queuePtr; dev: dev_t; foo: OTInt32; bar: OTInt32 ): OTInt32;
  340. old_openp_t = function( q: queuePtr; dev: dev_t; foo: OTInt32; bar: OTInt32 ): OTInt32;
  341. closeOld_t = function( q: queuePtr ): OTInt32;
  342. putp_t = function( q: queuePtr; var mp: msgb ): OTInt32;
  343. srvp_t = function( q: queuePtr ): OTInt32;
  344. qinitPtr = ^qinit;
  345. qinit = record
  346. qi_putp: putp_t; { put procedure }
  347. qi_srvp: srvp_t; { service procedure }
  348. qi_qopen: openp_t; { called on each open or a push }
  349. qi_qclose: closep_t; { called on last close or a pop }
  350. qi_qadmin: admin_t; { reserved for future use }
  351. qi_minfo: module_infoPtr; { information structure }
  352. qi_mstat: module_statPtr; { statistics structure - optional }
  353. end;
  354. { defines module or driver }
  355. streamtabPtr = ^streamtab;
  356. streamtab = record
  357. st_rdinit: qinitPtr; { defines read QUEUE }
  358. st_wrinit: qinitPtr; { defines write QUEUE }
  359. st_muxrinit: qinitPtr; { for multiplexing drivers only }
  360. st_muxwinit: qinitPtr; { ditto }
  361. end;
  362. qbandPtr = ^qband;
  363. qband = record
  364. qb_next: struct qband *; { next band for this queue }
  365. qb_count: UInt32; { weighted count of characters in this band }
  366. qb_first: msgbPtr; { head of message queue }
  367. qb_last: msgbPtr; { tail of message queue }
  368. qb_hiwat: UInt32; { high water mark }
  369. qb_lowat: UInt32; { low water mark }
  370. qb_flag: UInt16; { ¥¥¥Êstate }
  371. qb_pad1: SInt16; { ¥¥¥ reserved }
  372. end;
  373. qband_t = qband;
  374. qband_tPtr = ^qband_t;
  375. queue_q_uPtr = ^queue_q_u;
  376. queue_q_u = record
  377. case SInt16 of
  378. 0: (
  379. q_u_link: queuePtr; { link to scheduling queue }
  380. );
  381. 1: (
  382. q_u_sqh_parent: sqh_sPtr;
  383. );
  384. end;
  385. queue = record
  386. q_qinfo: qinitPtr; { procedures and limits for queue }
  387. q_first: msgbPtr; { head of message queue }
  388. q_last: msgbPtr; { tail of message queue }
  389. q_next: queuePtr; { next queue in Stream }
  390. q_u: queue_q_u;
  391. q_ptr: UnivPtr; { to private data structure }
  392. q_count: UInt32; { weighted count of characters on q }
  393. q_minpsz: SInt32; { min packet size accepted }
  394. q_maxpsz: SInt32; { max packet size accepted }
  395. q_hiwat: UInt32; { high water mark, for flow control }
  396. q_lowat: UInt32; { low water mark }
  397. q_bandp: qbandPtr; { band information }
  398. q_flag: UInt16; { ¥¥¥ queue state }
  399. q_nband: UInt8; { ¥¥¥ number of bands }
  400. q_pad1: SInt8; { ¥¥¥ reserved }
  401. q_osx: q_xtraPtr; { Pointer to OS-dependent extra stuff }
  402. q_ffcp: queuePtr; { Forward flow control pointer }
  403. q_bfcp: queuePtr; { Backward flow control pointer }
  404. end;
  405. queue_t = queue;
  406. queue_tPtr = ^queue_t;
  407. { queue_t flag defines }
  408. const
  409. QREADR = $01; { This queue is a read queue }
  410. QNOENB = $02; { Don't enable in putq }
  411. QFULL = $04; { The queue is full }
  412. QWANTR = $08; { The queue should be scheduled in the next putq }
  413. QWANTW = $10; { The stream should be back enabled when this queue drains }
  414. QUSE = $20; { The queue is allocated and ready for use }
  415. QENAB = $40; { The queue is scheduled (on the run queue) }
  416. QBACK = $80; { The queue has been back enabled }
  417. QOLD = $0100; { Module supports old style opens and closes }
  418. QHLIST = $0200; { The Stream head is doing something with this queue (Not supported by MPS) }
  419. QWELDED = $0400; { Mentat flag for welded queues }
  420. QUNWELDING = $0800; { Queue is scheduled to be unwelded }
  421. QPROTECTED = $1000; { Mentat flag for unsafe q access }
  422. QEXCOPENCLOSE = $2000; { Queue wants exclusive open/close calls }
  423. { qband_t flag defines }
  424. const
  425. QB_FULL = $01; { The band is full }
  426. QB_WANTW = $02; { The stream should be back enabled when this band/queue drains }
  427. QB_BACK = $04; { The queue has been back enabled }
  428. {$elsec}
  429. {
  430. Client code views a queue_t as a simple cookie.
  431. The real definition lives above and is only available
  432. to kernel code.
  433. }
  434. type
  435. queue_t = SInt32;
  436. queue_tPtr = ^queue_t;
  437. {$endc} {OTKERNEL}
  438. { structure contained in M_COPYIN/M_COPYOUT messages }
  439. type
  440. caddr_t = ^char;
  441. copyreqPtr = ^copyreq;
  442. copyreq = record
  443. cq_cmd: SInt32; { ioctl command (from ioc_cmd) }
  444. cq_cr: credPtr; { pointer to full credentials }
  445. cq_id: UInt32; { ioctl id (from ioc_id) }
  446. cq_addr: caddr_t; { address to copy data to/from }
  447. cq_size: UInt32; { number of bytes to copy }
  448. cq_flag: SInt32; { state }
  449. cq_private: mblk_tPtr; { private state information }
  450. cq_filler: array [0..3] of SInt32;
  451. end;
  452. { copyreq defines }
  453. const
  454. STRCANON = $01; { b_cont data block contains canonical format specifier }
  455. RECOPY = $02; { perform I_STR copyin again this time using canonical format specifier }
  456. { structure contained in M_IOCDATA message block }
  457. type
  458. copyrespPtr = ^copyresp;
  459. copyresp = record
  460. cp_cmd: SInt32; { ioctl command (from ioc_cmd) }
  461. cp_cr: credPtr; { pointer to full credentials }
  462. cp_id: UInt32; { ioctl id (from ioc_id) }
  463. cp_rval: caddr_t; { status of request; 0 for success; error value for failure }
  464. cp_pad1: UInt32;
  465. cp_pad2: SInt32;
  466. cp_private: mblk_tPtr; { private state information }
  467. cp_filler: array [0..3] of SInt32;
  468. end;
  469. { structure contained in an M_IOCTL message block }
  470. type
  471. iocblkPtr = ^iocblk;
  472. iocblk = record
  473. ioc_cmd: SInt32; { ioctl command type }
  474. ioc_cr: credPtr; { pointer to full credentials }
  475. ioc_id: UInt32; { ioctl id }
  476. ioc_count: UInt32; { count of bytes in data field }
  477. ioc_error: SInt32; { error code }
  478. ioc_rval: SInt32; { return value }
  479. ioc_filler: array [0..3] of SInt32;
  480. end;
  481. const
  482. TRANSPARENT = $FFFFFFFF;
  483. { Used in M_IOCTL mblks to muxes (ioc_cmd I_LINK) }
  484. type
  485. linkblkPtr = ^linkblk;
  486. linkblk = record
  487. l_qtop: queue_tPtr; { lowest level write queue of upper stream }
  488. l_qbot: queue_tPtr; { highest level write queue of lower stream }
  489. l_index: SInt32; { system-unique index for lower stream }
  490. l_pad: array [0..4] of SInt32;
  491. end;
  492. { structure contained in an M_PASSFP message block }
  493. type
  494. strpfp = record
  495. pass_file_cookie: UInt32; { file 'pointer' }
  496. pass_uid: UInt16; { user id of sending stream }
  497. pass_gid: UInt16;
  498. pass_sth: sth_sPtr; { Stream head pointer of passed stream }
  499. end;
  500. { structure contained in an M_SETOPTS message block }
  501. type
  502. stroptions = packed record
  503. so_flags: UInt32; { options to set }
  504. so_readopt: SInt16; { read option }
  505. so_wroff: UInt16; { write offset }
  506. so_minpsz: SInt32; { minimum read packet size }
  507. so_maxpsz: SInt32; { maximum read packet size }
  508. so_hiwat: UInt32; { read queue high-water mark }
  509. so_lowat: UInt32; { read queue low-water mark }
  510. so_band: UInt8; { band for water marks }
  511. so_filler: packed array [0..2] of UInt8; { added for alignment }
  512. so_poll_set: UInt32; { poll events to set }
  513. so_poll_clr: UInt32; { poll events to clear }
  514. end;
  515. { definitions for so_flags field }
  516. const
  517. SO_ALL = $7FFF; { Update all options }
  518. SO_READOPT = $0001; { Set the read mode }
  519. SO_WROFF = $0002; { Insert an offset in write M_DATA mblks }
  520. SO_MINPSZ = $0004; { Change the min packet size on sth rq }
  521. SO_MAXPSZ = $0008; { Change the max packet size on sth rq }
  522. SO_HIWAT = $0010; { Change the high water mark on sth rq }
  523. SO_LOWAT = $0020; { Change the low water mark }
  524. SO_MREADON = $0040; { Request M_READ messages }
  525. SO_MREADOFF = $0080; { Don't gen M_READ messages }
  526. SO_NDELON = $0100; { old TTY semantics for O_NDELAY reads and writes }
  527. SO_NDELOFF = $0200; { STREAMS semantics for O_NDELAY reads and writes }
  528. SO_ISTTY = $0400; { Become a controlling tty }
  529. SO_ISNTTY = $0800; { No longer a controlling tty }
  530. SO_TOSTOP = $1000; { Stop on background writes }
  531. SO_TONSTOP = $2000; { Don't stop on background writes }
  532. SO_BAND = $4000; { Water marks are for a band }
  533. SO_POLL_SET = $8000; { Set events to poll }
  534. SO_POLL_CLR = $00010000; { Clear events to poll }
  535. { Buffer Allocation Priority }
  536. const
  537. BPRI_LO = 1;
  538. BPRI_MED = 2;
  539. BPRI_HI = 3;
  540. const
  541. INFPSZ = -1;
  542. {* Test whether message is a data message }
  543. // #define datamsg(type) ((type) == M_DATA || (type) == M_PROTO || (type) == M_PCPROTO || (type) == M_DELAY)
  544. const
  545. CLONEOPEN = $02;
  546. MODOPEN = $01;
  547. OPENFAIL = -1;
  548. { Enumeration values for strqget and strqset }
  549. type
  550. qfields = SInt32;
  551. const
  552. QHIWAT = 0;
  553. QLOWAT = 1;
  554. QMAXPSZ = 2;
  555. QMINPSZ = 3;
  556. QCOUNT = 4;
  557. QFIRST = 5;
  558. QLAST = 6;
  559. QFLAG = 7;
  560. QBAD = 8;
  561. type
  562. qfields_t = qfields;
  563. {$endc} { CALL_NOT_IN_CARBON }
  564. { ***** From the Mentat "stropts.h" *****}
  565. const
  566. I_NREAD = $4101; { return the number of bytes in 1st msg }
  567. I_PUSH = $4102; { push module just below stream head }
  568. I_POP = $4103; { pop module below stream head }
  569. I_LOOK = $4104; { retrieve name of first stream module }
  570. I_FLUSH = $4105; { flush all input and/or output queues }
  571. I_SRDOPT = $4106; { set the read mode }
  572. I_GRDOPT = $4107; { get the current read mode }
  573. I_STR = $4108; { create an internal ioctl message }
  574. I_SETSIG = $4109; { request SIGPOLL signal on events }
  575. I_GETSIG = $410A; { query the registered events }
  576. I_FIND = $410B; { check for module in stream }
  577. I_LINK = $410C; { connect stream under mux fd }
  578. I_UNLINK = $410D; { disconnect two streams }
  579. I_PEEK = $410F; { peek at data on read queue }
  580. I_FDINSERT = $4110; { create a message and send downstream }
  581. I_SENDFD = $4111; { send an fd to a connected pipe stream }
  582. I_RECVFD = $4112; { retrieve a file descriptor }
  583. I_FLUSHBAND = $4113; { flush a particular input and/or output band }
  584. I_SWROPT = $4114; { set the write mode }
  585. I_GWROPT = $4115; { get the current write mode }
  586. I_LIST = $4116; { get a list of all modules on a stream }
  587. I_ATMARK = $4117; { check to see if the next message is "marked" }
  588. I_CKBAND = $4118; { check for a message of a particular band }
  589. I_GETBAND = $4119; { get the band of the next message to be read }
  590. I_CANPUT = $411A; { check to see if a message may be passed on a stream }
  591. I_SETCLTIME = $411B; { set the close timeout wait }
  592. I_GETCLTIME = $411C; { get the current close timeout wait }
  593. I_PLINK = $411D; { permanently connect a stream under a mux }
  594. I_PUNLINK = $411E; { disconnect a permanent link }
  595. I_GETMSG = $4128; { getmsg() system call }
  596. I_PUTMSG = $4129; { putmsg() system call }
  597. I_POLL = $412A; { poll() system call }
  598. I_SETDELAY = $412B; { set blocking status }
  599. I_GETDELAY = $412C; { get blocking status }
  600. I_RUN_QUEUES = $412D; { sacrifice for the greater good }
  601. I_GETPMSG = $412E; { getpmsg() system call }
  602. I_PUTPMSG = $412F; { putpmsg() system call }
  603. I_AUTOPUSH = $4130; { for systems that cannot do the autopush in open }
  604. I_PIPE = $4131; { for pipe library call }
  605. I_HEAP_REPORT = $4132; { get heap statistics }
  606. I_FIFO = $4133; { for fifo library call }
  607. { priority message request on putmsg() or strpeek }
  608. const
  609. RS_HIPRI = $01;
  610. { flags for getpmsg and putpmsg }
  611. const
  612. MSG_HIPRI = $01;
  613. MSG_BAND = $02; { Retrieve a message from a particular band }
  614. MSG_ANY = $04; { Retrieve a message from any band }
  615. { return values from getmsg(), 0 indicates all ok }
  616. const
  617. MORECTL = $01; { more control info available }
  618. MOREDATA = $02; { more data available }
  619. const
  620. FMNAMESZ = 31; { maximum length of a module or device name }
  621. { Infinite poll wait time }
  622. const
  623. INFTIM = $FFFFFFFF;
  624. { flush requests }
  625. const
  626. FLUSHR = $01; { Flush the read queue }
  627. FLUSHW = $02; { Flush the write queue }
  628. FLUSHRW = FLUSHW or FLUSHR; { Flush both }
  629. const
  630. FLUSHBAND = $40; { Flush a particular band }
  631. {
  632. Mentat's code does an #ifdef on this symbol, so we have to #define
  633. it as well as declare it as an enum. But only for Apple builds because
  634. we don't want internal weirdness to propagate to developers.
  635. }
  636. // #define FLUSHBAND FLUSHBAND
  637. { I_FLUSHBAND }
  638. type
  639. bandinfoPtr = ^bandinfo;
  640. bandinfo = record
  641. bi_pri: SInt8; { Band to flush }
  642. pad1: SInt8;
  643. bi_flag: SInt32; { One of the above flush requests }
  644. end;
  645. { flags for I_ATMARK }
  646. const
  647. ANYMARK = $01; { Check if message is marked }
  648. LASTMARK = $02; { Check if this is the only message marked }
  649. { signal event masks }
  650. const
  651. S_INPUT = $01; { A non-M_PCPROTO message has arrived }
  652. S_HIPRI = $02; { A priority (M_PCPROTO) message is available }
  653. S_OUTPUT = $04; { The write queue is no longer full }
  654. S_MSG = $08; { A signal message has reached the front of read queue }
  655. S_RDNORM = $10; { A non-priority message is available }
  656. S_RDBAND = $20; { A banded messsage is available }
  657. S_WRNORM = $40; { Same as S_OUTPUT }
  658. S_WRBAND = $80; { A priority band exists and is writable }
  659. S_ERROR = $0100; { Error message has arrived }
  660. S_HANGUP = $0200; { Hangup message has arrived }
  661. S_BANDURG = $0400; { Use SIGURG instead of SIGPOLL on S_RDBAND signals }
  662. { read mode bits for I_S|GRDOPT; choose one of the following }
  663. const
  664. RNORM = $01; { byte-stream mode, default }
  665. RMSGD = $02; { message-discard mode }
  666. RMSGN = $04; { message-nondiscard mode }
  667. RFILL = $08; { fill read buffer mode (PSE private) }
  668. { More read modes, these are bitwise or'ed with the modes above }
  669. const
  670. RPROTNORM = $10; { Normal handling of M_PROTO/M_PCPROTO messages, default }
  671. RPROTDIS = $20; { Discard M_PROTO/M_PCPROTO message blocks }
  672. RPROTDAT = $40; { Convert M_PROTO/M_PCPROTO message blocks into M_DATA }
  673. { write modes for I_S|GWROPT }
  674. const
  675. SNDZERO = $01; { Send a zero-length message downstream on a write of zero bytes }
  676. const
  677. MUXID_ALL = -1; { Unlink all lower streams for I_UNLINK and I_PUNLINK }
  678. {
  679. strbuf is moved to "OpenTransport.h" because that header file
  680. exports provider routines that take it as a parameter.
  681. }
  682. { structure of ioctl data on I_FDINSERT }
  683. type
  684. strfdinsertPtr = ^strfdinsert;
  685. strfdinsert = record
  686. ctlbuf: strbuf;
  687. databuf: strbuf;
  688. flags: SInt32; { type of message, 0 or RS_HIPRI }
  689. fildes: SInt32; { fd of other stream (FDCELL) }
  690. offset: SInt32; { where to put other stream read qp }
  691. end;
  692. { I_LIST structures }
  693. type
  694. str_mlistPtr = ^str_mlist;
  695. str_mlist = record
  696. l_name: packed array [0..31] of char;
  697. end;
  698. type
  699. str_listPtr = ^str_list;
  700. str_list = record
  701. sl_nmods: SInt32; { number of modules in sl_modlist array }
  702. sl_modlist: str_mlistPtr;
  703. end;
  704. { I_PEEK structure }
  705. type
  706. strpeekPtr = ^strpeek;
  707. strpeek = record
  708. ctlbuf: strbuf;
  709. databuf: strbuf;
  710. flags: SInt32; { if RS_HIPRI, get priority messages only }
  711. end;
  712. { structure for getpmsg and putpmsg }
  713. type
  714. strpmsgPtr = ^strpmsg;
  715. strpmsg = record
  716. ctlbuf: strbuf;
  717. databuf: strbuf;
  718. band: SInt32;
  719. flags: SInt32;
  720. end;
  721. { structure of ioctl data on I_RECVFD }
  722. type
  723. strrecvfdPtr = ^strrecvfd;
  724. strrecvfd = record
  725. fd: SInt32; { new file descriptor (FDCELL) }
  726. uid: UInt16; { user id of sending stream }
  727. gid: UInt16;
  728. fill: packed array [0..7] of char;
  729. end;
  730. { structure of ioctl data on I_STR }
  731. type
  732. strioctlPtr = ^strioctl;
  733. strioctl = record
  734. ic_cmd: SInt32; { downstream command }
  735. ic_timout: SInt32; { ACK/NAK timeout }
  736. ic_len: SInt32; { length of data arg }
  737. ic_dp: UnivPtr; { ptr to data arg }
  738. end;
  739. { ***** From the Mentat "strlog.h" *****}
  740. type
  741. log_ctlPtr = ^log_ctl;
  742. log_ctl = record
  743. mid: SInt16;
  744. sid: SInt16;
  745. level: SInt8;
  746. pad1: SInt8;
  747. flags: SInt16;
  748. ltime: SInt32;
  749. ttime: SInt32;
  750. seq_no: SInt32;
  751. end;
  752. const
  753. SL_FATAL = $01; { Fatal error }
  754. SL_NOTIFY = $02; { Notify the system administrator }
  755. SL_ERROR = $04; { Pass message to error logger }
  756. SL_TRACE = $08; { Pass message to tracer }
  757. SL_CONSOLE = $00; { Console messages are disabled }
  758. SL_WARN = $20; { Warning }
  759. SL_NOTE = $40; { Notice this message }
  760. type
  761. trace_idsPtr = ^trace_ids;
  762. trace_ids = record
  763. ti_mid: SInt16;
  764. ti_sid: SInt16;
  765. ti_level: char;
  766. end;
  767. const
  768. I_TRCLOG = $6201;
  769. I_ERRLOG = $6202;
  770. const
  771. LOGMSGSZ = 128;
  772. { ***** From the Mentat "tihdr.h" *****}
  773. {$ifc CALL_NOT_IN_CARBON}
  774. { TPI Primitives}
  775. const
  776. T_BIND_REQ = 101;
  777. T_CONN_REQ = 102; { connection request }
  778. T_CONN_RES = 103; { respond to connection indication }
  779. T_DATA_REQ = 104;
  780. T_DISCON_REQ = 105;
  781. T_EXDATA_REQ = 106;
  782. T_INFO_REQ = 107;
  783. T_OPTMGMT_REQ = 108;
  784. T_ORDREL_REQ = 109;
  785. T_UNBIND_REQ = 110;
  786. T_UNITDATA_REQ = 111;
  787. T_ADDR_REQ = 112; { Get address request }
  788. T_UREQUEST_REQ = 113; { UnitRequest (transaction) req }
  789. T_REQUEST_REQ = 114; { Request (CO transaction) req }
  790. T_UREPLY_REQ = 115; { UnitRequest (transaction) req }
  791. T_REPLY_REQ = 116; { REPLY (CO transaction) req }
  792. T_CANCELREQUEST_REQ = 117; { Cancel outgoing request }
  793. T_CANCELREPLY_REQ = 118; { Cancel incoming request }
  794. T_REGNAME_REQ = 119; { Request name registration }
  795. T_DELNAME_REQ = 120; { Request delete name registration }
  796. T_LKUPNAME_REQ = 121; { Request name lookup }
  797. T_BIND_ACK = 122;
  798. T_CONN_CON = 123; { connection confirmation }
  799. T_CONN_IND = 124; { incoming connection indication }
  800. T_DATA_IND = 125;
  801. T_DISCON_IND = 126;
  802. T_ERROR_ACK = 127;
  803. T_EXDATA_IND = 128;
  804. T_INFO_ACK = 129;
  805. T_OK_ACK = 130;
  806. T_OPTMGMT_ACK = 131;
  807. T_ORDREL_IND = 132;
  808. T_UNITDATA_IND = 133;
  809. T_UDERROR_IND = 134;
  810. T_ADDR_ACK = 135; { Get address ack }
  811. T_UREQUEST_IND = 136; { UnitRequest (transaction) ind }
  812. T_REQUEST_IND = 137; { Request (CO transaction) ind }
  813. T_UREPLY_IND = 138; { Incoming unit reply }
  814. T_REPLY_IND = 139; { Incoming reply }
  815. T_UREPLY_ACK = 140; { outgoing Unit Reply is complete }
  816. T_REPLY_ACK = 141; { outgoing Reply is complete }
  817. T_RESOLVEADDR_REQ = 142;
  818. T_RESOLVEADDR_ACK = 143;
  819. T_LKUPNAME_CON = 146; { Results of name lookup }
  820. T_LKUPNAME_RES = 147; { Partial results of name lookup }
  821. T_REGNAME_ACK = 148; { Request name registration }
  822. T_SEQUENCED_ACK = 149; { Sequenced version of OK or ERROR ACK }
  823. T_EVENT_IND = 160; { Miscellaneous event Indication }
  824. { State values }
  825. const
  826. TS_UNBND = 1;
  827. TS_WACK_BREQ = 2;
  828. TS_WACK_UREQ = 3;
  829. TS_IDLE = 4;
  830. TS_WACK_OPTREQ = 5;
  831. TS_WACK_CREQ = 6;
  832. TS_WCON_CREQ = 7;
  833. TS_WRES_CIND = 8;
  834. TS_WACK_CRES = 9;
  835. TS_DATA_XFER = 10;
  836. TS_WIND_ORDREL = 11;
  837. TS_WREQ_ORDREL = 12;
  838. TS_WACK_DREQ6 = 13;
  839. TS_WACK_DREQ7 = 14;
  840. TS_WACK_DREQ9 = 15;
  841. TS_WACK_DREQ10 = 16;
  842. TS_WACK_DREQ11 = 17;
  843. TS_WACK_ORDREL = 18;
  844. TS_NOSTATES = 19;
  845. TS_BAD_STATE = 19;
  846. { Transport events }
  847. const
  848. TE_OPENED = 1;
  849. TE_BIND = 2;
  850. TE_OPTMGMT = 3;
  851. TE_UNBIND = 4;
  852. TE_CLOSED = 5;
  853. TE_CONNECT1 = 6;
  854. TE_CONNECT2 = 7;
  855. TE_ACCEPT1 = 8;
  856. TE_ACCEPT2 = 9;
  857. TE_ACCEPT3 = 10;
  858. TE_SND = 11;
  859. TE_SNDDIS1 = 12;
  860. TE_SNDDIS2 = 13;
  861. TE_SNDREL = 14;
  862. TE_SNDUDATA = 15;
  863. TE_LISTEN = 16;
  864. TE_RCVCONNECT = 17;
  865. TE_RCV = 18;
  866. TE_RCVDIS1 = 19;
  867. TE_RCVDIS2 = 20;
  868. TE_RCVDIS3 = 21;
  869. TE_RCVREL = 22;
  870. TE_RCVUDATA = 23;
  871. TE_RCVUDERR = 24;
  872. TE_PASS_CONN = 25;
  873. TE_BAD_EVENT = 26;
  874. type
  875. T_addr_ackPtr = ^T_addr_ack;
  876. T_addr_ack = record
  877. PRIM_type: SInt32; { Always T_ADDR_ACK }
  878. LOCADDR_length: SInt32;
  879. LOCADDR_offset: SInt32;
  880. REMADDR_length: SInt32;
  881. REMADDR_offset: SInt32;
  882. end;
  883. type
  884. T_addr_reqPtr = ^T_addr_req;
  885. T_addr_req = record
  886. PRIM_type: SInt32; { Always T_ADDR_REQ }
  887. end;
  888. type
  889. T_bind_ackPtr = ^T_bind_ack;
  890. T_bind_ack = record
  891. PRIM_type: SInt32; { always T_BIND_ACK }
  892. ADDR_length: SInt32;
  893. ADDR_offset: SInt32;
  894. CONIND_number: UInt32;
  895. end;
  896. type
  897. T_bind_reqPtr = ^T_bind_req;
  898. T_bind_req = record
  899. PRIM_type: SInt32; { always T_BIND_REQ }
  900. ADDR_length: SInt32;
  901. ADDR_offset: SInt32;
  902. CONIND_number: UInt32;
  903. end;
  904. type
  905. T_conn_conPtr = ^T_conn_con;
  906. T_conn_con = record
  907. PRIM_type: SInt32; { always T_CONN_CON }
  908. RES_length: SInt32; { responding address length }
  909. RES_offset: SInt32;
  910. OPT_length: SInt32;
  911. OPT_offset: SInt32;
  912. end;
  913. type
  914. T_conn_indPtr = ^T_conn_ind;
  915. T_conn_ind = record
  916. PRIM_type: SInt32; { always T_CONN_IND }
  917. SRC_length: SInt32;
  918. SRC_offset: SInt32;
  919. OPT_length: SInt32;
  920. OPT_offset: SInt32;
  921. SEQ_number: SInt32;
  922. end;
  923. type
  924. T_conn_reqPtr = ^T_conn_req;
  925. T_conn_req = record
  926. PRIM_type: SInt32; { always T_CONN_REQ }
  927. DEST_length: SInt32;
  928. DEST_offset: SInt32;
  929. OPT_length: SInt32;
  930. OPT_offset: SInt32;
  931. end;
  932. type
  933. T_conn_resPtr = ^T_conn_res;
  934. T_conn_res = record
  935. PRIM_type: SInt32; { always T_CONN_RES }
  936. QUEUE_ptr: queue_tPtr;
  937. OPT_length: SInt32;
  938. OPT_offset: SInt32;
  939. SEQ_number: SInt32;
  940. end;
  941. type
  942. T_data_indPtr = ^T_data_ind;
  943. T_data_ind = record
  944. PRIM_type: SInt32; { always T_DATA_IND }
  945. MORE_flag: SInt32;
  946. end;
  947. type
  948. T_data_reqPtr = ^T_data_req;
  949. T_data_req = record
  950. PRIM_type: SInt32; { always T_DATA_REQ }
  951. MORE_flag: SInt32;
  952. end;
  953. type
  954. T_discon_indPtr = ^T_discon_ind;
  955. T_discon_ind = record
  956. PRIM_type: SInt32; { always T_DISCON_IND }
  957. DISCON_reason: SInt32;
  958. SEQ_number: SInt32;
  959. end;
  960. type
  961. T_discon_reqPtr = ^T_discon_req;
  962. T_discon_req = record
  963. PRIM_type: SInt32; { always T_DISCON_REQ }
  964. SEQ_number: SInt32;
  965. end;
  966. type
  967. T_exdata_indPtr = ^T_exdata_ind;
  968. T_exdata_ind = record
  969. PRIM_type: SInt32; { always T_EXDATA_IND }
  970. MORE_flag: SInt32;
  971. end;
  972. type
  973. T_exdata_reqPtr = ^T_exdata_req;
  974. T_exdata_req = record
  975. PRIM_type: SInt32; { always T_EXDATA_REQ }
  976. MORE_flag: SInt32;
  977. end;
  978. type
  979. T_error_ackPtr = ^T_error_ack;
  980. T_error_ack = record
  981. PRIM_type: SInt32; { always T_ERROR_ACK }
  982. ERROR_prim: SInt32; { primitive in error }
  983. TLI_error: SInt32;
  984. UNIX_error: SInt32;
  985. end;
  986. type
  987. T_info_ackPtr = ^T_info_ack;
  988. T_info_ack = record
  989. PRIM_type: SInt32; { always T_INFO_ACK }
  990. TSDU_size: SInt32; { max TSDU size }
  991. ETSDU_size: SInt32; { max ETSDU size }
  992. CDATA_size: SInt32; { connect data size }
  993. DDATA_size: SInt32; { disconnect data size }
  994. ADDR_size: SInt32; { TSAP size }
  995. OPT_size: SInt32; { options size }
  996. TIDU_size: SInt32; { TIDU size }
  997. SERV_type: SInt32; { service type }
  998. CURRENT_state: SInt32; { current state }
  999. PROVIDER_flag: SInt32; { provider flags (see xti.h for defines) }
  1000. end;
  1001. { Provider flags }
  1002. const
  1003. SENDZERO = $0001; { supports 0-length TSDU's }
  1004. XPG4_1 = $0002; { provider supports recent stuff }
  1005. type
  1006. T_info_reqPtr = ^T_info_req;
  1007. T_info_req = record
  1008. PRIM_type: SInt32; { always T_INFO_REQ }
  1009. end;
  1010. type
  1011. T_ok_ackPtr = ^T_ok_ack;
  1012. T_ok_ack = record
  1013. PRIM_type: SInt32; { always T_OK_ACK }
  1014. CORRECT_prim: SInt32;
  1015. end;
  1016. type
  1017. T_optmgmt_ackPtr = ^T_optmgmt_ack;
  1018. T_optmgmt_ack = record
  1019. PRIM_type: SInt32; { always T_OPTMGMT_ACK }
  1020. OPT_length: SInt32;
  1021. OPT_offset: SInt32;
  1022. MGMT_flags: SInt32;
  1023. end;
  1024. type
  1025. T_optmgmt_reqPtr = ^T_optmgmt_req;
  1026. T_optmgmt_req = record
  1027. PRIM_type: SInt32; { always T_OPTMGMT_REQ }
  1028. OPT_length: SInt32;
  1029. OPT_offset: SInt32;
  1030. MGMT_flags: SInt32;
  1031. end;
  1032. type
  1033. T_ordrel_indPtr = ^T_ordrel_ind;
  1034. T_ordrel_ind = record
  1035. PRIM_type: SInt32; { always T_ORDREL_IND }
  1036. end;
  1037. type
  1038. T_ordrel_reqPtr = ^T_ordrel_req;
  1039. T_ordrel_req = record
  1040. PRIM_type: SInt32; { always T_ORDREL_REQ }
  1041. end;
  1042. type
  1043. T_unbind_reqPtr = ^T_unbind_req;
  1044. T_unbind_req = record
  1045. PRIM_type: SInt32; { always T_UNBIND_REQ }
  1046. end;
  1047. type
  1048. T_uderror_indPtr = ^T_uderror_ind;
  1049. T_uderror_ind = record
  1050. PRIM_type: SInt32; { always T_UDERROR_IND }
  1051. DEST_length: SInt32;
  1052. DEST_offset: SInt32;
  1053. OPT_length: SInt32;
  1054. OPT_offset: SInt32;
  1055. ERROR_type: SInt32;
  1056. end;
  1057. type
  1058. T_unitdata_indPtr = ^T_unitdata_ind;
  1059. T_unitdata_ind = record
  1060. PRIM_type: SInt32; { always T_UNITDATA_IND }
  1061. SRC_length: SInt32;
  1062. SRC_offset: SInt32;
  1063. OPT_length: SInt32;
  1064. OPT_offset: SInt32;
  1065. end;
  1066. type
  1067. T_unitdata_reqPtr = ^T_unitdata_req;
  1068. T_unitdata_req = record
  1069. PRIM_type: SInt32; { always T_UNITDATA_REQ }
  1070. DEST_length: SInt32;
  1071. DEST_offset: SInt32;
  1072. OPT_length: SInt32;
  1073. OPT_offset: SInt32;
  1074. end;
  1075. type
  1076. T_resolveaddr_ackPtr = ^T_resolveaddr_ack;
  1077. T_resolveaddr_ack = record
  1078. PRIM_type: SInt32; { always T_RESOLVEADDR_ACK }
  1079. SEQ_number: SInt32;
  1080. ADDR_length: SInt32;
  1081. ADDR_offset: SInt32;
  1082. ORIG_client: SInt32;
  1083. ORIG_data: SInt32;
  1084. TLI_error: SInt32;
  1085. UNIX_error: SInt32;
  1086. end;
  1087. type
  1088. T_resolveaddr_reqPtr = ^T_resolveaddr_req;
  1089. T_resolveaddr_req = record
  1090. PRIM_type: SInt32; { always T_RESOLVEADDR_REQ }
  1091. SEQ_number: SInt32;
  1092. ADDR_length: SInt32;
  1093. ADDR_offset: SInt32;
  1094. ORIG_client: SInt32;
  1095. ORIG_data: SInt32;
  1096. MAX_milliseconds: SInt32;
  1097. end;
  1098. type
  1099. T_unitreply_indPtr = ^T_unitreply_ind;
  1100. T_unitreply_ind = record
  1101. PRIM_type: SInt32; { Always T_UREPLY_IND }
  1102. SEQ_number: SInt32;
  1103. OPT_length: SInt32;
  1104. OPT_offset: SInt32;
  1105. REP_flags: SInt32;
  1106. TLI_error: SInt32;
  1107. UNIX_error: SInt32;
  1108. end;
  1109. type
  1110. T_unitrequest_indPtr = ^T_unitrequest_ind;
  1111. T_unitrequest_ind = record
  1112. PRIM_type: SInt32; { Always T_UREQUEST_IND }
  1113. SEQ_number: SInt32;
  1114. SRC_length: SInt32;
  1115. SRC_offset: SInt32;
  1116. OPT_length: SInt32;
  1117. OPT_offset: SInt32;
  1118. REQ_flags: SInt32;
  1119. end;
  1120. type
  1121. T_unitrequest_reqPtr = ^T_unitrequest_req;
  1122. T_unitrequest_req = record
  1123. PRIM_type: SInt32; { Always T_UREQUEST_REQ }
  1124. SEQ_number: SInt32;
  1125. DEST_length: SInt32;
  1126. DEST_offset: SInt32;
  1127. OPT_length: SInt32;
  1128. OPT_offset: SInt32;
  1129. REQ_flags: SInt32;
  1130. end;
  1131. type
  1132. T_unitreply_reqPtr = ^T_unitreply_req;
  1133. T_unitreply_req = record
  1134. PRIM_type: SInt32; { Always T_UREPLY_REQ }
  1135. SEQ_number: SInt32;
  1136. OPT_length: SInt32;
  1137. OPT_offset: SInt32;
  1138. REP_flags: SInt32;
  1139. end;
  1140. type
  1141. T_unitreply_ackPtr = ^T_unitreply_ack;
  1142. T_unitreply_ack = record
  1143. PRIM_type: SInt32; { Always T_UREPLY_ACK }
  1144. SEQ_number: SInt32;
  1145. TLI_error: SInt32;
  1146. UNIX_error: SInt32;
  1147. end;
  1148. type
  1149. T_cancelrequest_reqPtr = ^T_cancelrequest_req;
  1150. T_cancelrequest_req = record
  1151. PRIM_type: SInt32; { Always T_CANCELREQUEST_REQ }
  1152. SEQ_number: SInt32;
  1153. end;
  1154. type
  1155. T_cancelreply_reqPtr = ^T_cancelreply_req;
  1156. T_cancelreply_req = record
  1157. PRIM_type: SInt32; { Always T_CANCELREPLY_REQ }
  1158. SEQ_number: SInt32;
  1159. end;
  1160. type
  1161. T_reply_indPtr = ^T_reply_ind;
  1162. T_reply_ind = record
  1163. PRIM_type: SInt32; { Always T_REPLY_IND }
  1164. SEQ_number: SInt32;
  1165. OPT_length: SInt32;
  1166. OPT_offset: SInt32;
  1167. REP_flags: SInt32;
  1168. TLI_error: SInt32;
  1169. UNIX_error: SInt32;
  1170. end;
  1171. type
  1172. T_request_indPtr = ^T_request_ind;
  1173. T_request_ind = record
  1174. PRIM_type: SInt32; { Always T_REQUEST_IND }
  1175. SEQ_number: SInt32;
  1176. OPT_length: SInt32;
  1177. OPT_offset: SInt32;
  1178. REQ_flags: SInt32;
  1179. end;
  1180. type
  1181. T_request_reqPtr = ^T_request_req;
  1182. T_request_req = record
  1183. PRIM_type: SInt32; { Always T_REQUEST_REQ }
  1184. SEQ_number: SInt32;
  1185. OPT_length: SInt32;
  1186. OPT_offset: SInt32;
  1187. REQ_flags: SInt32;
  1188. end;
  1189. type
  1190. T_reply_reqPtr = ^T_reply_req;
  1191. T_reply_req = record
  1192. PRIM_type: SInt32; { Always T_REPLY_REQ }
  1193. SEQ_number: SInt32;
  1194. OPT_length: SInt32;
  1195. OPT_offset: SInt32;
  1196. REP_flags: SInt32;
  1197. end;
  1198. type
  1199. T_reply_ackPtr = ^T_reply_ack;
  1200. T_reply_ack = record
  1201. PRIM_type: SInt32; { Always T_REPLY_ACK }
  1202. SEQ_number: SInt32;
  1203. TLI_error: SInt32;
  1204. UNIX_error: SInt32;
  1205. end;
  1206. type
  1207. T_regname_reqPtr = ^T_regname_req;
  1208. T_regname_req = record
  1209. PRIM_type: SInt32; { Always T_REGNAME_REQ }
  1210. SEQ_number: SInt32; { Reply is sequence ack }
  1211. NAME_length: SInt32;
  1212. NAME_offset: SInt32;
  1213. ADDR_length: SInt32;
  1214. ADDR_offset: SInt32;
  1215. REQ_flags: SInt32;
  1216. end;
  1217. type
  1218. T_regname_ackPtr = ^T_regname_ack;
  1219. T_regname_ack = record
  1220. PRIM_type: SInt32; { always T_REGNAME_ACK }
  1221. SEQ_number: SInt32;
  1222. REG_id: SInt32;
  1223. ADDR_length: SInt32;
  1224. ADDR_offset: SInt32;
  1225. end;
  1226. type
  1227. T_delname_reqPtr = ^T_delname_req;
  1228. T_delname_req = record
  1229. PRIM_type: SInt32; { Always T_DELNAME_REQ }
  1230. SEQ_number: SInt32; { Reply is sequence ack }
  1231. NAME_length: SInt32;
  1232. NAME_offset: SInt32;
  1233. end;
  1234. type
  1235. T_lkupname_reqPtr = ^T_lkupname_req;
  1236. T_lkupname_req = record
  1237. PRIM_type: SInt32; { Always T_LKUPNAME_REQ }
  1238. SEQ_number: SInt32; { Reply is sequence ack }
  1239. NAME_length: SInt32; { ... or T_LKUPNAME_CON }
  1240. NAME_offset: SInt32;
  1241. ADDR_length: SInt32;
  1242. ADDR_offset: SInt32;
  1243. MAX_number: SInt32;
  1244. MAX_milliseconds: SInt32;
  1245. REQ_flags: SInt32;
  1246. end;
  1247. type
  1248. T_lkupname_conPtr = ^T_lkupname_con;
  1249. T_lkupname_con = record
  1250. PRIM_type: SInt32; { Either T_LKUPNAME_CON }
  1251. SEQ_number: SInt32; { Or T_LKUPNAME_RES }
  1252. NAME_length: SInt32;
  1253. NAME_offset: SInt32;
  1254. RSP_count: SInt32;
  1255. RSP_cumcount: SInt32;
  1256. end;
  1257. type
  1258. T_sequence_ackPtr = ^T_sequence_ack;
  1259. T_sequence_ack = record
  1260. PRIM_type: SInt32; { always T_SEQUENCED_ACK }
  1261. ORIG_prim: SInt32; { original primitive }
  1262. SEQ_number: SInt32;
  1263. TLI_error: SInt32;
  1264. UNIX_error: SInt32;
  1265. end;
  1266. type
  1267. T_event_indPtr = ^T_event_ind;
  1268. T_event_ind = record
  1269. PRIM_type: SInt32; { always T_EVENT_IND }
  1270. EVENT_code: SInt32;
  1271. EVENT_cookie: SInt32;
  1272. end;
  1273. T_primitivesPtr = ^T_primitives;
  1274. T_primitives = record
  1275. case SInt16 of
  1276. 0: (
  1277. primType: SInt32;
  1278. );
  1279. 1: (
  1280. taddrack: T_addr_ack;
  1281. );
  1282. 2: (
  1283. tbindack: T_bind_ack;
  1284. );
  1285. 3: (
  1286. tbindreq: T_bind_req;
  1287. );
  1288. 4: (
  1289. tconncon: T_conn_con;
  1290. );
  1291. 5: (
  1292. tconnind: T_conn_ind;
  1293. );
  1294. 6: (
  1295. tconnreq: T_conn_req;
  1296. );
  1297. 7: (
  1298. tconnres: T_conn_res;
  1299. );
  1300. 8: (
  1301. tdataind: T_data_ind;
  1302. );
  1303. 9: (
  1304. tdatareq: T_data_req;
  1305. );
  1306. 10: (
  1307. tdisconind: T_discon_ind;
  1308. );
  1309. 11: (
  1310. tdisconreq: T_discon_req;
  1311. );
  1312. 12: (
  1313. texdataind: T_exdata_ind;
  1314. );
  1315. 13: (
  1316. texdatareq: T_exdata_req;
  1317. );
  1318. 14: (
  1319. terrorack: T_error_ack;
  1320. );
  1321. 15: (
  1322. tinfoack: T_info_ack;
  1323. );
  1324. 16: (
  1325. tinforeq: T_info_req;
  1326. );
  1327. 17: (
  1328. tokack: T_ok_ack;
  1329. );
  1330. 18: (
  1331. toptmgmtack: T_optmgmt_ack;
  1332. );
  1333. 19: (
  1334. toptmgmtreq: T_optmgmt_req;
  1335. );
  1336. 20: (
  1337. tordrelind: T_ordrel_ind;
  1338. );
  1339. 21: (
  1340. tordrelreq: T_ordrel_req;
  1341. );
  1342. 22: (
  1343. tunbindreq: T_unbind_req;
  1344. );
  1345. 23: (
  1346. tuderrorind: T_uderror_ind;
  1347. );
  1348. 24: (
  1349. tunitdataind: T_unitdata_ind;
  1350. );
  1351. 25: (
  1352. tunitdatareq: T_unitdata_req;
  1353. );
  1354. 26: (
  1355. tunitreplyind: T_unitreply_ind;
  1356. );
  1357. 27: (
  1358. tunitrequestind: T_unitrequest_ind;
  1359. );
  1360. 28: (
  1361. tunitrequestreq: T_unitrequest_req;
  1362. );
  1363. 29: (
  1364. tunitreplyreq: T_unitreply_req;
  1365. );
  1366. 30: (
  1367. tunitreplyack: T_unitreply_ack;
  1368. );
  1369. 31: (
  1370. treplyind: T_reply_ind;
  1371. );
  1372. 32: (
  1373. trequestind: T_request_ind;
  1374. );
  1375. 33: (
  1376. trequestreq: T_request_req;
  1377. );
  1378. 34: (
  1379. treplyreq: T_reply_req;
  1380. );
  1381. 35: (
  1382. treplyack: T_reply_ack;
  1383. );
  1384. 36: (
  1385. tcancelreqreq: T_cancelrequest_req;
  1386. );
  1387. 37: (
  1388. tresolvereq: T_resolveaddr_req;
  1389. );
  1390. 38: (
  1391. tresolveack: T_resolveaddr_ack;
  1392. );
  1393. 39: (
  1394. tregnamereq: T_regname_req;
  1395. );
  1396. 40: (
  1397. tregnameack: T_regname_ack;
  1398. );
  1399. 41: (
  1400. tdelnamereq: T_delname_req;
  1401. );
  1402. 42: (
  1403. tlkupnamereq: T_lkupname_req;
  1404. );
  1405. 43: (
  1406. tlkupnamecon: T_lkupname_con;
  1407. );
  1408. 44: (
  1409. tsequenceack: T_sequence_ack;
  1410. );
  1411. 45: (
  1412. teventind: T_event_ind;
  1413. );
  1414. end;
  1415. { ***** From the Mentat "dlpi.h" *****}
  1416. {
  1417. This header file has encoded the values so an existing driver
  1418. or user which was written with the Logical Link Interface(LLI)
  1419. can migrate to the DLPI interface in a binary compatible manner.
  1420. Any fields which require a specific format or value are flagged
  1421. with a comment containing the message LLI compatibility.
  1422. }
  1423. { DLPI revision definition history}
  1424. const
  1425. DL_CURRENT_VERSION = $02; { current version of dlpi }
  1426. DL_VERSION_2 = $02; { version of dlpi March 12,1991 }
  1427. const
  1428. DL_INFO_REQ = $00; { Information Req, LLI compatibility }
  1429. DL_INFO_ACK = $03; { Information Ack, LLI compatibility }
  1430. DL_ATTACH_REQ = $0B; { Attach a PPA }
  1431. DL_DETACH_REQ = $0C; { Detach a PPA }
  1432. DL_BIND_REQ = $01; { Bind dlsap address, LLI compatibility }
  1433. DL_BIND_ACK = $04; { Dlsap address bound, LLI compatibility }
  1434. DL_UNBIND_REQ = $02; { Unbind dlsap address, LLI compatibility }
  1435. DL_OK_ACK = $06; { Success acknowledgment, LLI compatibility }
  1436. DL_ERROR_ACK = $05; { Error acknowledgment, LLI compatibility }
  1437. DL_SUBS_BIND_REQ = $1B; { Bind Subsequent DLSAP address }
  1438. DL_SUBS_BIND_ACK = $1C; { Subsequent DLSAP address bound }
  1439. DL_SUBS_UNBIND_REQ = $15; { Subsequent unbind }
  1440. DL_ENABMULTI_REQ = $1D; { Enable multicast addresses }
  1441. DL_DISABMULTI_REQ = $1E; { Disable multicast addresses }
  1442. DL_PROMISCON_REQ = $1F; { Turn on promiscuous mode }
  1443. DL_PROMISCOFF_REQ = $20; { Turn off promiscuous mode }
  1444. DL_UNITDATA_REQ = $07; { datagram send request, LLI compatibility }
  1445. DL_UNITDATA_IND = $08; { datagram receive indication, LLI compatibility }
  1446. DL_UDERROR_IND = $09; { datagram error indication, LLI compatibility }
  1447. DL_UDQOS_REQ = $0A; { set QOS for subsequent datagram transmissions }
  1448. DL_CONNECT_REQ = $0D; { Connect request }
  1449. DL_CONNECT_IND = $0E; { Incoming connect indication }
  1450. DL_CONNECT_RES = $0F; { Accept previous connect indication }
  1451. DL_CONNECT_CON = $10; { Connection established }
  1452. DL_TOKEN_REQ = $11; { Passoff token request }
  1453. DL_TOKEN_ACK = $12; { Passoff token ack }
  1454. DL_DISCONNECT_REQ = $13; { Disconnect request }
  1455. DL_DISCONNECT_IND = $14; { Disconnect indication }
  1456. DL_RESET_REQ = $17; { Reset service request }
  1457. DL_RESET_IND = $18; { Incoming reset indication }
  1458. DL_RESET_RES = $19; { Complete reset processing }
  1459. DL_RESET_CON = $1A; { Reset processing complete }
  1460. DL_DATA_ACK_REQ = $21; { data unit transmission request }
  1461. DL_DATA_ACK_IND = $22; { Arrival of a command PDU }
  1462. DL_DATA_ACK_STATUS_IND = $23; { Status indication of DATA_ACK_REQ}
  1463. DL_REPLY_REQ = $24; { Request a DLSDU from the remote }
  1464. DL_REPLY_IND = $25; { Arrival of a command PDU }
  1465. DL_REPLY_STATUS_IND = $26; { Status indication of REPLY_REQ }
  1466. DL_REPLY_UPDATE_REQ = $27; { Hold a DLSDU for transmission }
  1467. DL_REPLY_UPDATE_STATUS_IND = $28; { Status of REPLY_UPDATE req }
  1468. DL_XID_REQ = $29; { Request to send an XID PDU }
  1469. DL_XID_IND = $2A; { Arrival of an XID PDU }
  1470. DL_XID_RES = $2B; { request to send a response XID PDU}
  1471. DL_XID_CON = $2C; { Arrival of a response XID PDU }
  1472. DL_TEST_REQ = $2D; { TEST command request }
  1473. DL_TEST_IND = $2E; { TEST response indication }
  1474. DL_TEST_RES = $2F; { TEST response }
  1475. DL_TEST_CON = $30; { TEST Confirmation }
  1476. DL_PHYS_ADDR_REQ = $31; { Request to get physical addr }
  1477. DL_PHYS_ADDR_ACK = $32; { Return physical addr }
  1478. DL_SET_PHYS_ADDR_REQ = $33; { set physical addr }
  1479. DL_GET_STATISTICS_REQ = $34; { Request to get statistics }
  1480. DL_GET_STATISTICS_ACK = $35; { Return statistics }
  1481. { DLPI interface states}
  1482. const
  1483. DL_UNATTACHED = $04; { PPA not attached }
  1484. DL_ATTACH_PENDING = $05; { Waiting ack of DL_ATTACH_REQ }
  1485. DL_DETACH_PENDING = $06; { Waiting ack of DL_DETACH_REQ }
  1486. DL_UNBOUND = $00; { PPA attached, LLI compatibility }
  1487. DL_BIND_PENDING = $01; { Waiting ack of DL_BIND_REQ, LLI compatibility }
  1488. DL_UNBIND_PENDING = $02; { Waiting ack of DL_UNBIND_REQ, LLI compatibility }
  1489. DL_IDLE = $03; { dlsap bound, awaiting use, LLI compatibility }
  1490. DL_UDQOS_PENDING = $07; { Waiting ack of DL_UDQOS_REQ }
  1491. DL_OUTCON_PENDING = $08; { outgoing connection, awaiting DL_CONN_CON }
  1492. DL_INCON_PENDING = $09; { incoming connection, awaiting DL_CONN_RES }
  1493. DL_CONN_RES_PENDING = $0A; { Waiting ack of DL_CONNECT_RES }
  1494. DL_DATAXFER = $0B; { connection-oriented data transfer }
  1495. DL_USER_RESET_PENDING = $0C; { user initiated reset, awaiting DL_RESET_CON }
  1496. DL_PROV_RESET_PENDING = $0D; { provider initiated reset, awaiting DL_RESET_RES }
  1497. DL_RESET_RES_PENDING = $0E; { Waiting ack of DL_RESET_RES }
  1498. DL_DISCON8_PENDING = $0F; { Waiting ack of DL_DISC_REQ when in DL_OUTCON_PENDING }
  1499. DL_DISCON9_PENDING = $10; { Waiting ack of DL_DISC_REQ when in DL_INCON_PENDING }
  1500. DL_DISCON11_PENDING = $11; { Waiting ack of DL_DISC_REQ when in DL_DATAXFER }
  1501. DL_DISCON12_PENDING = $12; { Waiting ack of DL_DISC_REQ when in DL_USER_RESET_PENDING }
  1502. DL_DISCON13_PENDING = $13; { Waiting ack of DL_DISC_REQ when in DL_DL_PROV_RESET_PENDING }
  1503. DL_SUBS_BIND_PND = $14; { Waiting ack of DL_SUBS_BIND_REQ }
  1504. DL_SUBS_UNBIND_PND = $15; { Waiting ack of DL_SUBS_UNBIND_REQ }
  1505. { DL_ERROR_ACK error return values}
  1506. const
  1507. DL_ACCESS = $02; { Improper permissions for request, LLI compatibility }
  1508. DL_BADADDR = $01; { DLSAP address in improper format or invalid }
  1509. DL_BADCORR = $05; { Sequence number not from outstanding DL_CONN_IND }
  1510. DL_BADDATA = $06; { User data exceeded provider limit }
  1511. DL_BADPPA = $08; { Specified PPA was invalid }
  1512. DL_BADPRIM = $09; { Primitive received is not known by DLS provider }
  1513. DL_BADQOSPARAM = $0A; { QOS parameters contained invalid values }
  1514. DL_BADQOSTYPE = $0B; { QOS structure type is unknown or unsupported }
  1515. DL_BADSAP = $00; { Bad LSAP selector, LLI compatibility }
  1516. DL_BADTOKEN = $0C; { Token used not associated with an active stream }
  1517. DL_BOUND = $0D; { Attempted second bind with dl_max_conind or }
  1518. { dl_conn_mgmt > 0 on same DLSAP or PPA }
  1519. DL_INITFAILED = $0E; { Physical Link initialization failed }
  1520. DL_NOADDR = $0F; { Provider couldn't allocate alternate address }
  1521. DL_NOTINIT = $10; { Physical Link not initialized }
  1522. DL_OUTSTATE = $03; { Primitive issued in improper state, LLI compatibility }
  1523. DL_SYSERR = $04; { UNIX system error occurred, LLI compatibility }
  1524. DL_UNSUPPORTED = $07; { Requested service not supplied by provider }
  1525. DL_UNDELIVERABLE = $11; { Previous data unit could not be delivered }
  1526. DL_NOTSUPPORTED = $12; { Primitive is known but not supported by DLS provider }
  1527. DL_TOOMANY = $13; { limit exceeded }
  1528. DL_NOTENAB = $14; { Promiscuous mode not enabled }
  1529. DL_BUSY = $15; { Other streams for a particular PPA in the post-attached state }
  1530. DL_NOAUTO = $16; { Automatic handling of XID & TEST responses not supported }
  1531. DL_NOXIDAUTO = $17; { Automatic handling of XID not supported }
  1532. DL_NOTESTAUTO = $18; { Automatic handling of TEST not supported }
  1533. DL_XIDAUTO = $19; { Automatic handling of XID response }
  1534. DL_TESTAUTO = $1A; { AUtomatic handling of TEST response}
  1535. DL_PENDING = $1B; { pending outstanding connect indications }
  1536. { DLPI media types supported}
  1537. const
  1538. DL_CSMACD = $00; { IEEE 802.3 CSMA/CD network, LLI Compatibility }
  1539. DL_TPB = $01; { IEEE 802.4 Token Passing Bus, LLI Compatibility }
  1540. DL_TPR = $02; { IEEE 802.5 Token Passing Ring, LLI Compatibility }
  1541. DL_METRO = $03; { IEEE 802.6 Metro Net, LLI Compatibility }
  1542. DL_ETHER = $04; { Ethernet Bus, LLI Compatibility }
  1543. DL_HDLC = $05; { ISO HDLC protocol support, bit synchronous }
  1544. DL_CHAR = $06; { Character Synchronous protocol support, eg BISYNC }
  1545. DL_CTCA = $07; { IBM Channel-to-Channel Adapter }
  1546. DL_FDDI = $08; { Fiber Distributed data interface }
  1547. DL_OTHER = $09; { Any other medium not listed above }
  1548. {
  1549. DLPI provider service supported.
  1550. These must be allowed to be bitwise-OR for dl_service_mode in
  1551. DL_INFO_ACK.
  1552. }
  1553. const
  1554. DL_CODLS = $01; { support connection-oriented service }
  1555. DL_CLDLS = $02; { support connectionless data link service }
  1556. DL_ACLDLS = $04; { support acknowledged connectionless service}
  1557. {
  1558. DLPI provider style.
  1559. The DLPI provider style which determines whether a provider
  1560. requires a DL_ATTACH_REQ to inform the provider which PPA
  1561. user messages should be sent/received on.
  1562. }
  1563. const
  1564. DL_STYLE1 = $0500; { PPA is implicitly bound by open(2) }
  1565. DL_STYLE2 = $0501; { PPA must be explicitly bound via DL_ATTACH_REQ }
  1566. { DLPI Originator for Disconnect and Resets}
  1567. const
  1568. DL_PROVIDER = $0700;
  1569. DL_USER = $0701;
  1570. { DLPI Disconnect Reasons}
  1571. const
  1572. DL_CONREJ_DEST_UNKNOWN = $0800;
  1573. DL_CONREJ_DEST_UNREACH_PERMANENT = $0801;
  1574. DL_CONREJ_DEST_UNREACH_TRANSIENT = $0802;
  1575. DL_CONREJ_QOS_UNAVAIL_PERMANENT = $0803;
  1576. DL_CONREJ_QOS_UNAVAIL_TRANSIENT = $0804;
  1577. DL_CONREJ_PERMANENT_COND = $0805;
  1578. DL_CONREJ_TRANSIENT_COND = $0806;
  1579. DL_DISC_ABNORMAL_CONDITION = $0807;
  1580. DL_DISC_NORMAL_CONDITION = $0808;
  1581. DL_DISC_PERMANENT_CONDITION = $0809;
  1582. DL_DISC_TRANSIENT_CONDITION = $080A;
  1583. DL_DISC_UNSPECIFIED = $080B;
  1584. { DLPI Reset Reasons}
  1585. const
  1586. DL_RESET_FLOW_CONTROL = $0900;
  1587. DL_RESET_LINK_ERROR = $0901;
  1588. DL_RESET_RESYNCH = $0902;
  1589. { DLPI status values for acknowledged connectionless data transfer}
  1590. const
  1591. DL_CMD_MASK = $0F; { mask for command portion of status }
  1592. DL_CMD_OK = $00; { Command Accepted }
  1593. DL_CMD_RS = $01; { Unimplemented or inactivated service }
  1594. DL_CMD_UE = $05; { Data Link User interface error }
  1595. DL_CMD_PE = $06; { Protocol error }
  1596. DL_CMD_IP = $07; { Permanent implementation dependent error}
  1597. DL_CMD_UN = $09; { Resources temporarily unavailable }
  1598. DL_CMD_IT = $0F; { Temporary implementation dependent error }
  1599. DL_RSP_MASK = $F0; { mask for response portion of status }
  1600. DL_RSP_OK = $00; { Response DLSDU present }
  1601. DL_RSP_RS = $10; { Unimplemented or inactivated service }
  1602. DL_RSP_NE = $30; { Response DLSDU never submitted }
  1603. DL_RSP_NR = $40; { Response DLSDU not requested }
  1604. DL_RSP_UE = $50; { Data Link User interface error }
  1605. DL_RSP_IP = $70; { Permanent implementation dependent error }
  1606. DL_RSP_UN = $90; { Resources temporarily unavailable }
  1607. DL_RSP_IT = $F0; { Temporary implementation dependent error }
  1608. { Service Class values for acknowledged connectionless data transfer}
  1609. const
  1610. DL_RQST_RSP = $01; { Use acknowledge capability in MAC sublayer}
  1611. DL_RQST_NORSP = $02; { No acknowledgement service requested }
  1612. { DLPI address type definition}
  1613. const
  1614. DL_FACT_PHYS_ADDR = $01; { factory physical address }
  1615. DL_CURR_PHYS_ADDR = $02; { current physical address }
  1616. { DLPI flag definitions}
  1617. const
  1618. DL_POLL_FINAL = $01; { if set,indicates poll/final bit set}
  1619. { XID and TEST responses supported by the provider}
  1620. const
  1621. DL_AUTO_XID = $01; { provider will respond to XID }
  1622. DL_AUTO_TEST = $02; { provider will respond to TEST }
  1623. { Subsequent bind type}
  1624. const
  1625. DL_PEER_BIND = $01; { subsequent bind on a peer addr }
  1626. DL_HIERARCHICAL_BIND = $02; { subs_bind on a hierarchical addr}
  1627. { DLPI promiscuous mode definitions}
  1628. const
  1629. DL_PROMISC_PHYS = $01; { promiscuous mode at phys level }
  1630. DL_PROMISC_SAP = $02; { promiscous mode at sap level }
  1631. DL_PROMISC_MULTI = $03; { promiscuous mode for multicast }
  1632. { M_DATA "raw" mode }
  1633. // #define DLIOCRAW MIOC_CMD(MIOC_DLPI,1)
  1634. {
  1635. DLPI Quality Of Service definition for use in QOS structure definitions.
  1636. The QOS structures are used in connection establishment, DL_INFO_ACK,
  1637. and setting connectionless QOS values.
  1638. }
  1639. {
  1640. Throughput
  1641. This parameter is specified for both directions.
  1642. }
  1643. type
  1644. dl_through_t = record
  1645. dl_target_value: SInt32; { desired bits/second desired }
  1646. dl_accept_value: SInt32; { min. acceptable bits/second }
  1647. end;
  1648. {
  1649. transit delay specification
  1650. This parameter is specified for both directions.
  1651. expressed in milliseconds assuming a DLSDU size of 128 octets.
  1652. The scaling of the value to the current DLSDU size is provider dependent.
  1653. }
  1654. type
  1655. dl_transdelay_tPtr = ^dl_transdelay_t;
  1656. dl_transdelay_t = record
  1657. dl_target_value: SInt32; { desired value of service }
  1658. dl_accept_value: SInt32; { min. acceptable value of service }
  1659. end;
  1660. {
  1661. priority specification
  1662. priority range is 0-100, with 0 being highest value.
  1663. }
  1664. type
  1665. dl_priority_tPtr = ^dl_priority_t;
  1666. dl_priority_t = record
  1667. dl_min: SInt32;
  1668. dl_max: SInt32;
  1669. end;
  1670. { protection specification}
  1671. const
  1672. DL_NONE = $0B01; { no protection supplied }
  1673. DL_MONITOR = $0B02; { protection against passive monitoring }
  1674. DL_MAXIMUM = $0B03; { protection against modification, replay, addition, or deletion }
  1675. type
  1676. dl_protect_tPtr = ^dl_protect_t;
  1677. dl_protect_t = record
  1678. dl_min: SInt32;
  1679. dl_max: SInt32;
  1680. end;
  1681. {
  1682. Resilience specification
  1683. probabilities are scaled by a factor of 10,000 with a time interval
  1684. of 10,000 seconds.
  1685. }
  1686. type
  1687. dl_resilience_tPtr = ^dl_resilience_t;
  1688. dl_resilience_t = record
  1689. dl_disc_prob: SInt32; { probability of provider init DISC }
  1690. dl_reset_prob: SInt32; { probability of provider init RESET }
  1691. end;
  1692. {
  1693. QOS type definition to be used for negotiation with the
  1694. remote end of a connection, or a connectionless unitdata request.
  1695. There are two type definitions to handle the negotiation
  1696. process at connection establishment. The typedef dl_qos_range_t
  1697. is used to present a range for parameters. This is used
  1698. in the DL_CONNECT_REQ and DL_CONNECT_IND messages. The typedef
  1699. dl_qos_sel_t is used to select a specific value for the QOS
  1700. parameters. This is used in the DL_CONNECT_RES, DL_CONNECT_CON,
  1701. and DL_INFO_ACK messages to define the selected QOS parameters
  1702. for a connection.
  1703. NOTE
  1704. A DataLink provider which has unknown values for any of the fields
  1705. will use a value of DL_UNKNOWN for all values in the fields.
  1706. NOTE
  1707. A QOS parameter value of DL_QOS_DONT_CARE informs the DLS
  1708. provider the user requesting this value doesn't care
  1709. what the QOS parameter is set to. This value becomes the
  1710. least possible value in the range of QOS parameters.
  1711. The order of the QOS parameter range is then:
  1712. DL_QOS_DONT_CARE < 0 < MAXIMUM QOS VALUE
  1713. }
  1714. const
  1715. DL_UNKNOWN = -1;
  1716. DL_QOS_DONT_CARE = -2;
  1717. {
  1718. Every QOS structure has the first 4 bytes containing a type
  1719. field, denoting the definition of the rest of the structure.
  1720. This is used in the same manner has the dl_primitive variable
  1721. is in messages.
  1722. The following list is the defined QOS structure type values and structures.
  1723. }
  1724. const
  1725. DL_QOS_CO_RANGE1 = $0101; { QOS range struct. for Connection modeservice }
  1726. DL_QOS_CO_SEL1 = $0102; { QOS selection structure }
  1727. DL_QOS_CL_RANGE1 = $0103; { QOS range struct. for connectionless}
  1728. DL_QOS_CL_SEL1 = $0104; { QOS selection for connectionless mode}
  1729. type
  1730. dl_qos_co_range1_tPtr = ^dl_qos_co_range1_t;
  1731. dl_qos_co_range1_t = record
  1732. dl_qos_type: UInt32;
  1733. dl_rcv_throughput: dl_through_t; { desired and acceptable}
  1734. dl_rcv_trans_delay: dl_transdelay_t; { desired and acceptable}
  1735. dl_xmt_throughput: dl_through_t;
  1736. dl_xmt_trans_delay: dl_transdelay_t;
  1737. dl_priority: dl_priority_t; { min and max values }
  1738. dl_protection: dl_protect_t; { min and max values }
  1739. dl_residual_error: SInt32;
  1740. dl_resilience: dl_resilience_t;
  1741. end;
  1742. type
  1743. dl_qos_co_sel1_tPtr = ^dl_qos_co_sel1_t;
  1744. dl_qos_co_sel1_t = record
  1745. dl_qos_type: UInt32;
  1746. dl_rcv_throughput: SInt32;
  1747. dl_rcv_trans_delay: SInt32;
  1748. dl_xmt_throughput: SInt32;
  1749. dl_xmt_trans_delay: SInt32;
  1750. dl_priority: SInt32;
  1751. dl_protection: SInt32;
  1752. dl_residual_error: SInt32;
  1753. dl_resilience: dl_resilience_t;
  1754. end;
  1755. type
  1756. dl_qos_cl_range1_tPtr = ^dl_qos_cl_range1_t;
  1757. dl_qos_cl_range1_t = record
  1758. dl_qos_type: UInt32;
  1759. dl_trans_delay: dl_transdelay_t;
  1760. dl_priority: dl_priority_t;
  1761. dl_protection: dl_protect_t;
  1762. dl_residual_error: SInt32;
  1763. end;
  1764. type
  1765. dl_qos_cl_sel1_tPtr = ^dl_qos_cl_sel1_t;
  1766. dl_qos_cl_sel1_t = record
  1767. dl_qos_type: UInt32;
  1768. dl_trans_delay: SInt32;
  1769. dl_priority: SInt32;
  1770. dl_protection: SInt32;
  1771. dl_residual_error: SInt32;
  1772. end;
  1773. {
  1774. DLPI interface primitive definitions.
  1775. Each primitive is sent as a stream message. It is possible that
  1776. the messages may be viewed as a sequence of bytes that have the
  1777. following form without any padding. The structure definition
  1778. of the following messages may have to change depending on the
  1779. underlying hardware architecture and crossing of a hardware
  1780. boundary with a different hardware architecture.
  1781. Fields in the primitives having a name of the form
  1782. dl_reserved cannot be used and have the value of
  1783. binary zero, no bits turned on.
  1784. Each message has the name defined followed by the
  1785. stream message type (M_PROTO, M_PCPROTO, M_DATA)
  1786. }
  1787. { LOCAL MANAGEMENT SERVICE PRIMITIVES}
  1788. { DL_INFO_REQ, M_PCPROTO type}
  1789. type
  1790. dl_info_req_tPtr = ^dl_info_req_t;
  1791. dl_info_req_t = record
  1792. dl_primitive: UInt32; { set to DL_INFO_REQ }
  1793. end;
  1794. { DL_INFO_ACK, M_PCPROTO type}
  1795. type
  1796. dl_info_ack_tPtr = ^dl_info_ack_t;
  1797. dl_info_ack_t = record
  1798. dl_primitive: UInt32; { set to DL_INFO_ACK }
  1799. dl_max_sdu: UInt32; { Max bytes in a DLSDU }
  1800. dl_min_sdu: UInt32; { Min bytes in a DLSDU }
  1801. dl_addr_length: UInt32; { length of DLSAP address }
  1802. dl_mac_type: UInt32; { type of medium supported}
  1803. dl_reserved: UInt32; { value set to zero }
  1804. dl_current_state: UInt32; { state of DLPI interface }
  1805. dl_sap_length: SInt32; { current length of SAP part of dlsap address }
  1806. dl_service_mode: UInt32; { CO, CL or ACL }
  1807. dl_qos_length: UInt32; { length of qos values }
  1808. dl_qos_offset: UInt32; { offset from beg. of block}
  1809. dl_qos_range_length: UInt32; { available range of qos }
  1810. dl_qos_range_offset: UInt32; { offset from beg. of block}
  1811. dl_provider_style: UInt32; { style1 or style2 }
  1812. dl_addr_offset: UInt32; { offset of the dlsap addr }
  1813. dl_version: UInt32; { version number }
  1814. dl_brdcst_addr_length: UInt32; { length of broadcast addr }
  1815. dl_brdcst_addr_offset: UInt32; { offset from beg. of block}
  1816. dl_growth: UInt32; { set to zero }
  1817. end;
  1818. { DL_ATTACH_REQ, M_PROTO type}
  1819. type
  1820. dl_attach_req_tPtr = ^dl_attach_req_t;
  1821. dl_attach_req_t = record
  1822. dl_primitive: UInt32; { set to DL_ATTACH_REQ}
  1823. dl_ppa: UInt32; { id of the PPA }
  1824. end;
  1825. { DL_DETACH_REQ, M_PROTO type}
  1826. type
  1827. dl_detach_req_tPtr = ^dl_detach_req_t;
  1828. dl_detach_req_t = record
  1829. dl_primitive: UInt32; { set to DL_DETACH_REQ }
  1830. end;
  1831. { DL_BIND_REQ, M_PROTO type}
  1832. type
  1833. dl_bind_req_tPtr = ^dl_bind_req_t;
  1834. dl_bind_req_t = record
  1835. dl_primitive: UInt32; { set to DL_BIND_REQ }
  1836. dl_sap: UInt32; { info to identify dlsap addr}
  1837. dl_max_conind: UInt32; { max # of outstanding con_ind}
  1838. dl_service_mode: UInt16; { CO, CL or ACL }
  1839. dl_conn_mgmt: UInt16; { if non-zero, is con-mgmt stream}
  1840. dl_xidtest_flg: UInt32; { if set to 1 indicates automatic initiation of test and xid frames }
  1841. end;
  1842. { DL_BIND_ACK, M_PCPROTO type}
  1843. type
  1844. dl_bind_ack_tPtr = ^dl_bind_ack_t;
  1845. dl_bind_ack_t = record
  1846. dl_primitive: UInt32; { DL_BIND_ACK }
  1847. dl_sap: UInt32; { DLSAP addr info }
  1848. dl_addr_length: UInt32; { length of complete DLSAP addr }
  1849. dl_addr_offset: UInt32; { offset from beginning of M_PCPROTO}
  1850. dl_max_conind: UInt32; { allowed max. # of con-ind }
  1851. dl_xidtest_flg: UInt32; { responses supported by provider}
  1852. end;
  1853. { DL_SUBS_BIND_REQ, M_PROTO type}
  1854. type
  1855. dl_subs_bind_req_tPtr = ^dl_subs_bind_req_t;
  1856. dl_subs_bind_req_t = record
  1857. dl_primitive: UInt32; { DL_SUBS_BIND_REQ }
  1858. dl_subs_sap_offset: UInt32; { offset of subs_sap }
  1859. dl_subs_sap_length: UInt32; { length of subs_sap }
  1860. dl_subs_bind_class: UInt32; { peer or hierarchical }
  1861. end;
  1862. { DL_SUBS_BIND_ACK, M_PCPROTO type}
  1863. type
  1864. dl_subs_bind_ack_tPtr = ^dl_subs_bind_ack_t;
  1865. dl_subs_bind_ack_t = record
  1866. dl_primitive: UInt32; { DL_SUBS_BIND_ACK }
  1867. dl_subs_sap_offset: UInt32; { offset of subs_sap }
  1868. dl_subs_sap_length: UInt32; { length of subs_sap }
  1869. end;
  1870. { DL_UNBIND_REQ, M_PROTO type}
  1871. type
  1872. dl_unbind_req_tPtr = ^dl_unbind_req_t;
  1873. dl_unbind_req_t = record
  1874. dl_primitive: UInt32; { DL_UNBIND_REQ }
  1875. end;
  1876. { DL_SUBS_UNBIND_REQ, M_PROTO type}
  1877. type
  1878. dl_subs_unbind_req_tPtr = ^dl_subs_unbind_req_t;
  1879. dl_subs_unbind_req_t = record
  1880. dl_primitive: UInt32; { DL_SUBS_UNBIND_REQ }
  1881. dl_subs_sap_offset: UInt32; { offset of subs_sap }
  1882. dl_subs_sap_length: UInt32; { length of subs_sap }
  1883. end;
  1884. { DL_OK_ACK, M_PCPROTO type}
  1885. type
  1886. dl_ok_ack_tPtr = ^dl_ok_ack_t;
  1887. dl_ok_ack_t = record
  1888. dl_primitive: UInt32; { DL_OK_ACK }
  1889. dl_correct_primitive: UInt32; { primitive being acknowledged }
  1890. end;
  1891. { DL_ERROR_ACK, M_PCPROTO type}
  1892. type
  1893. dl_error_ack_tPtr = ^dl_error_ack_t;
  1894. dl_error_ack_t = record
  1895. dl_primitive: UInt32; { DL_ERROR_ACK }
  1896. dl_error_primitive: UInt32; { primitive in error }
  1897. dl_errno: UInt32; { DLPI error code }
  1898. dl_unix_errno: UInt32; { UNIX system error code }
  1899. end;
  1900. { DL_ENABMULTI_REQ, M_PROTO type}
  1901. type
  1902. dl_enabmulti_req_tPtr = ^dl_enabmulti_req_t;
  1903. dl_enabmulti_req_t = record
  1904. dl_primitive: UInt32; { DL_ENABMULTI_REQ }
  1905. dl_addr_length: UInt32; { length of multicast address }
  1906. dl_addr_offset: UInt32; { offset from beg. of M_PROTO block}
  1907. end;
  1908. { DL_DISABMULTI_REQ, M_PROTO type}
  1909. type
  1910. dl_disabmulti_req_tPtr = ^dl_disabmulti_req_t;
  1911. dl_disabmulti_req_t = record
  1912. dl_primitive: UInt32; { DL_DISABMULTI_REQ }
  1913. dl_addr_length: UInt32; { length of multicast address }
  1914. dl_addr_offset: UInt32; { offset from beg. of M_PROTO block}
  1915. end;
  1916. { DL_PROMISCON_REQ, M_PROTO type}
  1917. type
  1918. dl_promiscon_req_tPtr = ^dl_promiscon_req_t;
  1919. dl_promiscon_req_t = record
  1920. dl_primitive: UInt32; { DL_PROMISCON_REQ }
  1921. dl_level: UInt32; { physical,SAP level or ALL multicast}
  1922. end;
  1923. { DL_PROMISCOFF_REQ, M_PROTO type}
  1924. type
  1925. dl_promiscoff_req_tPtr = ^dl_promiscoff_req_t;
  1926. dl_promiscoff_req_t = record
  1927. dl_primitive: UInt32; { DL_PROMISCOFF_REQ }
  1928. dl_level: UInt32; { Physical,SAP level or ALL multicast}
  1929. end;
  1930. { Primitives to get and set the Physical address}
  1931. { DL_PHYS_ADDR_REQ, M_PROTO type}
  1932. type
  1933. dl_phys_addr_req_tPtr = ^dl_phys_addr_req_t;
  1934. dl_phys_addr_req_t = record
  1935. dl_primitive: UInt32; { DL_PHYS_ADDR_REQ }
  1936. dl_addr_type: UInt32; { factory or current physical addr }
  1937. end;
  1938. { DL_PHYS_ADDR_ACK, M_PCPROTO type}
  1939. type
  1940. dl_phys_addr_ack_tPtr = ^dl_phys_addr_ack_t;
  1941. dl_phys_addr_ack_t = record
  1942. dl_primitive: UInt32; { DL_PHYS_ADDR_ACK }
  1943. dl_addr_length: UInt32; { length of the physical addr }
  1944. dl_addr_offset: UInt32; { offset from beg. of block }
  1945. end;
  1946. { DL_SET_PHYS_ADDR_REQ, M_PROTO type}
  1947. type
  1948. dl_set_phys_addr_req_tPtr = ^dl_set_phys_addr_req_t;
  1949. dl_set_phys_addr_req_t = record
  1950. dl_primitive: UInt32; { DL_SET_PHYS_ADDR_REQ }
  1951. dl_addr_length: UInt32; { length of physical addr }
  1952. dl_addr_offset: UInt32; { offset from beg. of block }
  1953. end;
  1954. { Primitives to get statistics}
  1955. { DL_GET_STATISTICS_REQ, M_PROTO type}
  1956. type
  1957. dl_get_statistics_req_tPtr = ^dl_get_statistics_req_t;
  1958. dl_get_statistics_req_t = record
  1959. dl_primitive: UInt32; { DL_GET_STATISTICS_REQ }
  1960. end;
  1961. { DL_GET_STATISTICS_ACK, M_PCPROTO type}
  1962. type
  1963. dl_get_statistics_ack_tPtr = ^dl_get_statistics_ack_t;
  1964. dl_get_statistics_ack_t = record
  1965. dl_primitive: UInt32; { DL_GET_STATISTICS_ACK }
  1966. dl_stat_length: UInt32; { length of statistics structure}
  1967. dl_stat_offset: UInt32; { offset from beg. of block }
  1968. end;
  1969. { CONNECTION-ORIENTED SERVICE PRIMITIVES}
  1970. { DL_CONNECT_REQ, M_PROTO type}
  1971. type
  1972. dl_connect_req_tPtr = ^dl_connect_req_t;
  1973. dl_connect_req_t = record
  1974. dl_primitive: UInt32; { DL_CONNECT_REQ }
  1975. dl_dest_addr_length: UInt32; { len. of dlsap addr}
  1976. dl_dest_addr_offset: UInt32; { offset }
  1977. dl_qos_length: UInt32; { len. of QOS parm val}
  1978. dl_qos_offset: UInt32; { offset }
  1979. dl_growth: UInt32; { set to zero }
  1980. end;
  1981. { DL_CONNECT_IND, M_PROTO type}
  1982. type
  1983. dl_connect_ind_tPtr = ^dl_connect_ind_t;
  1984. dl_connect_ind_t = record
  1985. dl_primitive: UInt32; { DL_CONNECT_IND }
  1986. dl_correlation: UInt32; { provider's correlation token}
  1987. dl_called_addr_length: UInt32; { length of called address }
  1988. dl_called_addr_offset: UInt32; { offset from beginning of block }
  1989. dl_calling_addr_length: UInt32; { length of calling address }
  1990. dl_calling_addr_offset: UInt32; { offset from beginning of block }
  1991. dl_qos_length: UInt32; { length of qos structure }
  1992. dl_qos_offset: UInt32; { offset from beginning of block }
  1993. dl_growth: UInt32; { set to zero }
  1994. end;
  1995. { DL_CONNECT_RES, M_PROTO type}
  1996. type
  1997. dl_connect_res_tPtr = ^dl_connect_res_t;
  1998. dl_connect_res_t = record
  1999. dl_primitive: UInt32; { DL_CONNECT_RES }
  2000. dl_correlation: UInt32; { provider's correlation token }
  2001. dl_resp_token: UInt32; { token associated with responding stream }
  2002. dl_qos_length: UInt32; { length of qos structure }
  2003. dl_qos_offset: UInt32; { offset from beginning of block }
  2004. dl_growth: UInt32; { set to zero }
  2005. end;
  2006. { DL_CONNECT_CON, M_PROTO type}
  2007. type
  2008. dl_connect_con_tPtr = ^dl_connect_con_t;
  2009. dl_connect_con_t = record
  2010. dl_primitive: UInt32; { DL_CONNECT_CON}
  2011. dl_resp_addr_length: UInt32; { length of responder's address }
  2012. dl_resp_addr_offset: UInt32; { offset from beginning of block}
  2013. dl_qos_length: UInt32; { length of qos structure }
  2014. dl_qos_offset: UInt32; { offset from beginning of block}
  2015. dl_growth: UInt32; { set to zero }
  2016. end;
  2017. { DL_TOKEN_REQ, M_PCPROTO type}
  2018. type
  2019. dl_token_req_tPtr = ^dl_token_req_t;
  2020. dl_token_req_t = record
  2021. dl_primitive: UInt32; { DL_TOKEN_REQ }
  2022. end;
  2023. { DL_TOKEN_ACK, M_PCPROTO type}
  2024. type
  2025. dl_token_ack_tPtr = ^dl_token_ack_t;
  2026. dl_token_ack_t = record
  2027. dl_primitive: UInt32; { DL_TOKEN_ACK }
  2028. dl_token: UInt32; { Connection response token associated with the stream }
  2029. end;
  2030. { DL_DISCONNECT_REQ, M_PROTO type}
  2031. type
  2032. dl_disconnect_req_tPtr = ^dl_disconnect_req_t;
  2033. dl_disconnect_req_t = record
  2034. dl_primitive: UInt32; { DL_DISCONNECT_REQ }
  2035. dl_reason: UInt32; {normal, abnormal, perm. or transient}
  2036. dl_correlation: UInt32; { association with connect_ind }
  2037. end;
  2038. { DL_DISCONNECT_IND, M_PROTO type}
  2039. type
  2040. dl_disconnect_ind_tPtr = ^dl_disconnect_ind_t;
  2041. dl_disconnect_ind_t = record
  2042. dl_primitive: UInt32; { DL_DISCONNECT_IND }
  2043. dl_originator: UInt32; { USER or PROVIDER }
  2044. dl_reason: UInt32; { permanent or transient }
  2045. dl_correlation: UInt32; { association with connect_ind }
  2046. end;
  2047. { DL_RESET_REQ, M_PROTO type}
  2048. type
  2049. dl_reset_req_tPtr = ^dl_reset_req_t;
  2050. dl_reset_req_t = record
  2051. dl_primitive: UInt32; { DL_RESET_REQ }
  2052. end;
  2053. { DL_RESET_IND, M_PROTO type}
  2054. type
  2055. dl_reset_ind_tPtr = ^dl_reset_ind_t;
  2056. dl_reset_ind_t = record
  2057. dl_primitive: UInt32; { DL_RESET_IND }
  2058. dl_originator: UInt32; { Provider or User }
  2059. dl_reason: UInt32; { flow control, link error or resynch}
  2060. end;
  2061. { DL_RESET_RES, M_PROTO type}
  2062. type
  2063. dl_reset_res_tPtr = ^dl_reset_res_t;
  2064. dl_reset_res_t = record
  2065. dl_primitive: UInt32; { DL_RESET_RES }
  2066. end;
  2067. { DL_RESET_CON, M_PROTO type}
  2068. type
  2069. dl_reset_con_tPtr = ^dl_reset_con_t;
  2070. dl_reset_con_t = record
  2071. dl_primitive: UInt32; { DL_RESET_CON }
  2072. end;
  2073. { CONNECTIONLESS SERVICE PRIMITIVES}
  2074. { DL_UNITDATA_REQ, M_PROTO type, with M_DATA block(s)}
  2075. type
  2076. dl_unitdata_req_tPtr = ^dl_unitdata_req_t;
  2077. dl_unitdata_req_t = record
  2078. dl_primitive: UInt32; { DL_UNITDATA_REQ }
  2079. dl_dest_addr_length: UInt32; { DLSAP length of dest. user }
  2080. dl_dest_addr_offset: UInt32; { offset from beg. of block }
  2081. dl_priority: dl_priority_t; { priority value }
  2082. end;
  2083. { DL_UNITDATA_IND, M_PROTO type, with M_DATA block(s)}
  2084. type
  2085. dl_unitdata_ind_tPtr = ^dl_unitdata_ind_t;
  2086. dl_unitdata_ind_t = record
  2087. dl_primitive: UInt32; { DL_UNITDATA_IND }
  2088. dl_dest_addr_length: UInt32; { DLSAP length of dest. user }
  2089. dl_dest_addr_offset: UInt32; { offset from beg. of block }
  2090. dl_src_addr_length: UInt32; { DLSAP addr length of sending user}
  2091. dl_src_addr_offset: UInt32; { offset from beg. of block }
  2092. dl_group_address: UInt32; { set to one if multicast/broadcast}
  2093. end;
  2094. {
  2095. DL_UDERROR_IND, M_PROTO type
  2096. (or M_PCPROTO type if LLI-based provider)
  2097. }
  2098. type
  2099. dl_uderror_ind_tPtr = ^dl_uderror_ind_t;
  2100. dl_uderror_ind_t = record
  2101. dl_primitive: UInt32; { DL_UDERROR_IND }
  2102. dl_dest_addr_length: UInt32; { Destination DLSAP }
  2103. dl_dest_addr_offset: UInt32; { Offset from beg. of block }
  2104. dl_unix_errno: UInt32; { unix system error code}
  2105. dl_errno: UInt32; { DLPI error code }
  2106. end;
  2107. { DL_UDQOS_REQ, M_PROTO type}
  2108. type
  2109. dl_udqos_req_tPtr = ^dl_udqos_req_t;
  2110. dl_udqos_req_t = record
  2111. dl_primitive: UInt32; { DL_UDQOS_REQ }
  2112. dl_qos_length: UInt32; { length in bytes of requested qos}
  2113. dl_qos_offset: UInt32; { offset from beg. of block }
  2114. end;
  2115. { Primitives to handle XID and TEST operations}
  2116. { DL_TEST_REQ, M_PROTO type}
  2117. type
  2118. dl_test_req_tPtr = ^dl_test_req_t;
  2119. dl_test_req_t = record
  2120. dl_primitive: UInt32; { DL_TEST_REQ }
  2121. dl_flag: UInt32; { poll/final }
  2122. dl_dest_addr_length: UInt32; { DLSAP length of dest. user }
  2123. dl_dest_addr_offset: UInt32; { offset from beg. of block }
  2124. end;
  2125. { DL_TEST_IND, M_PROTO type}
  2126. type
  2127. dl_test_ind_tPtr = ^dl_test_ind_t;
  2128. dl_test_ind_t = record
  2129. dl_primitive: UInt32; { DL_TEST_IND }
  2130. dl_flag: UInt32; { poll/final }
  2131. dl_dest_addr_length: UInt32; { dlsap length of dest. user }
  2132. dl_dest_addr_offset: UInt32; { offset from beg. of block }
  2133. dl_src_addr_length: UInt32; { dlsap length of source user }
  2134. dl_src_addr_offset: UInt32; { offset from beg. of block }
  2135. end;
  2136. { DL_TEST_RES, M_PROTO type}
  2137. type
  2138. dl_test_res_tPtr = ^dl_test_res_t;
  2139. dl_test_res_t = record
  2140. dl_primitive: UInt32; { DL_TEST_RES }
  2141. dl_flag: UInt32; { poll/final }
  2142. dl_dest_addr_length: UInt32; { DLSAP length of dest. user }
  2143. dl_dest_addr_offset: UInt32; { offset from beg. of block }
  2144. end;
  2145. { DL_TEST_CON, M_PROTO type}
  2146. type
  2147. dl_test_con_tPtr = ^dl_test_con_t;
  2148. dl_test_con_t = record
  2149. dl_primitive: UInt32; { DL_TEST_CON }
  2150. dl_flag: UInt32; { poll/final }
  2151. dl_dest_addr_length: UInt32; { dlsap length of dest. user }
  2152. dl_dest_addr_offset: UInt32; { offset from beg. of block }
  2153. dl_src_addr_length: UInt32; { dlsap length of source user }
  2154. dl_src_addr_offset: UInt32; { offset from beg. of block }
  2155. end;
  2156. { DL_XID_REQ, M_PROTO type}
  2157. type
  2158. dl_xid_req_tPtr = ^dl_xid_req_t;
  2159. dl_xid_req_t = record
  2160. dl_primitive: UInt32; { DL_XID_REQ }
  2161. dl_flag: UInt32; { poll/final }
  2162. dl_dest_addr_length: UInt32; { dlsap length of dest. user }
  2163. dl_dest_addr_offset: UInt32; { offset from beg. of block }
  2164. end;
  2165. { DL_XID_IND, M_PROTO type}
  2166. type
  2167. dl_xid_ind_tPtr = ^dl_xid_ind_t;
  2168. dl_xid_ind_t = record
  2169. dl_primitive: UInt32; { DL_XID_IND }
  2170. dl_flag: UInt32; { poll/final }
  2171. dl_dest_addr_length: UInt32; { dlsap length of dest. user }
  2172. dl_dest_addr_offset: UInt32; { offset from beg. of block }
  2173. dl_src_addr_length: UInt32; { dlsap length of source user }
  2174. dl_src_addr_offset: UInt32; { offset from beg. of block }
  2175. end;
  2176. { DL_XID_RES, M_PROTO type}
  2177. type
  2178. dl_xid_res_tPtr = ^dl_xid_res_t;
  2179. dl_xid_res_t = record
  2180. dl_primitive: UInt32; { DL_XID_RES }
  2181. dl_flag: UInt32; { poll/final }
  2182. dl_dest_addr_length: UInt32; { DLSAP length of dest. user }
  2183. dl_dest_addr_offset: UInt32; { offset from beg. of block }
  2184. end;
  2185. { DL_XID_CON, M_PROTO type}
  2186. type
  2187. dl_xid_con_tPtr = ^dl_xid_con_t;
  2188. dl_xid_con_t = record
  2189. dl_primitive: UInt32; { DL_XID_CON }
  2190. dl_flag: UInt32; { poll/final }
  2191. dl_dest_addr_length: UInt32; { dlsap length of dest. user }
  2192. dl_dest_addr_offset: UInt32; { offset from beg. of block }
  2193. dl_src_addr_length: UInt32; { dlsap length of source user }
  2194. dl_src_addr_offset: UInt32; { offset from beg. of block }
  2195. end;
  2196. { ACKNOWLEDGED CONNECTIONLESS SERVICE PRIMITIVES}
  2197. { DL_DATA_ACK_REQ, M_PROTO type}
  2198. type
  2199. dl_data_ack_req_tPtr = ^dl_data_ack_req_t;
  2200. dl_data_ack_req_t = record
  2201. dl_primitive: UInt32; { DL_DATA_ACK_REQ }
  2202. dl_correlation: UInt32; { User's correlation token }
  2203. dl_dest_addr_length: UInt32; { length of destination addr }
  2204. dl_dest_addr_offset: UInt32; { offset from beginning of block }
  2205. dl_src_addr_length: UInt32; { length of source address }
  2206. dl_src_addr_offset: UInt32; { offset from beginning of block }
  2207. dl_priority: UInt32; { priority }
  2208. dl_service_class: UInt32; { DL_RQST_RSP or DL_RQST_NORSP }
  2209. end;
  2210. { DL_DATA_ACK_IND, M_PROTO type}
  2211. type
  2212. dl_data_ack_ind_tPtr = ^dl_data_ack_ind_t;
  2213. dl_data_ack_ind_t = record
  2214. dl_primitive: UInt32; { DL_DATA_ACK_IND }
  2215. dl_dest_addr_length: UInt32; { length of destination addr }
  2216. dl_dest_addr_offset: UInt32; { offset from beginning of block }
  2217. dl_src_addr_length: UInt32; { length of source address }
  2218. dl_src_addr_offset: UInt32; { offset from beginning of block }
  2219. dl_priority: UInt32; { priority for data unit transm. }
  2220. dl_service_class: UInt32; { DL_RQST_RSP or DL_RQST_NORSP }
  2221. end;
  2222. { DL_DATA_ACK_STATUS_IND, M_PROTO type}
  2223. type
  2224. dl_data_ack_status_ind_tPtr = ^dl_data_ack_status_ind_t;
  2225. dl_data_ack_status_ind_t = record
  2226. dl_primitive: UInt32; { DL_DATA_ACK_STATUS_IND }
  2227. dl_correlation: UInt32; { User's correlation token }
  2228. dl_status: UInt32; { success or failure of previous req}
  2229. end;
  2230. { DL_REPLY_REQ, M_PROTO type}
  2231. type
  2232. dl_reply_req_tPtr = ^dl_reply_req_t;
  2233. dl_reply_req_t = record
  2234. dl_primitive: UInt32; { DL_REPLY_REQ }
  2235. dl_correlation: UInt32; { User's correlation token }
  2236. dl_dest_addr_length: UInt32; { length of destination address }
  2237. dl_dest_addr_offset: UInt32; { offset from beginning of block }
  2238. dl_src_addr_length: UInt32; { source address length }
  2239. dl_src_addr_offset: UInt32; { offset from beginning of block }
  2240. dl_priority: UInt32; { priority for data unit transmission}
  2241. dl_service_class: UInt32;
  2242. end;
  2243. { DL_REPLY_IND, M_PROTO type}
  2244. type
  2245. dl_reply_ind_tPtr = ^dl_reply_ind_t;
  2246. dl_reply_ind_t = record
  2247. dl_primitive: UInt32; { DL_REPLY_IND }
  2248. dl_dest_addr_length: UInt32; { length of destination address }
  2249. dl_dest_addr_offset: UInt32; { offset from beginning of block}
  2250. dl_src_addr_length: UInt32; { length of source address }
  2251. dl_src_addr_offset: UInt32; { offset from beginning of block }
  2252. dl_priority: UInt32; { priority for data unit transmission}
  2253. dl_service_class: UInt32; { DL_RQST_RSP or DL_RQST_NORSP }
  2254. end;
  2255. { DL_REPLY_STATUS_IND, M_PROTO type}
  2256. type
  2257. dl_reply_status_ind_tPtr = ^dl_reply_status_ind_t;
  2258. dl_reply_status_ind_t = record
  2259. dl_primitive: UInt32; { DL_REPLY_STATUS_IND }
  2260. dl_correlation: UInt32; { User's correlation token }
  2261. dl_status: UInt32; { success or failure of previous req}
  2262. end;
  2263. { DL_REPLY_UPDATE_REQ, M_PROTO type}
  2264. type
  2265. dl_reply_update_req_tPtr = ^dl_reply_update_req_t;
  2266. dl_reply_update_req_t = record
  2267. dl_primitive: UInt32; { DL_REPLY_UPDATE_REQ }
  2268. dl_correlation: UInt32; { user's correlation token }
  2269. dl_src_addr_length: UInt32; { length of source address }
  2270. dl_src_addr_offset: UInt32; { offset from beginning of block }
  2271. end;
  2272. { DL_REPLY_UPDATE_STATUS_IND, M_PROTO type}
  2273. type
  2274. dl_reply_update_status_ind_tPtr = ^dl_reply_update_status_ind_t;
  2275. dl_reply_update_status_ind_t = record
  2276. dl_primitive: UInt32; { DL_REPLY_UPDATE_STATUS_IND }
  2277. dl_correlation: UInt32; { User's correlation token }
  2278. dl_status: UInt32; { success or failure of previous req}
  2279. end;
  2280. DL_primitivesPtr = ^DL_primitives;
  2281. DL_primitives = record
  2282. case SInt16 of
  2283. 0: (
  2284. dl_primitive: UInt32;
  2285. );
  2286. 1: (
  2287. info_req: dl_info_req_t;
  2288. );
  2289. 2: (
  2290. info_ack: dl_info_ack_t;
  2291. );
  2292. 3: (
  2293. attach_req: dl_attach_req_t;
  2294. );
  2295. 4: (
  2296. detach_req: dl_detach_req_t;
  2297. );
  2298. 5: (
  2299. bind_req: dl_bind_req_t;
  2300. );
  2301. 6: (
  2302. bind_ack: dl_bind_ack_t;
  2303. );
  2304. 7: (
  2305. unbind_req: dl_unbind_req_t;
  2306. );
  2307. 8: (
  2308. subs_bind_req: dl_subs_bind_req_t;
  2309. );
  2310. 9: (
  2311. subs_bind_ack: dl_subs_bind_ack_t;
  2312. );
  2313. 10: (
  2314. subs_unbind_req: dl_subs_unbind_req_t;
  2315. );
  2316. 11: (
  2317. ok_ack: dl_ok_ack_t;
  2318. );
  2319. 12: (
  2320. error_ack: dl_error_ack_t;
  2321. );
  2322. 13: (
  2323. connect_req: dl_connect_req_t;
  2324. );
  2325. 14: (
  2326. connect_ind: dl_connect_ind_t;
  2327. );
  2328. 15: (
  2329. connect_res: dl_connect_res_t;
  2330. );
  2331. 16: (
  2332. connect_con: dl_connect_con_t;
  2333. );
  2334. 17: (
  2335. token_req: dl_token_req_t;
  2336. );
  2337. 18: (
  2338. token_ack: dl_token_ack_t;
  2339. );
  2340. 19: (
  2341. disconnect_req: dl_disconnect_req_t;
  2342. );
  2343. 20: (
  2344. disconnect_ind: dl_disconnect_ind_t;
  2345. );
  2346. 21: (
  2347. reset_req: dl_reset_req_t;
  2348. );
  2349. 22: (
  2350. reset_ind: dl_reset_ind_t;
  2351. );
  2352. 23: (
  2353. reset_res: dl_reset_res_t;
  2354. );
  2355. 24: (
  2356. reset_con: dl_reset_con_t;
  2357. );
  2358. 25: (
  2359. unitdata_req: dl_unitdata_req_t;
  2360. );
  2361. 26: (
  2362. unitdata_ind: dl_unitdata_ind_t;
  2363. );
  2364. 27: (
  2365. uderror_ind: dl_uderror_ind_t;
  2366. );
  2367. 28: (
  2368. udqos_req: dl_udqos_req_t;
  2369. );
  2370. 29: (
  2371. enabmulti_req: dl_enabmulti_req_t;
  2372. );
  2373. 30: (
  2374. disabmulti_req: dl_disabmulti_req_t;
  2375. );
  2376. 31: (
  2377. promiscon_req: dl_promiscon_req_t;
  2378. );
  2379. 32: (
  2380. promiscoff_req: dl_promiscoff_req_t;
  2381. );
  2382. 33: (
  2383. physaddr_req: dl_phys_addr_req_t;
  2384. );
  2385. 34: (
  2386. physaddr_ack: dl_phys_addr_ack_t;
  2387. );
  2388. 35: (
  2389. set_physaddr_req: dl_set_phys_addr_req_t;
  2390. );
  2391. 36: (
  2392. get_statistics_req: dl_get_statistics_req_t;
  2393. );
  2394. 37: (
  2395. get_statistics_ack: dl_get_statistics_ack_t;
  2396. );
  2397. 38: (
  2398. test_req: dl_test_req_t;
  2399. );
  2400. 39: (
  2401. test_ind: dl_test_ind_t;
  2402. );
  2403. 40: (
  2404. test_res: dl_test_res_t;
  2405. );
  2406. 41: (
  2407. test_con: dl_test_con_t;
  2408. );
  2409. 42: (
  2410. xid_req: dl_xid_req_t;
  2411. );
  2412. 43: (
  2413. xid_ind: dl_xid_ind_t;
  2414. );
  2415. 44: (
  2416. xid_res: dl_xid_res_t;
  2417. );
  2418. 45: (
  2419. xid_con: dl_xid_con_t;
  2420. );
  2421. 46: (
  2422. data_ack_req: dl_data_ack_req_t;
  2423. );
  2424. 47: (
  2425. data_ack_ind: dl_data_ack_ind_t;
  2426. );
  2427. 48: (
  2428. data_ack_status_ind: dl_data_ack_status_ind_t;
  2429. );
  2430. 49: (
  2431. reply_req: dl_reply_req_t;
  2432. );
  2433. 50: (
  2434. reply_ind: dl_reply_ind_t;
  2435. );
  2436. 51: (
  2437. reply_status_ind: dl_reply_status_ind_t;
  2438. );
  2439. 52: (
  2440. reply_update_req: dl_reply_update_req_t;
  2441. );
  2442. 53: (
  2443. reply_update_status_ind: dl_reply_update_status_ind_t;
  2444. );
  2445. end;
  2446. const
  2447. DL_INFO_REQ_SIZE = SizeOf(dl_info_req_t);
  2448. DL_INFO_ACK_SIZE = SizeOf(dl_info_ack_t);
  2449. DL_ATTACH_REQ_SIZE = SizeOf(dl_attach_req_t);
  2450. DL_DETACH_REQ_SIZE = SizeOf(dl_detach_req_t);
  2451. DL_BIND_REQ_SIZE = SizeOf(dl_bind_req_t);
  2452. DL_BIND_ACK_SIZE = SizeOf(dl_bind_ack_t);
  2453. DL_UNBIND_REQ_SIZE = SizeOf(dl_unbind_req_t);
  2454. DL_SUBS_BIND_REQ_SIZE = SizeOf(dl_subs_bind_req_t);
  2455. DL_SUBS_BIND_ACK_SIZE = SizeOf(dl_subs_bind_ack_t);
  2456. DL_SUBS_UNBIND_REQ_SIZE = SizeOf(dl_subs_unbind_req_t);
  2457. DL_OK_ACK_SIZE = SizeOf(dl_ok_ack_t);
  2458. DL_ERROR_ACK_SIZE = SizeOf(dl_error_ack_t);
  2459. DL_CONNECT_REQ_SIZE = SizeOf(dl_connect_req_t);
  2460. DL_CONNECT_IND_SIZE = SizeOf(dl_connect_ind_t);
  2461. DL_CONNECT_RES_SIZE = SizeOf(dl_connect_res_t);
  2462. DL_CONNECT_CON_SIZE = SizeOf(dl_connect_con_t);
  2463. DL_TOKEN_REQ_SIZE = SizeOf(dl_token_req_t);
  2464. DL_TOKEN_ACK_SIZE = SizeOf(dl_token_ack_t);
  2465. DL_DISCONNECT_REQ_SIZE = SizeOf(dl_disconnect_req_t);
  2466. DL_DISCONNECT_IND_SIZE = SizeOf(dl_disconnect_ind_t);
  2467. DL_RESET_REQ_SIZE = SizeOf(dl_reset_req_t);
  2468. DL_RESET_IND_SIZE = SizeOf(dl_reset_ind_t);
  2469. DL_RESET_RES_SIZE = SizeOf(dl_reset_res_t);
  2470. DL_RESET_CON_SIZE = SizeOf(dl_reset_con_t);
  2471. DL_UNITDATA_REQ_SIZE = SizeOf(dl_unitdata_req_t);
  2472. DL_UNITDATA_IND_SIZE = SizeOf(dl_unitdata_ind_t);
  2473. DL_UDERROR_IND_SIZE = SizeOf(dl_uderror_ind_t);
  2474. DL_UDQOS_REQ_SIZE = SizeOf(dl_udqos_req_t);
  2475. DL_ENABMULTI_REQ_SIZE = SizeOf(dl_enabmulti_req_t);
  2476. DL_DISABMULTI_REQ_SIZE = SizeOf(dl_disabmulti_req_t);
  2477. DL_PROMISCON_REQ_SIZE = SizeOf(dl_promiscon_req_t);
  2478. DL_PROMISCOFF_REQ_SIZE = SizeOf(dl_promiscoff_req_t);
  2479. DL_PHYS_ADDR_REQ_SIZE = SizeOf(dl_phys_addr_req_t);
  2480. DL_PHYS_ADDR_ACK_SIZE = SizeOf(dl_phys_addr_ack_t);
  2481. DL_SET_PHYS_ADDR_REQ_SIZE = SizeOf(dl_set_phys_addr_req_t);
  2482. DL_GET_STATISTICS_REQ_SIZE = SizeOf(dl_get_statistics_req_t);
  2483. DL_GET_STATISTICS_ACK_SIZE = SizeOf(dl_get_statistics_ack_t);
  2484. DL_XID_REQ_SIZE = SizeOf(dl_xid_req_t);
  2485. DL_XID_IND_SIZE = SizeOf(dl_xid_ind_t);
  2486. DL_XID_RES_SIZE = SizeOf(dl_xid_res_t);
  2487. DL_XID_CON_SIZE = SizeOf(dl_xid_con_t);
  2488. DL_TEST_REQ_SIZE = SizeOf(dl_test_req_t);
  2489. DL_TEST_IND_SIZE = SizeOf(dl_test_ind_t);
  2490. DL_TEST_RES_SIZE = SizeOf(dl_test_res_t);
  2491. DL_TEST_CON_SIZE = SizeOf(dl_test_con_t);
  2492. DL_DATA_ACK_REQ_SIZE = SizeOf(dl_data_ack_req_t);
  2493. DL_DATA_ACK_IND_SIZE = SizeOf(dl_data_ack_ind_t);
  2494. DL_DATA_ACK_STATUS_IND_SIZE = SizeOf(dl_data_ack_status_ind_t);
  2495. DL_REPLY_REQ_SIZE = SizeOf(dl_reply_req_t);
  2496. DL_REPLY_IND_SIZE = SizeOf(dl_reply_ind_t);
  2497. DL_REPLY_STATUS_IND_SIZE = SizeOf(dl_reply_status_ind_t);
  2498. DL_REPLY_UPDATE_REQ_SIZE = SizeOf(dl_reply_update_req_t);
  2499. DL_REPLY_UPDATE_STATUS_IND_SIZE = SizeOf(dl_reply_update_status_ind_t);
  2500. const
  2501. DL_IOC_HDR_INFO = $6C0A; { Fast path request }
  2502. { ***** From the Mentat "modnames.h" *****}
  2503. const
  2504. MI_AFU_NAME = 'afu';
  2505. const
  2506. MI_AHARP_NAME = 'ahar';
  2507. const
  2508. MI_AHENET_NAME = 'ahen';
  2509. const
  2510. MI_ARP_NAME = 'arp';
  2511. const
  2512. MI_ARPM_NAME = 'arpm';
  2513. const
  2514. MI_COURMUX_NAME = 'courmux';
  2515. const
  2516. MI_CLONE_NAME = 'clone';
  2517. const
  2518. MI_DLB_NAME = 'dlb';
  2519. const
  2520. MI_DLM_NAME = 'dlm';
  2521. const
  2522. MI_DMODD_NAME = 'disdlpi';
  2523. const
  2524. MI_DMODT_NAME = 'distpi';
  2525. const
  2526. MI_DN_NAME = 'dn';
  2527. const
  2528. MI_DNF_NAME = 'dnf';
  2529. const
  2530. MI_DRVE_NAME = 'drve';
  2531. const
  2532. MI_ECHO_NAME = 'echo';
  2533. const
  2534. MI_ENXR_NAME = 'enxr';
  2535. const
  2536. MI_RAWIP_NAME = 'rawip';
  2537. const
  2538. MI_RAWIPM_NAME = 'rawipm';
  2539. const
  2540. MI_HAVOC_NAME = 'havoc';
  2541. const
  2542. MI_HAVOCM_NAME = 'havocm';
  2543. const
  2544. MI_IP_NAME = 'ip';
  2545. const
  2546. MI_IPM_NAME = 'ipm';
  2547. const
  2548. MI_IPX_NAME = 'ipx';
  2549. const
  2550. MI_LOG_NAME = 'log';
  2551. const
  2552. MI_MODE_NAME = 'mode';
  2553. const
  2554. MI_MUX_NAME = 'mux';
  2555. const
  2556. MI_NECHO_NAME = 'necho';
  2557. const
  2558. MI_NPEP_NAME = 'npep';
  2559. const
  2560. MI_NULS_NAME = 'nuls';
  2561. const
  2562. MI_NULZ_NAME = 'nulz';
  2563. const
  2564. MI_PASS_NAME = 'pass';
  2565. const
  2566. MI_PIPEMOD_NAME = 'pipemod';
  2567. const
  2568. MI_SAD_NAME = 'sad';
  2569. const
  2570. MI_SC_NAME = 'sc';
  2571. const
  2572. MI_SOCKMOD_NAME = 'sockmod';
  2573. const
  2574. MI_SPASS_NAME = 'spass';
  2575. const
  2576. MI_SPX_NAME = 'spx';
  2577. const
  2578. MI_STH_NAME = 'mi_sth';
  2579. const
  2580. MI_TCP_NAME = 'tcp';
  2581. const
  2582. MI_TCPM_NAME = 'tcpm';
  2583. const
  2584. MI_TIMOD_NAME = 'timod';
  2585. const
  2586. MI_TIRDWR_NAME = 'tirdwr';
  2587. const
  2588. MI_TMOD_NAME = 'tmod';
  2589. const
  2590. MI_TMUX_NAME = 'tmux';
  2591. const
  2592. MI_TPIT_NAME = 'tpit';
  2593. const
  2594. MI_TRSR_NAME = 'trsr';
  2595. const
  2596. MI_TRXR_NAME = 'trxr';
  2597. const
  2598. MI_UDP_NAME = 'udp';
  2599. const
  2600. MI_UDPM_NAME = 'udpm';
  2601. const
  2602. MI_WELD_NAME = 'mi_weld';
  2603. const
  2604. MI_XDG_NAME = 'xdg';
  2605. const
  2606. MI_XECHO_NAME = 'xecho';
  2607. const
  2608. MI_XF_NAME = 'xf';
  2609. const
  2610. MI_XFIPX_NAME = 'xfipx';
  2611. const
  2612. MI_XFXNS_NAME = 'xfxns';
  2613. const
  2614. MI_XPE_NAME = 'xpe';
  2615. const
  2616. MI_XS_NAME = 'xs';
  2617. const
  2618. MI_XTINDG_NAME = 'xtindg';
  2619. const
  2620. MI_XTINVC_NAME = 'xtinvc';
  2621. const
  2622. MI_XTM_NAME = 'xtm';
  2623. const
  2624. MI_XTMIP_NAME = 'xtmip';
  2625. const
  2626. MI_AFU_DEVICE = '/dev/afu';
  2627. const
  2628. MI_ARP_DEVICE = '/dev/arp';
  2629. const
  2630. MI_COURMUX_DEVICE = '/dev/courmux';
  2631. const
  2632. MI_CLONE_DEVICE = '/dev/clone';
  2633. const
  2634. MI_DLB_DEVICE = '/dev/dlb';
  2635. const
  2636. MI_DN_DEVICE = '/dev/dn';
  2637. const
  2638. MI_DNF_DEVICE = '/dev/dnf';
  2639. const
  2640. MI_DRVE_DEVICE = '/dev/drve';
  2641. const
  2642. MI_ECHO_DEVICE = '/dev/echo';
  2643. const
  2644. MI_RAWIP_DEVICE = '/dev/rawip';
  2645. const
  2646. MI_HAVOC_DEVICE = '/dev/havoc';
  2647. const
  2648. MI_IP_DEVICE = '/dev/ip';
  2649. const
  2650. MI_IPX_DEVICE = '/dev/ipx';
  2651. const
  2652. MI_LOG_DEVICE = '/dev/log';
  2653. const
  2654. MI_MODE_DEVICE = '/dev/mode';
  2655. const
  2656. MI_MUX_DEVICE = '/dev/mux';
  2657. const
  2658. MI_NECHO_DEVICE = '/dev/necho';
  2659. const
  2660. MI_NPEP_DEVICE = '/dev/npep';
  2661. const
  2662. MI_NULS_DEVICE = '/dev/nuls';
  2663. const
  2664. MI_NULZ_DEVICE = '/dev/nulz';
  2665. const
  2666. MI_SAD_DEVICE = '/dev/sad';
  2667. const
  2668. MI_SPX_DEVICE = '/dev/spx';
  2669. const
  2670. MI_TCP_DEVICE = '/dev/tcp';
  2671. const
  2672. MI_TMUX_DEVICE = '/dev/tmux';
  2673. const
  2674. MI_TMUX0_DEVICE = '/dev/tmux#0';
  2675. const
  2676. MI_TMUX1_DEVICE = '/dev/tmux#1';
  2677. const
  2678. MI_TPIT_DEVICE = '/dev/tpit';
  2679. const
  2680. MI_UDP_DEVICE = '/dev/udp';
  2681. const
  2682. MI_XDG_DEVICE = '/dev/xdg';
  2683. const
  2684. MI_XECHO_DEVICE = '/dev/xecho';
  2685. const
  2686. MI_XF_DEVICE = '/dev/xf';
  2687. const
  2688. MI_XPE_DEVICE = '/dev/xpe';
  2689. const
  2690. MI_XS_DEVICE = '/dev/xs';
  2691. const
  2692. MI_XTINDG_DEVICE = '/dev/xtindg';
  2693. const
  2694. MI_XTINVC_DEVICE = '/dev/xtinvc';
  2695. { Streamtab entries }
  2696. // #define MI_AFU_STREAMTAB afuinfo
  2697. // #define MI_AHARP_STREAMTAB aharinfo
  2698. // #define MI_AHENET_STREAMTAB aheninfo
  2699. // #define MI_ARP_STREAMTAB arpinfo
  2700. // #define MI_ARPM_STREAMTAB arpminfo
  2701. // #define MI_COURMUX_STREAMTAB courmuxinfo
  2702. // #define MI_CLONE_STREAMTAB cloneinfo
  2703. // #define MI_DLB_STREAMTAB dlbinfo
  2704. // #define MI_DLM_STREAMTAB dlminfo
  2705. // #define MI_DMODD_STREAMTAB dmoddinfo
  2706. // #define MI_DMODT_STREAMTAB dmodtinfo
  2707. // #define MI_DN_STREAMTAB dninfo
  2708. // #define MI_DNF_STREAMTAB dnfinfo
  2709. // #define MI_DRVE_STREAMTAB drveinfo
  2710. // #define MI_ECHO_STREAMTAB echoinfo
  2711. // #define MI_ENXR_STREAMTAB enxrinfo
  2712. // #define MI_HAVOC_STREAMTAB hvcinfo
  2713. // #define MI_HAVOCM_STREAMTAB hvcminfo
  2714. // #define MI_IP_STREAMTAB ipinfo
  2715. // #define MI_IPM_STREAMTAB ipminfo
  2716. // #define MI_IPX_STREAMTAB ipxinfo
  2717. // #define MI_LOG_STREAMTAB loginfo
  2718. // #define MI_MODE_STREAMTAB modeinfo
  2719. // #define MI_MUX_STREAMTAB muxinfo
  2720. // #define MI_NECHO_STREAMTAB nechoinfo
  2721. // #define MI_NPEP_STREAMTAB npepinfo
  2722. // #define MI_NULS_STREAMTAB nulsinfo
  2723. // #define MI_NULZ_STREAMTAB nulzinfo
  2724. // #define MI_PASS_STREAMTAB passinfo
  2725. // #define MI_PIPEMOD_STREAMTAB pmodinfo
  2726. // #define MI_RAWIP_STREAMTAB rawipinfo
  2727. // #define MI_RAWIPM_STREAMTAB rawipminfo
  2728. // #define MI_SAD_STREAMTAB sadinfo
  2729. // #define MI_SC_STREAMTAB scinfo
  2730. // #define MI_SOCKMOD_STREAMTAB sockmodinfo
  2731. // #define MI_SPASS_STREAMTAB spassinfo
  2732. // #define MI_SPX_STREAMTAB spxinfo
  2733. // #define MI_STH_STREAMTAB mi_sthinfo
  2734. // #define MI_TCP_STREAMTAB tcpinfo
  2735. // #define MI_TCPM_STREAMTAB tcpminfo
  2736. // #define MI_TIMOD_STREAMTAB timodinfo
  2737. // #define MI_TIRDWR_STREAMTAB tirdwrinfo
  2738. // #define MI_TMOD_STREAMTAB tmodinfo
  2739. // #define MI_TMUX_STREAMTAB tmuxinfo
  2740. // #define MI_TPIT_STREAMTAB tpitinfo
  2741. // #define MI_TRSR_STREAMTAB trsrinfo
  2742. // #define MI_TRXR_STREAMTAB trxrinfo
  2743. // #define MI_UDP_STREAMTAB udpinfo
  2744. // #define MI_UDPM_STREAMTAB udpminfo
  2745. // #define MI_WELD_STREAMTAB mi_weldinfo
  2746. // #define MI_XDG_STREAMTAB xdginfo
  2747. // #define MI_XECHO_STREAMTAB xechoinfo
  2748. // #define MI_XF_STREAMTAB xfinfo
  2749. // #define MI_XFIPX_STREAMTAB xfipxinfo
  2750. // #define MI_XFXNS_STREAMTAB xfxnsinfo
  2751. // #define MI_XPE_STREAMTAB xpeinfo
  2752. // #define MI_XS_STREAMTAB xsinfo
  2753. // #define MI_XTINDG_STREAMTAB xtindginfo
  2754. // #define MI_XTINVC_STREAMTAB xtinvcinfo
  2755. // #define MI_XTM_STREAMTAB xtminfo
  2756. // #define MI_XTMIP_STREAMTAB xtmipinfo
  2757. // #define MI_AFU_DEVFLAG afudevflag
  2758. // #define MI_AHARP_DEVFLAG ahardevflag
  2759. // #define MI_AHENET_DEVFLAG ahendevflag
  2760. // #define MI_ARP_DEVFLAG arpdevflag
  2761. // #define MI_ARPM_DEVFLAG arpmdevflag
  2762. // #define MI_COURMUX_DEVFLAG courmuxdevflag
  2763. // #define MI_CLONE_DEVFLAG clonedevflag
  2764. // #define MI_DLB_DEVFLAG dlbdevflag
  2765. // #define MI_DLM_DEVFLAG dlmdevflag
  2766. // #define MI_DMODD_DEVFLAG dmodddevflag
  2767. // #define MI_DMODT_DEVFLAG dmodtdevflag
  2768. // #define MI_DN_DEVFLAG dndevflag
  2769. // #define MI_DNF_DEVFLAG dnfdevflag
  2770. // #define MI_DRVE_DEVFLAG drvedevflag
  2771. // #define MI_ECHO_DEVFLAG echodevflag
  2772. // #define MI_ENXR_DEVFLAG enxrdevflag
  2773. // #define MI_HAVOC_DEVFLAG hvcdevflag
  2774. // #define MI_HAVOCM_DEVFLAG hvcmdevflag
  2775. // #define MI_IP_DEVFLAG ipdevflag
  2776. // #define MI_IPM_DEVFLAG ipmdevflag
  2777. // #define MI_IPX_DEVFLAG ipxdevflag
  2778. // #define MI_LOG_DEVFLAG logdevflag
  2779. // #define MI_MODE_DEVFLAG modedevflag
  2780. // #define MI_MUX_DEVFLAG muxdevflag
  2781. // #define MI_NECHO_DEVFLAG nechodevflag
  2782. // #define MI_NPEP_DEVFLAG npepdevflag
  2783. // #define MI_NULS_DEVFLAG nulsdevflag
  2784. // #define MI_NULZ_DEVFLAG nulzdevflag
  2785. // #define MI_PASS_DEVFLAG passdevflag
  2786. // #define MI_PIPEMOD_DEVFLAG pipemoddevflag
  2787. // #define MI_RAWIP_DEVFLAG rawipdevflag
  2788. // #define MI_RAWIPM_DEVFLAG rawipmdevflag
  2789. // #define MI_SAD_DEVFLAG saddevflag
  2790. // #define MI_SC_DEVFLAG scdevflag
  2791. // #define MI_SOCKMOD_DEVFLAG sockmoddevflag
  2792. // #define MI_SPASS_DEVFLAG spassdevflag
  2793. // #define MI_SPX_DEVFLAG spxdevflag
  2794. // #define MI_TCP_DEVFLAG tcpdevflag
  2795. // #define MI_TCPM_DEVFLAG tcpmdevflag
  2796. // #define MI_TIMOD_DEVFLAG timoddevflag
  2797. // #define MI_TIRDWR_DEVFLAG tirdwrdevflag
  2798. // #define MI_TMOD_DEVFLAG tmoddevflag
  2799. // #define MI_TMUX_DEVFLAG tmuxdevflag
  2800. // #define MI_TPIT_DEVFLAG tpitdevflag
  2801. // #define MI_TRSR_DEVFLAG trsrdevflag
  2802. // #define MI_TRXR_DEVFLAG trxrdevflag
  2803. // #define MI_UDP_DEVFLAG udpdevflag
  2804. // #define MI_UDPM_DEVFLAG udpmdevflag
  2805. // #define MI_XDG_DEVFLAG xdgdevflag
  2806. // #define MI_XECHO_DEVFLAG xechodevflag
  2807. // #define MI_XF_DEVFLAG xfdevflag
  2808. // #define MI_XFIPX_DEVFLAG xfipxdevflag
  2809. // #define MI_XFXNS_DEVFLAG xfxnsdevflag
  2810. // #define MI_XPE_DEVFLAG xpedevflag
  2811. // #define MI_XS_DEVFLAG xsdevflag
  2812. // #define MI_XTINDG_DEVFLAG xtindgdevflag
  2813. // #define MI_XTINVC_DEVFLAG xtinvcdevflag
  2814. // #define MI_XTM_DEVFLAG xtmdevflag
  2815. // #define MI_XTMIP_DEVFLAG xtmipdevflag
  2816. // #define MI_AFU_SQLVL SQLVL_QUEUEPAIR
  2817. // #define MI_AHARP_SQLVL SQLVL_QUEUE
  2818. // #define MI_AHENET_SQLVL SQLVL_QUEUE
  2819. // #define MI_ARP_SQLVL SQLVL_MODULE
  2820. // #define MI_ARPM_SQLVL SQLVL_MODULE
  2821. // #define MI_COURMUX_SQLVL SQLVL_MODULE
  2822. // #define MI_CLONE_SQLVL SQLVL_MODULE
  2823. // #define MI_DLB_SQLVL SQLVL_QUEUE
  2824. // #define MI_DLM_SQLVL SQLVL_QUEUE
  2825. // #define MI_DMODD_SQLVL SQLVL_QUEUE
  2826. // #define MI_DMODT_SQLVL SQLVL_QUEUE
  2827. // #define MI_DN_SQLVL SQLVL_QUEUE
  2828. // #define MI_DNF_SQLVL SQLVL_QUEUE
  2829. // #define MI_DRVE_SQLVL SQLVL_QUEUEPAIR
  2830. // #define MI_ECHO_SQLVL SQLVL_QUEUE
  2831. // #define MI_ENXR_SQLVL SQLVL_QUEUE
  2832. // #define MI_RAWIP_SQLVL SQLVL_QUEUE
  2833. // #define MI_RAWIPM_SQLVL SQLVL_QUEUE
  2834. // #define MI_HAVOC_SQLVL SQLVL_QUEUE
  2835. // #define MI_HAVOCM_SQLVL SQLVL_QUEUE
  2836. // #define MI_IP_SQLVL SQLVL_QUEUEPAIR
  2837. // #define MI_IPM_SQLVL SQLVL_QUEUEPAIR
  2838. // #define MI_IPX_SQLVL SQLVL_QUEUE
  2839. // #define MI_LOG_SQLVL SQLVL_MODULE
  2840. // #define MI_MODE_SQLVL SQLVL_QUEUEPAIR
  2841. // #define MI_MUX_SQLVL SQLVL_MODULE
  2842. // #define MI_NECHO_SQLVL SQLVL_QUEUE
  2843. // #define MI_NPEP_SQLVL SQLVL_QUEUE
  2844. // #define MI_NULS_SQLVL SQLVL_QUEUE
  2845. // #define MI_NULZ_SQLVL SQLVL_QUEUE
  2846. // #define MI_PASS_SQLVL SQLVL_QUEUE
  2847. // #define MI_PIPEMOD_SQLVL SQLVL_QUEUE
  2848. // #define MI_SAD_SQLVL SQLVL_MODULE
  2849. // #define MI_SC_SQLVL SQLVL_QUEUE
  2850. // #define MI_SOCKMOD_SQLVL SQLVL_QUEUEPAIR
  2851. // #define MI_SPASS_SQLVL SQLVL_QUEUE
  2852. // #define MI_SPX_SQLVL SQLVL_QUEUE
  2853. // #define MI_TCP_SQLVL SQLVL_QUEUEPAIR
  2854. // #define MI_TCPM_SQLVL SQLVL_QUEUEPAIR
  2855. // #define MI_TIMOD_SQLVL SQLVL_QUEUEPAIR
  2856. // #define MI_TIRDWR_SQLVL SQLVL_QUEUE
  2857. // #define MI_TMOD_SQLVL SQLVL_QUEUEPAIR
  2858. // #define MI_TMUX_SQLVL SQLVL_MODULE
  2859. // #define MI_TPIT_SQLVL SQLVL_MODULE
  2860. // #define MI_TRSR_SQLVL SQLVL_MODULE
  2861. // #define MI_TRXR_SQLVL SQLVL_QUEUE
  2862. // #define MI_UDP_SQLVL SQLVL_QUEUE
  2863. // #define MI_UDPM_SQLVL SQLVL_QUEUE
  2864. // #define MI_XDG_SQLVL SQLVL_QUEUE
  2865. // #define MI_XECHO_SQLVL SQLVL_QUEUE
  2866. // #define MI_XF_SQLVL SQLVL_MODULE
  2867. // #define MI_XFIPX_SQLVL SQLVL_MODULE
  2868. // #define MI_XFXNS_SQLVL SQLVL_MODULE
  2869. // #define MI_XPE_SQLVL SQLVL_QUEUE
  2870. // #define MI_XS_SQLVL SQLVL_QUEUEPAIR
  2871. // #define MI_XTINDG_SQLVL SQLVL_QUEUEPAIR
  2872. // #define MI_XTINVC_SQLVL SQLVL_QUEUEPAIR
  2873. // #define MI_XTM_SQLVL SQLVL_QUEUEPAIR
  2874. // #define MI_XTMIP_SQLVL SQLVL_QUEUEPAIR
  2875. { ***** Raw Streams *****}
  2876. {
  2877. Flags used in the fType field of OTReadInfo for functions.
  2878. I've removed the terse and confusing comments in this header
  2879. file. For a full description, read "Open Transport Advanced
  2880. Client Programming".
  2881. }
  2882. const
  2883. kOTNoMessagesAvailable = $FFFFFFFF;
  2884. kOTAnyMsgType = $FFFFFFFE;
  2885. kOTDataMsgTypes = $FFFFFFFC;
  2886. kOTMProtoMsgTypes = $FFFFFFFB;
  2887. kOTOnlyMProtoMsgTypes = $FFFFFFFA;
  2888. {
  2889. OTPutCommand, OTPutData, and OTPutWriteData flags.
  2890. These equates must not conflict with any of the other putmsg flags,
  2891. ie MSG_ANY, MSG_BAND, MSG_HIPRI, or RS_HIPRI.
  2892. ¥¥¥ These should probably move into whereever their
  2893. corresponding functions end up but, seeing as this
  2894. is APPLE_ONLY, I'm not too concerned ¥¥¥
  2895. }
  2896. const
  2897. RS_EXDATA = $20;
  2898. RS_ALLOWAGAIN = $40;
  2899. RS_DELIMITMSG = $80;
  2900. {$ifc NOT OTKERNEL}
  2901. { StreamRef is an opaque reference to a raw stream.}
  2902. type
  2903. StreamRef = UnivPtr;
  2904. const
  2905. kOTInvalidStreamRef = nil;
  2906. { PollRef structure is used with the OTStreamPoll function.}
  2907. type
  2908. PollRefPtr = ^PollRef;
  2909. PollRef = record
  2910. filler: SInt32; { holds a file descriptor an a UNIX system, replaced by ref (at end of structure) under OT}
  2911. events: SInt16;
  2912. revents: SInt16;
  2913. ref: StreamRef;
  2914. end;
  2915. { Poll masks for use with OTStreamPoll: }
  2916. const
  2917. POLLIN = $001; { A non-priority message is available }
  2918. POLLPRI = $002; { A high priority message is available }
  2919. POLLOUT = $004; { The stream is writable for non-priority messages }
  2920. POLLERR = $008; { A error message has arrived }
  2921. POLLHUP = $010; { A hangup has occurred }
  2922. POLLNVAL = $020; { This fd is bogus }
  2923. POLLRDNORM = $040; { A non-priority message is available }
  2924. POLLRDBAND = $080; { A priority message (band > 0) message is available }
  2925. POLLWRNORM = $100; { Same as POLLOUT }
  2926. POLLWRBAND = $200; { A priority band exists and is writable }
  2927. POLLMSG = $400; { A signal message has reached the front of the queue }
  2928. { OTReadInfo structure is used with the various functions that read and peek at the stream head.}
  2929. type
  2930. OTReadInfoPtr = ^OTReadInfo;
  2931. OTReadInfo = record
  2932. fType: UInt32;
  2933. fCommand: OTCommand;
  2934. fFiller: UInt32; { For compatibility with OT 1.0 and 1.1 }
  2935. fBytes: ByteCount;
  2936. fError: OSStatus;
  2937. end;
  2938. { Opening and closing raw streams}
  2939. {
  2940. * OTStreamOpen()
  2941. *
  2942. * Availability:
  2943. * Mac OS X: not available
  2944. * CarbonLib: not available
  2945. * Non-Carbon CFM: not available
  2946. }
  2947. {
  2948. * OTAsyncStreamOpen()
  2949. *
  2950. * Availability:
  2951. * Mac OS X: not available
  2952. * CarbonLib: not available
  2953. * Non-Carbon CFM: not available
  2954. }
  2955. {
  2956. * OTCreateStream()
  2957. *
  2958. * Availability:
  2959. * Mac OS X: not available
  2960. * CarbonLib: not available
  2961. * Non-Carbon CFM: not available
  2962. }
  2963. {
  2964. * OTAsyncCreateStream()
  2965. *
  2966. * Availability:
  2967. * Mac OS X: not available
  2968. * CarbonLib: not available
  2969. * Non-Carbon CFM: not available
  2970. }
  2971. {
  2972. * OTStreamClose()
  2973. *
  2974. * Availability:
  2975. * Mac OS X: not available
  2976. * CarbonLib: not available
  2977. * Non-Carbon CFM: not available
  2978. }
  2979. { Polling a stream for activity}
  2980. {
  2981. * OTStreamPoll()
  2982. *
  2983. * Availability:
  2984. * Mac OS X: not available
  2985. * CarbonLib: not available
  2986. * Non-Carbon CFM: not available
  2987. }
  2988. {
  2989. * OTAsyncStreamPoll()
  2990. *
  2991. * Availability:
  2992. * Mac OS X: not available
  2993. * CarbonLib: not available
  2994. * Non-Carbon CFM: not available
  2995. }
  2996. { Classic UNIX file descriptor operations}
  2997. {
  2998. * OTStreamRead()
  2999. *
  3000. * Availability:
  3001. * Mac OS X: not available
  3002. * CarbonLib: not available
  3003. * Non-Carbon CFM: not available
  3004. }
  3005. {
  3006. * OTStreamWrite()
  3007. *
  3008. * Availability:
  3009. * Mac OS X: not available
  3010. * CarbonLib: not available
  3011. * Non-Carbon CFM: not available
  3012. }
  3013. {
  3014. * OTStreamIoctl()
  3015. *
  3016. * Availability:
  3017. * Mac OS X: not available
  3018. * CarbonLib: not available
  3019. * Non-Carbon CFM: not available
  3020. }
  3021. {
  3022. * OTStreamPipe()
  3023. *
  3024. * Availability:
  3025. * Mac OS X: not available
  3026. * CarbonLib: not available
  3027. * Non-Carbon CFM: not available
  3028. }
  3029. { there can be only 2!}
  3030. { Notifiers and modes of operation}
  3031. {
  3032. * OTStreamInstallNotifier()
  3033. *
  3034. * Availability:
  3035. * Mac OS X: not available
  3036. * CarbonLib: not available
  3037. * Non-Carbon CFM: not available
  3038. }
  3039. {
  3040. * OTStreamRemoveNotifier()
  3041. *
  3042. * Availability:
  3043. * Mac OS X: not available
  3044. * CarbonLib: not available
  3045. * Non-Carbon CFM: not available
  3046. }
  3047. {
  3048. * OTStreamUseSyncIdleEvents()
  3049. *
  3050. * Availability:
  3051. * Mac OS X: not available
  3052. * CarbonLib: not available
  3053. * Non-Carbon CFM: not available
  3054. }
  3055. {
  3056. * OTStreamSetBlocking()
  3057. *
  3058. * Availability:
  3059. * Mac OS X: not available
  3060. * CarbonLib: not available
  3061. * Non-Carbon CFM: not available
  3062. }
  3063. {
  3064. * OTStreamSetNonBlocking()
  3065. *
  3066. * Availability:
  3067. * Mac OS X: not available
  3068. * CarbonLib: not available
  3069. * Non-Carbon CFM: not available
  3070. }
  3071. {
  3072. * OTStreamIsBlocking()
  3073. *
  3074. * Availability:
  3075. * Mac OS X: not available
  3076. * CarbonLib: not available
  3077. * Non-Carbon CFM: not available
  3078. }
  3079. {
  3080. * OTStreamSetSynchronous()
  3081. *
  3082. * Availability:
  3083. * Mac OS X: not available
  3084. * CarbonLib: not available
  3085. * Non-Carbon CFM: not available
  3086. }
  3087. {
  3088. * OTStreamSetAsynchronous()
  3089. *
  3090. * Availability:
  3091. * Mac OS X: not available
  3092. * CarbonLib: not available
  3093. * Non-Carbon CFM: not available
  3094. }
  3095. {
  3096. * OTStreamIsSynchronous()
  3097. *
  3098. * Availability:
  3099. * Mac OS X: not available
  3100. * CarbonLib: not available
  3101. * Non-Carbon CFM: not available
  3102. }
  3103. { STREAMS primitives}
  3104. {
  3105. * OTStreamGetMessage()
  3106. *
  3107. * Availability:
  3108. * Mac OS X: not available
  3109. * CarbonLib: not available
  3110. * Non-Carbon CFM: not available
  3111. }
  3112. {
  3113. * OTStreamGetPriorityMessage()
  3114. *
  3115. * Availability:
  3116. * Mac OS X: not available
  3117. * CarbonLib: not available
  3118. * Non-Carbon CFM: not available
  3119. }
  3120. {
  3121. * OTStreamPutMessage()
  3122. *
  3123. * Availability:
  3124. * Mac OS X: not available
  3125. * CarbonLib: not available
  3126. * Non-Carbon CFM: not available
  3127. }
  3128. {
  3129. * OTStreamPutPriorityMessage()
  3130. *
  3131. * Availability:
  3132. * Mac OS X: not available
  3133. * CarbonLib: not available
  3134. * Non-Carbon CFM: not available
  3135. }
  3136. { Miscellaneous stuff}
  3137. {
  3138. * OTStreamSetControlMask()
  3139. *
  3140. * Availability:
  3141. * Mac OS X: not available
  3142. * CarbonLib: not available
  3143. * Non-Carbon CFM: not available
  3144. }
  3145. {
  3146. Opening endpoints and mappers on a Stream - these calls are synchronous, and may
  3147. only be used at System Task time. Once the stream has been installed into a provider
  3148. or endpoint, you should not continue to use STREAMS APIs on it
  3149. }
  3150. {
  3151. * OTOpenProviderOnStream()
  3152. *
  3153. * Availability:
  3154. * Mac OS X: not available
  3155. * CarbonLib: not available
  3156. * Non-Carbon CFM: not available
  3157. }
  3158. {
  3159. * OTOpenEndpointOnStream()
  3160. *
  3161. * Availability:
  3162. * Mac OS X: not available
  3163. * CarbonLib: not available
  3164. * Non-Carbon CFM: not available
  3165. }
  3166. {
  3167. To quote an earlier version of this header file:
  3168. Some functions that should only be used if
  3169. you really know what you're doing.
  3170. }
  3171. {
  3172. * OTRemoveStreamFromProvider()
  3173. *
  3174. * Availability:
  3175. * Mac OS X: not available
  3176. * CarbonLib: not available
  3177. * Non-Carbon CFM: not available
  3178. }
  3179. {
  3180. * OTPeekMessage()
  3181. *
  3182. * Availability:
  3183. * Mac OS X: not available
  3184. * CarbonLib: not available
  3185. * Non-Carbon CFM: not available
  3186. }
  3187. {
  3188. * OTReadMessage()
  3189. *
  3190. * Availability:
  3191. * Mac OS X: not available
  3192. * CarbonLib: not available
  3193. * Non-Carbon CFM: not available
  3194. }
  3195. {
  3196. * OTPutBackBuffer()
  3197. *
  3198. * Availability:
  3199. * Mac OS X: not available
  3200. * CarbonLib: not available
  3201. * Non-Carbon CFM: not available
  3202. }
  3203. {
  3204. * OTPutBackPartialBuffer()
  3205. *
  3206. * Availability:
  3207. * Mac OS X: not available
  3208. * CarbonLib: not available
  3209. * Non-Carbon CFM: not available
  3210. }
  3211. {$endc} { !OTKERNEL }
  3212. {$endc} { CALL_NOT_IN_CARBON }
  3213. { ***** Port Utilities *****}
  3214. {$ifc NOT OTKERNEL}
  3215. {
  3216. These types and routines are used during sophisticated
  3217. port management. High-level clients may get involved
  3218. for things like request a port to be yielding, but typically
  3219. this stuff is used by protocol infrastructure.
  3220. }
  3221. {
  3222. OTPortCloseStruct is used when processing the kOTClosePortRequest
  3223. and kOTYieldPortRequest events.
  3224. }
  3225. type
  3226. OTPortCloseStructPtr = ^OTPortCloseStruct;
  3227. OTPortCloseStruct = record
  3228. fPortRef: OTPortRef; { The port requested to be closed.}
  3229. fTheProvider: ProviderRef; { The provider using the port.}
  3230. fDenyReason: OSStatus; { Set to a negative number to deny the request}
  3231. end;
  3232. { OTClientList structure is used with the OTYieldPortRequest function.}
  3233. type
  3234. OTClientListPtr = ^OTClientList;
  3235. OTClientList = record
  3236. fNumClients: ItemCount;
  3237. fBuffer: packed array [0..3] of UInt8;
  3238. end;
  3239. {
  3240. Returns a buffer containing all of the clients that refused to yield the port.
  3241. "size" is the total number of bytes @ buffer, including the fNumClients field.
  3242. }
  3243. {
  3244. * OTYieldPortRequest()
  3245. *
  3246. * Availability:
  3247. * Mac OS X: not available
  3248. * CarbonLib: not available
  3249. * Non-Carbon CFM: not available
  3250. }
  3251. { Send a notification to all Open Transport registered clients}
  3252. {
  3253. * OTNotifyAllClients()
  3254. *
  3255. * Availability:
  3256. * Mac OS X: not available
  3257. * CarbonLib: not available
  3258. * Non-Carbon CFM: not available
  3259. }
  3260. { Determine if "child" is a child port of "parent"}
  3261. {
  3262. * OTIsDependentPort()
  3263. *
  3264. * Availability:
  3265. * Mac OS X: not available
  3266. * CarbonLib: not available
  3267. * Non-Carbon CFM: not available
  3268. }
  3269. {$endc} { !OTKERNEL }
  3270. { ***** Timers ***** }
  3271. {
  3272. STREAMS plug-ins code should not use these timers, instead
  3273. they should use timer messages, ie mi_timer etc.
  3274. }
  3275. {$ifc NOT OTKERNEL}
  3276. type
  3277. OTTimerTask = SInt32;
  3278. {
  3279. Under Carbon, OTCreateTimerTask takes a client context pointer. Applications may pass NULL
  3280. after calling InitOpenTransport(kInitOTForApplicationMask, ...). Non-applications must always pass a
  3281. valid client context.
  3282. }
  3283. {
  3284. * OTCreateTimerTaskInContext() *** DEPRECATED ***
  3285. *
  3286. * Availability:
  3287. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  3288. * CarbonLib: in CarbonLib 1.0 and later
  3289. * Non-Carbon CFM: not available
  3290. }
  3291. function OTCreateTimerTaskInContext( upp: OTProcessUPP; arg: UnivPtr; clientContext: OTClientContextPtr ): SInt32; external name '_OTCreateTimerTaskInContext';
  3292. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  3293. {
  3294. * OTCreateTimerTask()
  3295. *
  3296. * Availability:
  3297. * Mac OS X: not available
  3298. * CarbonLib: not available
  3299. * Non-Carbon CFM: not available
  3300. }
  3301. {
  3302. * OTCancelTimerTask() *** DEPRECATED ***
  3303. *
  3304. * Availability:
  3305. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  3306. * CarbonLib: in CarbonLib 1.0 and later
  3307. * Non-Carbon CFM: not available
  3308. }
  3309. function OTCancelTimerTask( timerTask: OTTimerTask ): Boolean; external name '_OTCancelTimerTask';
  3310. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  3311. {
  3312. * OTDestroyTimerTask() *** DEPRECATED ***
  3313. *
  3314. * Availability:
  3315. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  3316. * CarbonLib: in CarbonLib 1.0 and later
  3317. * Non-Carbon CFM: not available
  3318. }
  3319. procedure OTDestroyTimerTask( timerTask: OTTimerTask ); external name '_OTDestroyTimerTask';
  3320. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  3321. {
  3322. * OTScheduleTimerTask() *** DEPRECATED ***
  3323. *
  3324. * Availability:
  3325. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  3326. * CarbonLib: in CarbonLib 1.0 and later
  3327. * Non-Carbon CFM: not available
  3328. }
  3329. function OTScheduleTimerTask( timerTask: OTTimerTask; milliSeconds: OTTimeout ): Boolean; external name '_OTScheduleTimerTask';
  3330. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  3331. { The following macro may be used by applications only.}
  3332. // #define OTCreateTimerTask(upp, arg) OTCreateTimerTaskInContext(upp, arg, NULL)
  3333. {$endc} { !OTKERNEL }
  3334. { ***** Miscellaneous Helpful Functions *****}
  3335. {$ifc NOT OTKERNEL}
  3336. {
  3337. These routines allow you to manipulate OT's buffer structures.
  3338. If you use no-copy receives (described in "OpenTransport.h")
  3339. you will need some of these routines, and may choose to use others.
  3340. See "Open Tranport Advanced Client Programming" for documentation.
  3341. }
  3342. {
  3343. * OTBufferDataSize() *** DEPRECATED ***
  3344. *
  3345. * Availability:
  3346. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  3347. * CarbonLib: in CarbonLib 1.0 and later
  3348. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  3349. }
  3350. function OTBufferDataSize( var buffer: OTBuffer ): OTByteCount; external name '_OTBufferDataSize';
  3351. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  3352. {
  3353. * OTReadBuffer() *** DEPRECATED ***
  3354. *
  3355. * Availability:
  3356. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  3357. * CarbonLib: in CarbonLib 1.0 and later
  3358. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  3359. }
  3360. function OTReadBuffer( var buffer: OTBufferInfo; dest: UnivPtr; var len: OTByteCount ): Boolean; external name '_OTReadBuffer';
  3361. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  3362. {
  3363. * OTReleaseBuffer() *** DEPRECATED ***
  3364. *
  3365. * Availability:
  3366. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  3367. * CarbonLib: in CarbonLib 1.0 and later
  3368. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  3369. }
  3370. procedure OTReleaseBuffer( var buffer: OTBuffer ); external name '_OTReleaseBuffer';
  3371. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  3372. {
  3373. * StoreIntoNetbuf()
  3374. *
  3375. * Availability:
  3376. * Mac OS X: not available
  3377. * CarbonLib: not available
  3378. * Non-Carbon CFM: not available
  3379. }
  3380. {
  3381. * StoreMsgIntoNetbuf()
  3382. *
  3383. * Availability:
  3384. * Mac OS X: not available
  3385. * CarbonLib: not available
  3386. * Non-Carbon CFM: not available
  3387. }
  3388. {$endc} { !OTKERNEL }
  3389. { ***** OTConfiguration *****}
  3390. {$ifc CALL_NOT_IN_CARBON}
  3391. {$ifc NOT OTKERNEL}
  3392. {
  3393. As promised in "OpenTransport.h", here are the routines
  3394. for advanced operations on configurations.
  3395. }
  3396. { Manipulating a configuration}
  3397. {
  3398. * OTCfigNewConfiguration()
  3399. *
  3400. * Availability:
  3401. * Mac OS X: not available
  3402. * CarbonLib: not available
  3403. * Non-Carbon CFM: not available
  3404. }
  3405. {
  3406. * OTCfigDeleteConfiguration()
  3407. *
  3408. * Availability:
  3409. * Mac OS X: not available
  3410. * CarbonLib: not available
  3411. * Non-Carbon CFM: not available
  3412. }
  3413. {
  3414. * OTCfigCloneConfiguration()
  3415. *
  3416. * Availability:
  3417. * Mac OS X: not available
  3418. * CarbonLib: not available
  3419. * Non-Carbon CFM: not available
  3420. }
  3421. {
  3422. * OTCfigPushNewSingleChild()
  3423. *
  3424. * Availability:
  3425. * Mac OS X: not available
  3426. * CarbonLib: not available
  3427. * Non-Carbon CFM: not available
  3428. }
  3429. {
  3430. * OTCfigPushParent()
  3431. *
  3432. * Availability:
  3433. * Mac OS X: not available
  3434. * CarbonLib: not available
  3435. * Non-Carbon CFM: not available
  3436. }
  3437. {
  3438. * OTCfigPushChild()
  3439. *
  3440. * Availability:
  3441. * Mac OS X: not available
  3442. * CarbonLib: not available
  3443. * Non-Carbon CFM: not available
  3444. }
  3445. {
  3446. * OTCfigPopChild()
  3447. *
  3448. * Availability:
  3449. * Mac OS X: not available
  3450. * CarbonLib: not available
  3451. * Non-Carbon CFM: not available
  3452. }
  3453. {
  3454. * OTCfigGetChild()
  3455. *
  3456. * Availability:
  3457. * Mac OS X: not available
  3458. * CarbonLib: not available
  3459. * Non-Carbon CFM: not available
  3460. }
  3461. {
  3462. * OTCfigSetPath()
  3463. *
  3464. * Availability:
  3465. * Mac OS X: not available
  3466. * CarbonLib: not available
  3467. * Non-Carbon CFM: not available
  3468. }
  3469. {
  3470. * OTCfigNewChild()
  3471. *
  3472. * Availability:
  3473. * Mac OS X: not available
  3474. * CarbonLib: not available
  3475. * Non-Carbon CFM: not available
  3476. }
  3477. {
  3478. * OTCfigAddChild()
  3479. *
  3480. * Availability:
  3481. * Mac OS X: not available
  3482. * CarbonLib: not available
  3483. * Non-Carbon CFM: not available
  3484. }
  3485. {
  3486. * OTCfigRemoveChild()
  3487. *
  3488. * Availability:
  3489. * Mac OS X: not available
  3490. * CarbonLib: not available
  3491. * Non-Carbon CFM: not available
  3492. }
  3493. {
  3494. * OTCfigSetPortRef()
  3495. *
  3496. * Availability:
  3497. * Mac OS X: not available
  3498. * CarbonLib: not available
  3499. * Non-Carbon CFM: not available
  3500. }
  3501. {
  3502. * OTCfigChangeProviderName()
  3503. *
  3504. * Availability:
  3505. * Mac OS X: not available
  3506. * CarbonLib: not available
  3507. * Non-Carbon CFM: not available
  3508. }
  3509. { Query a configuration}
  3510. {
  3511. * OTCfigNumberOfChildren()
  3512. *
  3513. * Availability:
  3514. * Mac OS X: not available
  3515. * CarbonLib: not available
  3516. * Non-Carbon CFM: not available
  3517. }
  3518. {
  3519. * OTCfigGetParent()
  3520. *
  3521. * Availability:
  3522. * Mac OS X: not available
  3523. * CarbonLib: not available
  3524. * Non-Carbon CFM: not available
  3525. }
  3526. {
  3527. * OTCfigGetOptionNetbuf()
  3528. *
  3529. * Availability:
  3530. * Mac OS X: not available
  3531. * CarbonLib: not available
  3532. * Non-Carbon CFM: not available
  3533. }
  3534. {
  3535. * OTCfigGetPortRef()
  3536. *
  3537. * Availability:
  3538. * Mac OS X: not available
  3539. * CarbonLib: not available
  3540. * Non-Carbon CFM: not available
  3541. }
  3542. {
  3543. * OTCfigGetInstallFlags()
  3544. *
  3545. * Availability:
  3546. * Mac OS X: not available
  3547. * CarbonLib: not available
  3548. * Non-Carbon CFM: not available
  3549. }
  3550. {
  3551. * OTCfigGetProviderName()
  3552. *
  3553. * Availability:
  3554. * Mac OS X: not available
  3555. * CarbonLib: not available
  3556. * Non-Carbon CFM: not available
  3557. }
  3558. {
  3559. * OTCfigIsPort()
  3560. *
  3561. * Availability:
  3562. * Mac OS X: not available
  3563. * CarbonLib: not available
  3564. * Non-Carbon CFM: not available
  3565. }
  3566. {$endc} { !OTKERNEL }
  3567. { ***** Configurators *****}
  3568. {
  3569. The kOTConfiguratorInterfaceID define is what you need to add to your
  3570. export file for the "interfaceID = " clause to export a configurator
  3571. for ASLM. Similarly, kOTConfiguratorCFMTag is used for CFM-based
  3572. configurators.
  3573. }
  3574. // #define kOTConfiguratorInterfaceID kOTClientPrefix "cfigMkr"
  3575. // #define kOTConfiguratorCFMTag kOTClientPrefix "cfigMkr"
  3576. {$ifc NOT OTKERNEL}
  3577. type
  3578. TOTConfiguratorRef = ^SInt32; { an opaque 32-bit type }
  3579. TOTConfiguratorRefPtr = ^TOTConfiguratorRef;
  3580. {
  3581. Typedef for the OTCanConfigure function, and the enum for which pass we're doing.
  3582. The first (kOTSpecificConfigPass) is to give configurators a shot at the configuration
  3583. before we start allowing the generic configurators to get into the act.
  3584. }
  3585. const
  3586. kOTSpecificConfigPass = 0;
  3587. kOTGenericConfigPass = 1;
  3588. type
  3589. OTCanConfigureProcPtr = function( cfig: OTConfigurationRef; pass: UInt32 ): Boolean;
  3590. { Typedef for the function to create and return a configurator object}
  3591. type
  3592. OTCreateConfiguratorProcPtr = function( var cfigor: TOTConfiguratorRef ): OSStatus;
  3593. {
  3594. Typedef for the "OTSetupConfigurator" function that your configurator library must export.
  3595. The enum is for the type of configurator that it is.
  3596. }
  3597. const
  3598. kOTSetupConfiguratorID = 'OTSetupConfigurator';
  3599. const
  3600. kOTDefaultConfigurator = 0;
  3601. kOTProtocolFamilyConfigurator = 1;
  3602. kOTLinkDriverConfigurator = 2;
  3603. type
  3604. OTSetupConfiguratorProcPtr = function( var canConfigure: OTCanConfigureProcPtr; var createConfigurator: OTCreateConfiguratorProcPtr; var configuratorType: UInt8 ): OSStatus;
  3605. {
  3606. Procedure pointer definitions for the three key callbacks associated
  3607. with a configurator, as established by OTNewConfigurator.
  3608. }
  3609. type
  3610. OTCFConfigureProcPtr = function( cfigor: TOTConfiguratorRef; cfig: OTConfigurationRef ): OSStatus;
  3611. OTCFCreateStreamProcPtr = function( cfigor: TOTConfiguratorRef; cfig: OTConfigurationRef; oFlags: OTOpenFlags; proc: OTNotifyUPP; contextPtr: UnivPtr ): OSStatus;
  3612. OTCFHandleSystemEventProcPtr = procedure( cfigor: TOTConfiguratorRef; code: OTEventCode; result: OTResult; cookie: UnivPtr );
  3613. {
  3614. Determine if this instance of your configurator is the "master"
  3615. (the one that can create and destroy control streams)
  3616. }
  3617. {
  3618. * OTIsMasterConfigurator()
  3619. *
  3620. * Availability:
  3621. * Mac OS X: not available
  3622. * CarbonLib: not available
  3623. * Non-Carbon CFM: not available
  3624. }
  3625. { Get back the userData you passed in to OTNewConfigurator}
  3626. {
  3627. * OTGetConfiguratorUserData()
  3628. *
  3629. * Availability:
  3630. * Mac OS X: not available
  3631. * CarbonLib: not available
  3632. * Non-Carbon CFM: not available
  3633. }
  3634. { Create a configurator object for use by Open Transport}
  3635. {
  3636. * OTNewConfigurator()
  3637. *
  3638. * Availability:
  3639. * Mac OS X: not available
  3640. * CarbonLib: not available
  3641. * Non-Carbon CFM: not available
  3642. }
  3643. { Delete a configurator object created by OTNewConfigurator}
  3644. {
  3645. * OTDeleteConfigurator()
  3646. *
  3647. * Availability:
  3648. * Mac OS X: not available
  3649. * CarbonLib: not available
  3650. * Non-Carbon CFM: not available
  3651. }
  3652. {
  3653. A utility function to send notifications to the user - it takes care of calls
  3654. from deferred tasks
  3655. }
  3656. {
  3657. * OTNotifyUser()
  3658. *
  3659. * Availability:
  3660. * Mac OS X: not available
  3661. * CarbonLib: not available
  3662. * Non-Carbon CFM: not available
  3663. }
  3664. { Call when the configurator unloads from memory}
  3665. {
  3666. * OTConfiguratorUnloaded()
  3667. *
  3668. * Availability:
  3669. * Mac OS X: not available
  3670. * CarbonLib: not available
  3671. * Non-Carbon CFM: not available
  3672. }
  3673. {
  3674. Call to create your control stream if you're not the master
  3675. configurator. You can also use the state machine function
  3676. OTSMCreateControlStream(OTStateMachine*, OTConfigurationRef, TOTConfiguratorRef cfigor).
  3677. }
  3678. {
  3679. * OTCreateControlStream()
  3680. *
  3681. * Availability:
  3682. * Mac OS X: not available
  3683. * CarbonLib: not available
  3684. * Non-Carbon CFM: not available
  3685. }
  3686. {
  3687. A helpful function for the configurators to
  3688. be able to recursively configure the children.
  3689. }
  3690. {
  3691. * OTConfigureChildren()
  3692. *
  3693. * Availability:
  3694. * Mac OS X: not available
  3695. * CarbonLib: not available
  3696. * Non-Carbon CFM: not available
  3697. }
  3698. { Allocate a bit in the system-wide control mask for streams.}
  3699. {
  3700. * OTNewControlMask()
  3701. *
  3702. * Availability:
  3703. * Mac OS X: not available
  3704. * CarbonLib: not available
  3705. * Non-Carbon CFM: not available
  3706. }
  3707. { Warning: These 2 APIs is going away}
  3708. {
  3709. * OTCloseProvidersByUseCount()
  3710. *
  3711. * Availability:
  3712. * Mac OS X: not available
  3713. * CarbonLib: not available
  3714. * Non-Carbon CFM: not available
  3715. }
  3716. {
  3717. * OTCloseProvidersByPortRef()
  3718. *
  3719. * Availability:
  3720. * Mac OS X: not available
  3721. * CarbonLib: not available
  3722. * Non-Carbon CFM: not available
  3723. }
  3724. { These are the "real" APIs}
  3725. {
  3726. * OTCloseProviderByStream()
  3727. *
  3728. * Availability:
  3729. * Mac OS X: not available
  3730. * CarbonLib: not available
  3731. * Non-Carbon CFM: not available
  3732. }
  3733. {
  3734. * OTCloseMatchingProviders()
  3735. *
  3736. * Availability:
  3737. * Mac OS X: not available
  3738. * CarbonLib: not available
  3739. * Non-Carbon CFM: not available
  3740. }
  3741. { The following defines are for use in building an 'epcf' resource: }
  3742. { Defines for fFlags field: }
  3743. const
  3744. kIsReliable = $00000001;
  3745. kIsNotReliable = $00000002;
  3746. kSupportsOrderlyRelease = $00000004;
  3747. { Defines for fProtocolType field: }
  3748. kStream = $0001;
  3749. kUStream = $0002;
  3750. kTransaction = $0004;
  3751. kUTransaction = $0008;
  3752. kMapper = $0010;
  3753. kGenericProtocol = $0020;
  3754. { Defines for optionType field: }
  3755. const
  3756. kBooleanOption = 0;
  3757. const
  3758. kUnsignedValueOption = 1;
  3759. const
  3760. kSignedValueOption = 2;
  3761. const
  3762. kHexValueOption = 3;
  3763. const
  3764. kPrintableStringOption = 4;
  3765. const
  3766. kOctetStringOption = 5;
  3767. { Defines for fUpperInterface and fLowerInterface: }
  3768. const
  3769. kTPIInterface = $54504920 (* 'TPI ' *);
  3770. kDLPIInterface = $444C5049 (* 'DLPI' *);
  3771. kMapperInterface = $4D415052 (* 'MAPR' *);
  3772. kPrivateInterface = -1;
  3773. const
  3774. kNoInterface = 0;
  3775. {$endc} { !OTKERNEL }
  3776. {$endc} { CALL_NOT_IN_CARBON }
  3777. { ***** OTStateMachine *****}
  3778. {$ifc CALL_NOT_IN_CARBON}
  3779. {
  3780. This utility set allows you to write an asynchronous chain of code that looks
  3781. somewhat like it is synchronous. This is primarily used for plumbing
  3782. streams asynchronously, especially in configurators
  3783. }
  3784. {$ifc NOT OTKERNEL}
  3785. { Alas, the state machine is only available to client code. Sorry.}
  3786. {
  3787. There are 12 or 8 bytes of reserved space at the front of
  3788. the OTStateMachine structure, depending on whether you're
  3789. building PowerPC or 68K code.. The OTStateMachineDataPad
  3790. type compensates for this.
  3791. }
  3792. {$ifc TARGET_CPU_PPC}
  3793. type
  3794. OTStateMachineDataPad = packed array [0..11] of UInt8;
  3795. {$elsec}
  3796. type
  3797. OTStateMachineDataPad = packed array [0..7] of UInt8;
  3798. {$endc} {TARGET_CPU_PPC}
  3799. {
  3800. Forward define OTStateMachine so that OTStateProcPtr has
  3801. access to it.
  3802. }
  3803. type
  3804. OTStateMachinePtr = ^OTStateMachine;
  3805. {
  3806. This type is is the required prototype of a state machine
  3807. entry point.
  3808. }
  3809. OTStateProcPtr = procedure( var sm: OTStateMachine );
  3810. {
  3811. This type defines a routine that the state machine will
  3812. call when the top level completes.
  3813. }
  3814. OTSMCompleteProcPtr = procedure( contextPtr: UnivPtr );
  3815. { And now for the state machine structure itself.}
  3816. OTStateMachine = record
  3817. fData: OTStateMachineDataPad;
  3818. fCookie: UnivPtr;
  3819. fCode: OTEventCode;
  3820. fResult: OTResult;
  3821. end;
  3822. // #define kOTSMBufferSize(callDepth) (80 + (callDepth * 8))
  3823. {
  3824. For structSize, pass the size of your structure that you want associated with
  3825. the state machine. It can later be obtained by calling OTSMGetClientData.
  3826. For bufSize, use the kOTSMBufferSize macro, plus the size of your structure
  3827. to create a buffer on the stack. For synchronous calls, the stack buffer will
  3828. be used (unless you pass in NULL). The callDepth is the depth level of nested
  3829. calls using OTSMCallStateProc.
  3830. }
  3831. {
  3832. * OTCreateStateMachine()
  3833. *
  3834. * Availability:
  3835. * Mac OS X: not available
  3836. * CarbonLib: not available
  3837. * Non-Carbon CFM: not available
  3838. }
  3839. {
  3840. * OTDestroyStateMachine()
  3841. *
  3842. * Availability:
  3843. * Mac OS X: not available
  3844. * CarbonLib: not available
  3845. * Non-Carbon CFM: not available
  3846. }
  3847. {
  3848. OTSMCallStateProc used to take a parameter of type UInt16_p,
  3849. which was defined to be the same as UInt32. In an attempt
  3850. to reduce the number of wacky types defined by the OT
  3851. interfaces, we've changed these routines to just take a
  3852. straight UInt32. You should be warned that the current
  3853. implementation does not support values outside of the
  3854. range 0..32767. The same applies to OTSMSetState.
  3855. }
  3856. {
  3857. * OTSMCallStateProc()
  3858. *
  3859. * Availability:
  3860. * Mac OS X: not available
  3861. * CarbonLib: not available
  3862. * Non-Carbon CFM: not available
  3863. }
  3864. {
  3865. * OTSMGetState()
  3866. *
  3867. * Availability:
  3868. * Mac OS X: not available
  3869. * CarbonLib: not available
  3870. * Non-Carbon CFM: not available
  3871. }
  3872. {
  3873. * OTSMSetState()
  3874. *
  3875. * Availability:
  3876. * Mac OS X: not available
  3877. * CarbonLib: not available
  3878. * Non-Carbon CFM: not available
  3879. }
  3880. { Fill out the fCookie, fCode, and fResult fields before calling!}
  3881. {
  3882. * OTSMComplete()
  3883. *
  3884. * Availability:
  3885. * Mac OS X: not available
  3886. * CarbonLib: not available
  3887. * Non-Carbon CFM: not available
  3888. }
  3889. {
  3890. * OTSMPopCallback()
  3891. *
  3892. * Availability:
  3893. * Mac OS X: not available
  3894. * CarbonLib: not available
  3895. * Non-Carbon CFM: not available
  3896. }
  3897. {
  3898. * OTSMWaitForComplete()
  3899. *
  3900. * Availability:
  3901. * Mac OS X: not available
  3902. * CarbonLib: not available
  3903. * Non-Carbon CFM: not available
  3904. }
  3905. {
  3906. * OTSMCreateStream()
  3907. *
  3908. * Availability:
  3909. * Mac OS X: not available
  3910. * CarbonLib: not available
  3911. * Non-Carbon CFM: not available
  3912. }
  3913. {
  3914. * OTSMOpenStream()
  3915. *
  3916. * Availability:
  3917. * Mac OS X: not available
  3918. * CarbonLib: not available
  3919. * Non-Carbon CFM: not available
  3920. }
  3921. {
  3922. * OTSMIoctl()
  3923. *
  3924. * Availability:
  3925. * Mac OS X: not available
  3926. * CarbonLib: not available
  3927. * Non-Carbon CFM: not available
  3928. }
  3929. {
  3930. * OTSMPutMessage()
  3931. *
  3932. * Availability:
  3933. * Mac OS X: not available
  3934. * CarbonLib: not available
  3935. * Non-Carbon CFM: not available
  3936. }
  3937. {
  3938. * OTSMGetMessage()
  3939. *
  3940. * Availability:
  3941. * Mac OS X: not available
  3942. * CarbonLib: not available
  3943. * Non-Carbon CFM: not available
  3944. }
  3945. {
  3946. * OTSMReturnToCaller()
  3947. *
  3948. * Availability:
  3949. * Mac OS X: not available
  3950. * CarbonLib: not available
  3951. * Non-Carbon CFM: not available
  3952. }
  3953. {
  3954. * OTSMGetClientData()
  3955. *
  3956. * Availability:
  3957. * Mac OS X: not available
  3958. * CarbonLib: not available
  3959. * Non-Carbon CFM: not available
  3960. }
  3961. {
  3962. * OTSMInstallCompletionProc()
  3963. *
  3964. * Availability:
  3965. * Mac OS X: not available
  3966. * CarbonLib: not available
  3967. * Non-Carbon CFM: not available
  3968. }
  3969. {
  3970. * OTSMCreateControlStream()
  3971. *
  3972. * Availability:
  3973. * Mac OS X: not available
  3974. * CarbonLib: not available
  3975. * Non-Carbon CFM: not available
  3976. }
  3977. {$endc} { !OTKERNEL }
  3978. { ***** Autopush Definitions *****}
  3979. {
  3980. The autopush functionality for Open Transport is based on the names of
  3981. devices and modules, rather than on the major number information like
  3982. SVR4. This is so that autopush information can be set up for modules
  3983. that are not yet loaded.
  3984. }
  3985. { The name of the STREAMS driver you open and send the ioctls to.}
  3986. const
  3987. kSADModuleName = 'sad';
  3988. { Autopush ioctls.}
  3989. const
  3990. I_SAD_SAP = $6701; { Set autopush information }
  3991. I_SAD_GAP = $6702; { Get autopush information }
  3992. I_SAD_VML = $6703; { Validate a list of modules (uses str_list structure) }
  3993. { Maximum number of modules autopushed on a driver.}
  3994. const
  3995. kOTAutopushMax = 8;
  3996. { ioctl structure used for SAD_SAP and SAD_GAP commands.}
  3997. type
  3998. OTAutopushInfoPtr = ^OTAutopushInfo;
  3999. OTAutopushInfo = record
  4000. sap_cmd: UInt32;
  4001. sap_device_name: packed array [0..31] of char;
  4002. sap_minor: SInt32;
  4003. sap_lastminor: SInt32;
  4004. sap_npush: SInt32;
  4005. sap_list: packed array [0..7,0..31] of char;
  4006. end;
  4007. { Command values for sap_cmd field of the above.}
  4008. const
  4009. kSAP_ONE = 1; { Configure a single minor device }
  4010. kSAP_RANGE = 2; { Configure a range of minor devices }
  4011. kSAP_ALL = 3; { Configure all minor devices }
  4012. kSAP_CLEAR = 4; { Clear autopush information }
  4013. { ***** Configuration Helpers *****}
  4014. {
  4015. These definitions are used by device driver and port scanner
  4016. developers to provide a library giving client-side information about
  4017. the registered ports, such as a user-visible name or an icon.
  4018. }
  4019. { Configuration helper library prefix}
  4020. {
  4021. This prefix is prepended to the string found in the "fResourceInfo"
  4022. field of the OTPortRecord to build the actual library name of the
  4023. configuration helper library.
  4024. }
  4025. const
  4026. kPortConfigLibPrefix = 'OTPortCfg$';
  4027. { Get user visible port name entry point.}
  4028. {
  4029. This entry point returns the user visible name of the port. If includeSlot
  4030. is true, a slot distinguishing suffix (eg "slot X") should be added. If
  4031. includePort is true, a port distinguishing suffix (eg " port X") should be added for
  4032. multiport cards.
  4033. }
  4034. const
  4035. kOTGetUserPortNameID = 'OTGetUserPortName';
  4036. type
  4037. OTGetPortNameProcPtr = procedure( var port: OTPortRecord; includeSlot: OTBooleanParam; includePort: OTBooleanParam; var userVisibleName: Str255 );
  4038. { Get icon entry point.}
  4039. {
  4040. This entry point returns the location of the icon for the port. Return false if no
  4041. icon is provided.
  4042. }
  4043. const
  4044. kOTGetPortIconID = 'OTGetPortIcon';
  4045. type
  4046. OTResourceLocatorPtr = ^OTResourceLocator;
  4047. OTResourceLocator = record
  4048. fFile: FSSpec;
  4049. fResID: UInt16;
  4050. end;
  4051. type
  4052. OTGetPortIconProcPtr = function( var port: OTPortRecord; var iconLocation: OTResourceLocator ): Boolean;
  4053. { ***** Application Access to Configuration Helpers *****}
  4054. {$ifc NOT OTKERNEL}
  4055. {
  4056. These routines are used by clients to get information about ports.
  4057. The canonical user of these routines is the OT control panel(s),
  4058. but applications may want to use them as well (to display the list
  4059. of available Ethernet cards, for example).
  4060. }
  4061. { Returns a user friendly name for a port.}
  4062. {
  4063. * OTGetUserPortNameFromPortRef()
  4064. *
  4065. * Availability:
  4066. * Mac OS X: not available
  4067. * CarbonLib: not available
  4068. * Non-Carbon CFM: not available
  4069. }
  4070. {
  4071. Returns the location for the icon familly representing the port.
  4072. Returns false if the port has no icon.
  4073. }
  4074. {
  4075. * OTGetPortIconFromPortRef()
  4076. *
  4077. * Availability:
  4078. * Mac OS X: not available
  4079. * CarbonLib: not available
  4080. * Non-Carbon CFM: not available
  4081. }
  4082. {
  4083. Gets the slot and other value for the default port of the given device type
  4084. Returns false if there is no default port of that device type
  4085. }
  4086. {
  4087. * OTGetDefaultPort()
  4088. *
  4089. * Availability:
  4090. * Mac OS X: not available
  4091. * CarbonLib: not available
  4092. * Non-Carbon CFM: not available
  4093. }
  4094. { Returns true if the port can be used with the specified protocol.}
  4095. {
  4096. * OTIsPortCompatibleWith()
  4097. *
  4098. * Availability:
  4099. * Mac OS X: not available
  4100. * CarbonLib: not available
  4101. * Non-Carbon CFM: not available
  4102. }
  4103. {$endc} { !OTKERNEL }
  4104. {$endc} { CALL_NOT_IN_CARBON }
  4105. { ***** Common Utilities *****}
  4106. {
  4107. The utilities defined in this section are available to both client
  4108. and kernel code. Cool huh? These utilities differ from those
  4109. provided in "OpenTransport.h" in that they are only available to native
  4110. architecture clients.
  4111. }
  4112. { Bitmap functions}
  4113. { These functions atomically deal with a bitmap that is multiple-bytes long}
  4114. {
  4115. Set the first clear bit in "bitMap", starting with bit "startBit",
  4116. giving up after "numBits". Returns the bit # that was set, or
  4117. a kOTNotFoundErr if there was no clear bit available
  4118. }
  4119. {
  4120. * OTSetFirstClearBit() *** DEPRECATED ***
  4121. *
  4122. * Availability:
  4123. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  4124. * CarbonLib: in CarbonLib 1.0 and later
  4125. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4126. }
  4127. function OTSetFirstClearBit( bitMap: UInt8Ptr; startBit: OTByteCount; numBits: OTByteCount ): OTResult; external name '_OTSetFirstClearBit';
  4128. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  4129. { Standard clear, set and test bit functions}
  4130. {
  4131. * OTClearBit() *** DEPRECATED ***
  4132. *
  4133. * Availability:
  4134. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  4135. * CarbonLib: in CarbonLib 1.0 and later
  4136. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4137. }
  4138. function OTClearBit( bitMap: UInt8Ptr; bitNo: OTByteCount ): Boolean; external name '_OTClearBit';
  4139. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  4140. {
  4141. * OTSetBit() *** DEPRECATED ***
  4142. *
  4143. * Availability:
  4144. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  4145. * CarbonLib: in CarbonLib 1.0 and later
  4146. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4147. }
  4148. function OTSetBit( bitMap: UInt8Ptr; bitNo: OTByteCount ): Boolean; external name '_OTSetBit';
  4149. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  4150. {
  4151. * OTTestBit() *** DEPRECATED ***
  4152. *
  4153. * Availability:
  4154. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  4155. * CarbonLib: in CarbonLib 1.0 and later
  4156. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4157. }
  4158. function OTTestBit( bitMap: UInt8Ptr; bitNo: OTByteCount ): Boolean; external name '_OTTestBit';
  4159. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
  4160. { OTHashList}
  4161. {
  4162. This implements a simple, but efficient hash list. It is not
  4163. thread-safe.
  4164. }
  4165. type
  4166. OTHashProcPtr = function( var linkToHash: OTLink ): UInt32;
  4167. OTHashSearchProcPtr = function( ref: {const} UnivPtr; var linkToCheck: OTLink ): Boolean;
  4168. OTHashListPtr = ^OTHashList;
  4169. OTHashList = record
  4170. fHashProc: OTHashProcPtr;
  4171. fHashTableSize: ByteCount;
  4172. fHashBuckets: ^OTLinkPtr;
  4173. end;
  4174. {
  4175. Return the number of bytes of memory needed to create a hash list
  4176. of at least "numEntries" entries.
  4177. }
  4178. {
  4179. * OTCalculateHashListMemoryNeeds()
  4180. *
  4181. * Availability:
  4182. * Mac OS X: not available
  4183. * CarbonLib: not available
  4184. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4185. }
  4186. {
  4187. Create an OTHashList from "memory". Return an error if it
  4188. couldn't be done.
  4189. }
  4190. {
  4191. * OTInitHashList()
  4192. *
  4193. * Availability:
  4194. * Mac OS X: not available
  4195. * CarbonLib: not available
  4196. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4197. }
  4198. {
  4199. * OTAddToHashList()
  4200. *
  4201. * Availability:
  4202. * Mac OS X: not available
  4203. * CarbonLib: not available
  4204. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4205. }
  4206. {
  4207. * OTRemoveLinkFromHashList()
  4208. *
  4209. * Availability:
  4210. * Mac OS X: not available
  4211. * CarbonLib: not available
  4212. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4213. }
  4214. {
  4215. * OTIsInHashList()
  4216. *
  4217. * Availability:
  4218. * Mac OS X: not available
  4219. * CarbonLib: not available
  4220. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4221. }
  4222. {
  4223. * OTFindInHashList()
  4224. *
  4225. * Availability:
  4226. * Mac OS X: not available
  4227. * CarbonLib: not available
  4228. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4229. }
  4230. {
  4231. * OTRemoveFromHashList()
  4232. *
  4233. * Availability:
  4234. * Mac OS X: not available
  4235. * CarbonLib: not available
  4236. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4237. }
  4238. { Random functions}
  4239. {
  4240. These implement a very simple random number generator, suitable
  4241. for protocol implementations but not "cryptographically" random.
  4242. }
  4243. {
  4244. * OTGetRandomSeed()
  4245. *
  4246. * Availability:
  4247. * Mac OS X: not available
  4248. * CarbonLib: not available
  4249. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4250. }
  4251. {
  4252. * OTGetRandomNumber()
  4253. *
  4254. * Availability:
  4255. * Mac OS X: not available
  4256. * CarbonLib: not available
  4257. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4258. }
  4259. { Concurrency Control}
  4260. {
  4261. OTGate implements a cool concurrency control primitive.
  4262. You're not going to understand it without reading the documentation!
  4263. See "Open Transport Advanced Client Programming" for details.
  4264. WARNING:
  4265. This structure must be on a 4-byte boundary.
  4266. }
  4267. type
  4268. OTGateProcPtr = function( var thisLink: OTLink ): Boolean;
  4269. CFMLibraryInfoPtr = ^CFMLibraryInfo;
  4270. CFMLibraryInfo = record
  4271. fLIFO: OTLIFO;
  4272. fList: OTList;
  4273. fProc: OTGateProcPtr;
  4274. fNumQueued: SInt32;
  4275. fInside: SInt32;
  4276. end;
  4277. {
  4278. * OTInitGate()
  4279. *
  4280. * Availability:
  4281. * Mac OS X: not available
  4282. * CarbonLib: not available
  4283. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4284. }
  4285. {
  4286. * OTEnterGate()
  4287. *
  4288. * Availability:
  4289. * Mac OS X: not available
  4290. * CarbonLib: not available
  4291. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4292. }
  4293. {
  4294. * OTLeaveGate()
  4295. *
  4296. * Availability:
  4297. * Mac OS X: not available
  4298. * CarbonLib: not available
  4299. * Non-Carbon CFM: in OTUtilityLib 1.0 and later
  4300. }
  4301. { ***** Shared Library Bonus Extras *****}
  4302. {$ifc CALL_NOT_IN_CARBON}
  4303. {
  4304. These routines provide addition shared library support beyond
  4305. that provided by the base shared library mechanism.
  4306. }
  4307. {
  4308. Some flags which can be passed to the "loadFlags" parameter of the
  4309. various CFM routines. Not all flags can be used with all routines.
  4310. See "Open Transport Advanced Client Programming" for details.
  4311. }
  4312. const
  4313. kOTGetDataSymbol = 0;
  4314. kOTGetCodeSymbol = 1;
  4315. kOTLoadNewCopy = 2;
  4316. kOTLoadACopy = 4;
  4317. kOTFindACopy = 8;
  4318. kOTLibMask = kOTLoadNewCopy or kOTLoadACopy or kOTFindACopy;
  4319. kOTLoadLibResident = $20;
  4320. { Finding all matching CFM libraries.}
  4321. {
  4322. The routine OTFindCFMLibraries allows you to find all CFM libraries
  4323. that match specific criteria. The result is placed in a list
  4324. of CFMLibraryInfo structures. OT allocates those structures using
  4325. a routine of type OTAllocMemProcPtr that you pass to OTFindCFMLibraries.
  4326. }
  4327. {
  4328. A list of CFMLibraryInfo structures is returned by the OTFindCFMLibraries routine.
  4329. The list is created out of the data that is passed to the function.
  4330. IMPORTANT:
  4331. Only the first 3 fields are valid when using OT 1.2 and older.
  4332. }
  4333. type
  4334. CFMLibraryInfoPtr = ^CFMLibraryInfo;
  4335. CFMLibraryInfo = record
  4336. link: OTLink; { To link them all up on a list }
  4337. libName: UnivPtr; { "C" String which is fragment name }
  4338. intlName: StringPtr; { Pascal String which is internationalized name }
  4339. fileSpec: FSSpecPtr; { location of fragment's file }
  4340. pstring2: StringPtr; { Secondary string from extended cfrg }
  4341. pstring3: StringPtr; { Extra info from extended cfrg }
  4342. end;
  4343. {
  4344. You must pass a routine of type OTAllocMemProcPtr to OTFindCFMLibraries
  4345. which it calls to allocate memory for the CFMLibraryInfo structures.
  4346. }
  4347. type
  4348. OTAllocMemProcPtr = function( size: OTByteCount ): UnivPtr;
  4349. { Find CFM libraries of the specified kind and type}
  4350. {
  4351. * OTFindCFMLibraries()
  4352. *
  4353. * Availability:
  4354. * Mac OS X: not available
  4355. * CarbonLib: not available
  4356. * Non-Carbon CFM: not available
  4357. }
  4358. { Loading libraries and connecting to symbols.}
  4359. { Load a CFM library by name}
  4360. {
  4361. * OTLoadCFMLibrary()
  4362. *
  4363. * Availability:
  4364. * Mac OS X: not available
  4365. * CarbonLib: not available
  4366. * Non-Carbon CFM: not available
  4367. }
  4368. { Load a CFM library and get a named pointer from it}
  4369. {
  4370. * OTGetCFMPointer()
  4371. *
  4372. * Availability:
  4373. * Mac OS X: not available
  4374. * CarbonLib: not available
  4375. * Non-Carbon CFM: not available
  4376. }
  4377. { Get a named pointer from a CFM library that's already loaded}
  4378. {
  4379. * OTGetCFMSymbol()
  4380. *
  4381. * Availability:
  4382. * Mac OS X: not available
  4383. * CarbonLib: not available
  4384. * Non-Carbon CFM: not available
  4385. }
  4386. { Release a connection to a CFM library}
  4387. {
  4388. * OTReleaseCFMConnection()
  4389. *
  4390. * Availability:
  4391. * Mac OS X: not available
  4392. * CarbonLib: not available
  4393. * Non-Carbon CFM: not available
  4394. }
  4395. {
  4396. You can call these routines in your CFM initialisation and termination
  4397. routines to hold or unhold your libraries sections.
  4398. }
  4399. {
  4400. Used in a CFM InitProc, will hold the executable code, if applicable.
  4401. This can also be the InitProc of the library
  4402. }
  4403. {
  4404. * OTHoldThisCFMLibrary()
  4405. *
  4406. * Availability:
  4407. * Mac OS X: not available
  4408. * CarbonLib: not available
  4409. * Non-Carbon CFM: not available
  4410. }
  4411. {
  4412. Used in a CFM terminate proc, will unhold the executable code, if applicable.
  4413. This can also be the terminate proc of the library
  4414. }
  4415. {
  4416. * OTUnholdThisCFMLibrary()
  4417. *
  4418. * Availability:
  4419. * Mac OS X: not available
  4420. * CarbonLib: not available
  4421. * Non-Carbon CFM: not available
  4422. }
  4423. { ASLM Utilities}
  4424. { Load an ASLM library}
  4425. {
  4426. * OTLoadASLMLibrary()
  4427. *
  4428. * Availability:
  4429. * Mac OS X: not available
  4430. * CarbonLib: not available
  4431. * Non-Carbon CFM: not available
  4432. }
  4433. { Unload an ASLM library}
  4434. {
  4435. * OTUnloadASLMLibrary()
  4436. *
  4437. * Availability:
  4438. * Mac OS X: not available
  4439. * CarbonLib: not available
  4440. * Non-Carbon CFM: not available
  4441. }
  4442. {
  4443. This is an ASLM utility routine. You can get it by including
  4444. "LibraryManagerUtilities.h", but since we only use a few ASLM utilities,
  4445. we put the prototype here for convenience.
  4446. }
  4447. {
  4448. * UnloadUnusedLibraries()
  4449. *
  4450. * Availability:
  4451. * Mac OS X: not available
  4452. * CarbonLib: not available
  4453. * Non-Carbon CFM: not available
  4454. }
  4455. {$ifc NOT OTKERNEL}
  4456. {******************************************************************************
  4457. ** A few C++ objects for C++ fans
  4458. *******************************************************************************}
  4459. {$ifc CALL_NOT_IN_CARBON}
  4460. {$endc} { CALL_NOT_IN_CARBON }
  4461. {$endc} { !OTKERNEL }
  4462. {$endc} { CALL_NOT_IN_CARBON }
  4463. end.