OpenTransportProtocol.pas 144 KB

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