OpenTransportProtocol.pas 144 KB

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